use of com.pushtorefresh.storio.contentresolver.annotations.processor.StorIOContentResolverProcessor in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldNotCompileIfInnerClassAnnotatedWithTypeAnnotation.
@Test
public void shouldNotCompileIfInnerClassAnnotatedWithTypeAnnotation() {
JavaFileObject model = JavaFileObjects.forResource("InnerClass.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("StorIOContentResolverType can't be applied to nested or inner classes: ActualClass");
}
use of com.pushtorefresh.storio.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");
}
use of com.pushtorefresh.storio.contentresolver.annotations.processor.StorIOContentResolverProcessor in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldNotCompileIfCreatorsNumberOfArgumentsDoNotMatchWithColumnsNumber.
@Test
public void shouldNotCompileIfCreatorsNumberOfArgumentsDoNotMatchWithColumnsNumber() {
JavaFileObject model = JavaFileObjects.forResource("CreatorWithWrongNumberOfArguments.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("Class marked with StorIOContentResolverType annotation needs factory method or constructor marked with " + "StorIOContentResolverCreator annotation with the same amount of parameters as the number of columns: " + "CreatorWithWrongNumberOfArguments");
}
use of com.pushtorefresh.storio.contentresolver.annotations.processor.StorIOContentResolverProcessor in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldCompileWithMethodsReturningBoxedTypesAndConstructorAsCreator.
@Test
public void shouldCompileWithMethodsReturningBoxedTypesAndConstructorAsCreator() {
JavaFileObject model = JavaFileObjects.forResource("BoxedTypesMethodsConstructor.java");
JavaFileObject generatedTypeMapping = JavaFileObjects.forResource("BoxedTypesMethodsConstructorContentResolverTypeMapping.java");
JavaFileObject generatedDeleteResolver = JavaFileObjects.forResource("BoxedTypesMethodsConstructorStorIOContentResolverDeleteResolver.java");
JavaFileObject generatedGetResolver = JavaFileObjects.forResource("BoxedTypesMethodsConstructorStorIOContentResolverGetResolver.java");
JavaFileObject generatedPutResolver = JavaFileObjects.forResource("BoxedTypesMethodsConstructorStorIOContentResolverPutResolver.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).compilesWithoutError().and().generatesSources(generatedTypeMapping, generatedDeleteResolver, generatedGetResolver, generatedPutResolver);
}
use of com.pushtorefresh.storio.contentresolver.annotations.processor.StorIOContentResolverProcessor in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldNotCompileWithoutInsertUri.
@Test
public void shouldNotCompileWithoutInsertUri() {
JavaFileObject model = JavaFileObjects.forResource("NoInsertUri.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("Uri of NoInsertUri annotated with StorIOContentResolverType is empty for operation insert");
}
Aggregations