Search in sources :

Example 16 with StorIOContentResolverProcessor

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

the class StorIOContentResolverAnnotationsProcessorTest method shouldNotCompileIfNotClassAnnotatedWithTypeAnnotations.

@Test
public void shouldNotCompileIfNotClassAnnotatedWithTypeAnnotations() {
    JavaFileObject model = JavaFileObjects.forResource("AnnotatedInterface.java");
    assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("StorIOContentResolverType can be applied only to classes not to AnnotatedInterface");
}
Also used : JavaFileObject(javax.tools.JavaFileObject) StorIOContentResolverProcessor(com.pushtorefresh.storio.contentresolver.annotations.processor.StorIOContentResolverProcessor) Test(org.junit.Test)

Example 17 with StorIOContentResolverProcessor

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

the class StorIOContentResolverAnnotationsProcessorTest method shouldNotCompileIfClassContainsMultipleCreators.

@Test
public void shouldNotCompileIfClassContainsMultipleCreators() {
    JavaFileObject model = JavaFileObjects.forResource("MultipleCreators.java");
    assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("Only one creator method or constructor is allowed: MultipleCreators");
}
Also used : JavaFileObject(javax.tools.JavaFileObject) StorIOContentResolverProcessor(com.pushtorefresh.storio.contentresolver.annotations.processor.StorIOContentResolverProcessor) Test(org.junit.Test)

Example 18 with StorIOContentResolverProcessor

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

the class StorIOContentResolverAnnotationsProcessorTest method shouldNotCompileIfClassDoesNotHaveKey.

@Test
public void shouldNotCompileIfClassDoesNotHaveKey() {
    JavaFileObject model = JavaFileObjects.forResource("NoKey.java");
    assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("Class marked with StorIOContentResolverType annotation should have at least one KEY field or method marked with " + "StorIOContentResolverColumn annotation: NoKey");
}
Also used : JavaFileObject(javax.tools.JavaFileObject) StorIOContentResolverProcessor(com.pushtorefresh.storio.contentresolver.annotations.processor.StorIOContentResolverProcessor) Test(org.junit.Test)

Example 19 with StorIOContentResolverProcessor

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

the class StorIOContentResolverAnnotationsProcessorTest method shouldNotCompileIfNoArgConstructorIsAbsent.

@Test
public void shouldNotCompileIfNoArgConstructorIsAbsent() {
    JavaFileObject model = JavaFileObjects.forResource("AbsenceOfNoArgConstructor.java");
    assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("constructor AbsenceOfNoArgConstructor in class " + "com.pushtorefresh.storio.contentresolver.annotations.AbsenceOfNoArgConstructor cannot be applied to given types;\n" + "  required: long\n" + "  found: no arguments\n" + "  reason: actual and formal argument lists differ in length");
}
Also used : JavaFileObject(javax.tools.JavaFileObject) StorIOContentResolverProcessor(com.pushtorefresh.storio.contentresolver.annotations.processor.StorIOContentResolverProcessor) Test(org.junit.Test)

Example 20 with StorIOContentResolverProcessor

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

the class StorIOContentResolverAnnotationsProcessorTest method shouldNotCompileWithoutAnyUris.

@Test
public void shouldNotCompileWithoutAnyUris() {
    JavaFileObject model = JavaFileObjects.forResource("NoUris.java");
    assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("Uri of NoUris annotated with StorIOContentResolverType is empty");
}
Also used : JavaFileObject(javax.tools.JavaFileObject) StorIOContentResolverProcessor(com.pushtorefresh.storio.contentresolver.annotations.processor.StorIOContentResolverProcessor) Test(org.junit.Test)

Aggregations

StorIOContentResolverProcessor (com.pushtorefresh.storio.contentresolver.annotations.processor.StorIOContentResolverProcessor)38 JavaFileObject (javax.tools.JavaFileObject)38 Test (org.junit.Test)38