use of com.pushtorefresh.storio3.contentresolver.annotations.processor.StorIOContentResolverProcessor in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldNotCompileIfCreatorsArgumentsDoNotMatchWithColumns.
@Test
public void shouldNotCompileIfCreatorsArgumentsDoNotMatchWithColumns() {
JavaFileObject model = JavaFileObjects.forResource("CreatorWithNotMatchingArguments.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 parameters matching CreatorWithNotMatchingArguments columns");
}
use of com.pushtorefresh.storio3.contentresolver.annotations.processor.StorIOContentResolverProcessor in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldNotCompileIfCreatorInsideNotAnnotatedClass.
@Test
public void shouldNotCompileIfCreatorInsideNotAnnotatedClass() {
JavaFileObject model = JavaFileObjects.forResource("CreatorInsideNotAnnotatedClass.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("Please annotate class CreatorInsideNotAnnotatedClass with StorIOContentResolverType");
}
use of com.pushtorefresh.storio3.contentresolver.annotations.processor.StorIOContentResolverProcessor in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldCompileWithPrivateFinalFieldWithGetterAndCreator.
@Test
public void shouldCompileWithPrivateFinalFieldWithGetterAndCreator() {
JavaFileObject model = JavaFileObjects.forResource("PrivateFinalFieldWithGetterAndCreator.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 shouldNotCompileIfAnnotatedMethodHasParameters.
@Test
public void shouldNotCompileIfAnnotatedMethodHasParameters() {
JavaFileObject model = JavaFileObjects.forResource("MethodWithParameters.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("StorIOContentResolverColumn can not be applied to method with parameters: id");
}
use of com.pushtorefresh.storio3.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);
}
Aggregations