当前位置: 首页>>代码示例>>Java>>正文


Java CompileTester.SuccessfulCompilationClause方法代码示例

本文整理汇总了Java中com.google.testing.compile.CompileTester.SuccessfulCompilationClause方法的典型用法代码示例。如果您正苦于以下问题:Java CompileTester.SuccessfulCompilationClause方法的具体用法?Java CompileTester.SuccessfulCompilationClause怎么用?Java CompileTester.SuccessfulCompilationClause使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.testing.compile.CompileTester的用法示例。


在下文中一共展示了CompileTester.SuccessfulCompilationClause方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doTest

import com.google.testing.compile.CompileTester; //导入方法依赖的package包/类
private void doTest() throws Exception {
    LOG.info("Running test '{}' for parser '{}'", caseName, parserName);

    List<JavaFileObject> inputs = subFileObjetcs(inputPath);
    LOG.debug("Using inputs {}", inputs);

    List<String> options = parseOptions();
    LOG.debug("Using options {}", options);

    CompileTester.SuccessfulCompilationClause clause = Truth.assert_()
            .about(JavaSourcesSubjectFactory.javaSources())
            .that(subFileObjetcs(inputPath))
            .withCompilerOptions(options)
            .processedWith(new OpenAPIProcessor())
            .compilesWithoutError();

    resources(expectedPath)
            .stream()
            .peek(resource -> LOG.debug("Validating expectation on {}", resource))
            .forEach(resource -> clause.and()
                    .generatesFileNamed(LOCATION, resource.packageName, resource.relativeName)
                    .withContents(resource.byteSource));
}
 
开发者ID:Cosium,项目名称:openapi-annotation-processor,代码行数:24,代码来源:ParserCaseTester.java

示例2: testM1_NRelatedToOneAP_creates_GeneratedFiles_WhenSingleFileToProcess_UsesPreviouslyCompiledClass

import com.google.testing.compile.CompileTester; //导入方法依赖的package包/类
@Test
public void testM1_NRelatedToOneAP_creates_GeneratedFiles_WhenSingleFileToProcess_UsesPreviouslyCompiledClass() {
  //GIVEN
  JavaFileObject source = forSourceString("test.Test", "" //
      + "package test;\n" //
      + "import org.gradle.incap.Annotation1;\n" //
      + "@Annotation1\n" //
      + "public class Test extends org.gradle.incap.util.Untouched{\n" //
      + "}");
  JavaFileObject expected0 = forSourceString("M1_NRelatedToOneAP_TestGen0", "" //
      + "\n" //
      + "public class M1_NRelatedToOneAP_TestGen0 {\n" //
      + "}");

  //WHEN
  //THEN
  CompileTester.SuccessfulCompilationClause successfulCompilationClause = Truth.assertAbout(JavaSourceSubjectFactory.javaSource()).that(source) //
      .withCompilerOptions("-Xlint:-processing","-Aincap.mapping.folder=.") //
      .processedWith(new M1_NRelatedToOneAP()) //
      .compilesWithoutError().and().generatesSources(expected0);

  try {
    successfulCompilationClause //
        .and() //
        .generatesFileNamed(StandardLocation.SOURCE_OUTPUT, "", "M1_NRelatedToOneAP_UntouchedGen0");
    fail();
  } catch (AssertionError e) {
  }
}
 
开发者ID:gradle,项目名称:incap,代码行数:30,代码来源:M1_NRelatedToOneAPTest.java

示例3: forSourceString

import com.google.testing.compile.CompileTester; //导入方法依赖的package包/类
@Test
public void testM1_OneToOneAP_incremental_creates_GeneratedFile_WhenSingleFileToProcess_UsesPreviouslyCompiledClass() {
  //GIVEN
  source = forSourceString("test.Test", "" //
      + "package test;\n" //
      + "import org.gradle.incap.Annotation1;\n" //
      + "@Annotation1\n" //
      + "public class Test extends org.gradle.incap.util.Untouched {\n" //
      + "}");
  expected = forSourceString("M1_OneToOneAP_TestGen0", "" //
      + "\n" //
      + "public class M1_OneToOneAP_TestGen0 {\n" //
      + "}");

  //WHEN
  //THEN
  CompileTester.SuccessfulCompilationClause successfulCompilationClause = Truth.assertAbout(JavaSourceSubjectFactory.javaSource()) //
      .that(source) //
      .withCompilerOptions("-Xlint:-processing","-Aincap.mapping.folder=.") //
      .withClasspathFrom(getClass().getClassLoader()) //
      .processedWith(new M1_OneToOneAP()) //
      .compilesWithoutError() //
      .and() //
      .generatesSources(expected);

  try {
    successfulCompilationClause //
        .and() //
        .generatesFileNamed(StandardLocation.SOURCE_OUTPUT, "", "M1_OneToOneAP_UntouchedGen0");
    fail();
  } catch (AssertionError e) {
  }
}
 
开发者ID:gradle,项目名称:incap,代码行数:34,代码来源:M1_OneToOneAPTest.java

