use of com.pushtorefresh.storio3.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");
}
use of com.pushtorefresh.storio3.contentresolver.annotations.processor.StorIOContentResolverProcessor in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldCompileIfAnnotatedFieldIsPrivateAndHasIsGetter.
@Test
public void shouldCompileIfAnnotatedFieldIsPrivateAndHasIsGetter() {
JavaFileObject model = JavaFileObjects.forResource("PrivateFieldWithIsGetter.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).compilesWithoutError();
}
use of com.pushtorefresh.storio3.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");
}
use of com.pushtorefresh.storio3.contentresolver.annotations.processor.StorIOContentResolverProcessor in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldCompileWithPrivatePrimitiveFieldsWithCorrepsondingGetters.
@Test
public void shouldCompileWithPrivatePrimitiveFieldsWithCorrepsondingGetters() {
JavaFileObject model = JavaFileObjects.forResource("PrimitivePrivateFields.java");
JavaFileObject generatedTypeMapping = JavaFileObjects.forResource("PrimitivePrivateFieldsContentResolverTypeMapping.java");
JavaFileObject generatedDeleteResolver = JavaFileObjects.forResource("PrimitivePrivateFieldsStorIOContentResolverDeleteResolver.java");
JavaFileObject generatedGetResolver = JavaFileObjects.forResource("PrimitivePrivateFieldsStorIOContentResolverGetResolver.java");
JavaFileObject generatedPutResolver = JavaFileObjects.forResource("PrimitivePrivateFieldsStorIOContentResolverPutResolver.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).compilesWithoutError().and().generatesSources(generatedTypeMapping, generatedDeleteResolver, generatedGetResolver, generatedPutResolver);
}
use of com.pushtorefresh.storio3.contentresolver.annotations.processor.StorIOContentResolverProcessor in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldNotCompileIfNestedClassAnnotatedWithTypeAnnotation.
@Test
public void shouldNotCompileIfNestedClassAnnotatedWithTypeAnnotation() {
JavaFileObject model = JavaFileObjects.forResource("NestedClass.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("StorIOContentResolverType can't be applied to nested or inner classes: ActualClass");
}
Aggregations