Search in sources :

Example 26 with JavaFileObject

use of javax.tools.JavaFileObject in project epoxy by airbnb.

the class EpoxyProcessorTest method testModelWithPrivateClassFails.

@Test
public void testModelWithPrivateClassFails() {
    JavaFileObject model = JavaFileObjects.forResource("ModelWithPrivateInnerClass.java");
    assert_().about(javaSource()).that(model).processedWith(new EpoxyProcessor()).failsToCompile().withErrorContaining("private classes");
}
Also used : JavaFileObject(javax.tools.JavaFileObject) Test(org.junit.Test)

Example 27 with JavaFileObject

use of javax.tools.JavaFileObject in project epoxy by airbnb.

the class EpoxyProcessorTest method testModelWithoutSetter.

@Test
public void testModelWithoutSetter() {
    JavaFileObject model = JavaFileObjects.forResource("ModelWithoutSetter.java");
    JavaFileObject generatedModel = JavaFileObjects.forResource("ModelWithoutSetter_.java");
    assert_().about(javaSource()).that(model).processedWith(new EpoxyProcessor()).compilesWithoutError().and().generatesSources(generatedModel);
}
Also used : JavaFileObject(javax.tools.JavaFileObject) Test(org.junit.Test)

Example 28 with JavaFileObject

use of javax.tools.JavaFileObject in project epoxy by airbnb.

the class EpoxyResourceProcessorTest method testGenerateDefaultLayoutMethod.

@Test
public void testGenerateDefaultLayoutMethod() {
    JavaFileObject model = JavaFileObjects.forResource("ModelForRProcessingTest.java");
    JavaFileObject generatedModel = JavaFileObjects.forResource("ModelForRProcessingTest_.java");
    assert_().about(javaSources()).that(Arrays.asList(model, R)).processedWith(new EpoxyProcessor()).compilesWithoutError().and().generatesSources(generatedModel);
}
Also used : JavaFileObject(javax.tools.JavaFileObject) Test(org.junit.Test)

Example 29 with JavaFileObject

use of javax.tools.JavaFileObject in project epoxy by airbnb.

the class EpoxyProcessorTest method testModelWithConstructors.

@Test
public void testModelWithConstructors() {
    JavaFileObject model = JavaFileObjects.forResource("ModelWithConstructors.java");
    JavaFileObject generatedModel = JavaFileObjects.forResource("ModelWithConstructors_.java");
    assert_().about(javaSource()).that(model).processedWith(new EpoxyProcessor()).compilesWithoutError().and().generatesSources(generatedModel);
}
Also used : JavaFileObject(javax.tools.JavaFileObject) Test(org.junit.Test)

Example 30 with JavaFileObject

use of javax.tools.JavaFileObject in project epoxy by airbnb.

the class EpoxyProcessorTest method testModelWithStaticAttributeFails.

@Test
public void testModelWithStaticAttributeFails() {
    JavaFileObject model = JavaFileObjects.forResource("ModelWithStaticField.java");
    assert_().about(javaSource()).that(model).processedWith(new EpoxyProcessor()).failsToCompile().withErrorContaining("static");
}
Also used : JavaFileObject(javax.tools.JavaFileObject) Test(org.junit.Test)

Aggregations

JavaFileObject (javax.tools.JavaFileObject)663 Test (org.junit.Test)473 ButterKnifeProcessor (butterknife.compiler.ButterKnifeProcessor)121 IOException (java.io.IOException)52 JavaCompiler (javax.tools.JavaCompiler)40 StorIOContentResolverProcessor (com.pushtorefresh.storio.contentresolver.annotations.processor.StorIOContentResolverProcessor)38 StorIOSQLiteProcessor (com.pushtorefresh.storio.sqlite.annotations.processor.StorIOSQLiteProcessor)35 File (java.io.File)32 Diagnostic (javax.tools.Diagnostic)30 DiagnosticCollector (javax.tools.DiagnosticCollector)28 SimpleJavaFileObject (javax.tools.SimpleJavaFileObject)25 StandardJavaFileManager (javax.tools.StandardJavaFileManager)25 ArrayList (java.util.ArrayList)24 TypeElement (javax.lang.model.element.TypeElement)21 Result (com.sun.tools.javac.main.Main.Result)20 Writer (java.io.Writer)17 PrintWriter (java.io.PrintWriter)16 CompilationTask (javax.tools.JavaCompiler.CompilationTask)14 JCTree (com.sun.tools.javac.tree.JCTree)10 StringWriter (java.io.StringWriter)10