示例4: testM1_NRelatedToOneAP_creates_GeneratedFiles_WhenTwoFileToProcess_UsesPreviouslyCompiledClass

import com.google.testing.compile.CompileTester; //导入方法依赖的package包/类
@Test
public void testM1_NRelatedToOneAP_creates_GeneratedFiles_WhenTwoFileToProcess_UsesPreviouslyCompiledClass() {
  //GIVEN
  JavaFileObject source0 = forSourceString("test.Test0", "" //
      + "package test;\n" //
      + "import org.gradle.incap.Annotation1;\n" //
      + "@Annotation1\n" //
      + "public class Test0 extends org.gradle.incap.util.Untouched {\n" //
      + "}\n" //
      + "@Annotation1\n" //
      + "class Test1 extends Test0{\n" //
      + "}");
  JavaFileObject expected00 = forSourceString("M1_NRelatedToOneAP_Test0Gen0", "" //
      + "\n" //
      + "public class M1_NRelatedToOneAP_Test0Gen0 {\n" //
      + "}");

  JavaFileObject expected01 = forSourceString("M1_NRelatedToOneAP_Test1Gen0", "" //
      + "\n" //
      + "public class M1_NRelatedToOneAP_Test1Gen0 {\n" //
      + "}");
  JavaFileObject expected10 = forSourceString("M1_NRelatedToOneAP_Test1_Test0Gen0", "" //
      + "\n" //
      + "public class M1_NRelatedToOneAP_Test1_Test0Gen0 {\n" //
      + "}");

  //WHEN
  //THEN
  CompileTester.SuccessfulCompilationClause successfulCompilationClause = Truth.assertAbout(JavaSourceSubjectFactory.javaSource()).that(source0) //
      .withCompilerOptions("-Xlint:-processing","-Aincap.mapping.folder=.") //
      .processedWith(new M1_NRelatedToOneAP()) //
      .compilesWithoutError().and().generatesSources(expected00, expected01, expected10);

  try {
    Truth.assertAbout(JavaSourceSubjectFactory.javaSource()).that(source0) //
        .withCompilerOptions("-Xlint:-processing","-Aincap.mapping.folder=.") //
        .processedWith(new M1_NRelatedToOneAP()) //
        .compilesWithoutError().and().generatesSources(expected00, expected01, expected10) //
        .and() //
        .generatesFileNamed(StandardLocation.SOURCE_OUTPUT, "", "M1_NRelatedToOneAP_UntouchedGen0");
    fail();
  } catch (AssertionError e) {
  }
}
 
开发者ID:gradle,项目名称:incap,代码行数:45,代码来源:M1_NRelatedToOneAPTest.java

示例5: compilesWithoutErrors

import com.google.testing.compile.CompileTester; //导入方法依赖的package包/类
@Override
public CompileTester.SuccessfulCompilationClause compilesWithoutErrors() {
    return Truth.assert_().about(javaSource()).that(JavaFileObjects.forResource(inputClassName))
            .processedWith(processor, rest).compilesWithoutError();
}
 
开发者ID:GwtDomino,项目名称:domino,代码行数:6,代码来源:SingleTargetProcessor.java

示例6: compilesWithoutErrors

import com.google.testing.compile.CompileTester; //导入方法依赖的package包/类
@Override
public CompileTester.SuccessfulCompilationClause compilesWithoutErrors() {
    return Truth.assert_().about(javaSources()).that(Arrays.asList(asJavaFileObjectsArray()))
            .processedWith(processor, rest).compilesWithoutError();
}
 
开发者ID:GwtDomino,项目名称:domino,代码行数:6,代码来源:MultipleTargetProcessor.java

示例7: assertJavaSourceCompileWithoutError

import com.google.testing.compile.CompileTester; //导入方法依赖的package包/类
protected CompileTester.SuccessfulCompilationClause assertJavaSourceCompileWithoutError() {
    return ASSERT.about(javaSource())
        .that(javaSourceCode)
        .processedWith(rnrProcessors())
        .compilesWithoutError();
}
 
开发者ID:stephanenicolas,项目名称:reflection-no-reflection,代码行数:7,代码来源:ModuleTest.java

示例8: assertJavaSourceCompileWithoutErrorAndGenerateExpectedSource

import com.google.testing.compile.CompileTester; //导入方法依赖的package包/类
protected CompileTester.SuccessfulCompilationClause assertJavaSourceCompileWithoutErrorAndGenerateExpectedSource() {
    return assertJavaSourceCompileWithoutError()
        .and()
        .generatesSources(generatedSourceCode);
}
 
开发者ID:stephanenicolas,项目名称:reflection-no-reflection,代码行数:6,代码来源:ModuleTest.java

示例9: compilesWithoutErrors

import com.google.testing.compile.CompileTester; //导入方法依赖的package包/类
CompileTester.SuccessfulCompilationClause compilesWithoutErrors(); 
开发者ID:GwtDomino,项目名称:domino,代码行数:2,代码来源:BaseTargetProcessor.java


注:本文中的com.google.testing.compile.CompileTester.SuccessfulCompilationClause方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。