Search in sources :

Example 46 with StorIOContentResolverProcessor

use of com.pushtorefresh.storio3.contentresolver.annotations.processor.StorIOContentResolverProcessor in project storio by pushtorefresh.

the class StorIOContentResolverAnnotationsProcessorTest method shouldNotCompileIfCreatorNotInsideClass.

@Test
public void shouldNotCompileIfCreatorNotInsideClass() {
    JavaFileObject model = JavaFileObjects.forResource("CreatorNotInsideClass.java");
    assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("Please apply StorIOContentResolverCreator to constructor or factory method of class - not to CreatorNotInsideClass");
}
Also used : JavaFileObject(javax.tools.JavaFileObject) StorIOContentResolverProcessor(com.pushtorefresh.storio3.contentresolver.annotations.processor.StorIOContentResolverProcessor) Test(org.junit.Test)

Example 47 with StorIOContentResolverProcessor

use of com.pushtorefresh.storio3.contentresolver.annotations.processor.StorIOContentResolverProcessor in project storio by pushtorefresh.

the class StorIOContentResolverAnnotationsProcessorTest method shouldNotCompileIfCreatorMethodReturnsDifferentType.

@Test
public void shouldNotCompileIfCreatorMethodReturnsDifferentType() {
    JavaFileObject model = JavaFileObjects.forResource("CreatorMethodWithDifferentReturnType.java");
    assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("StorIOContentResolverCreator can not be applied to method with return type different from CreatorMethodWithDifferentReturnType");
}
Also used : JavaFileObject(javax.tools.JavaFileObject) StorIOContentResolverProcessor(com.pushtorefresh.storio3.contentresolver.annotations.processor.StorIOContentResolverProcessor) Test(org.junit.Test)

Aggregations

StorIOContentResolverProcessor (com.pushtorefresh.storio3.contentresolver.annotations.processor.StorIOContentResolverProcessor)47 JavaFileObject (javax.tools.JavaFileObject)47 Test (org.junit.Test)47