use of com.pushtorefresh.storio3.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");
}
use of com.pushtorefresh.storio3.contentresolver.annotations.processor.StorIOContentResolverProcessor in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldNotCompileIfClassContainsBothAnnotatedFieldsAndMethods.
@Test
public void shouldNotCompileIfClassContainsBothAnnotatedFieldsAndMethods() {
JavaFileObject model = JavaFileObjects.forResource("MixedFieldsAndMethods.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("Can't apply StorIOContentResolverColumn annotation to both fields and methods in a same class: MixedFieldsAndMethods");
}
use of com.pushtorefresh.storio3.contentresolver.annotations.processor.StorIOContentResolverProcessor in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldCompileWithPrivateBoxedTypesFieldsWithCorresondingGettersAndMarkedAsIgnoreNull.
@Test
public void shouldCompileWithPrivateBoxedTypesFieldsWithCorresondingGettersAndMarkedAsIgnoreNull() {
JavaFileObject model = JavaFileObjects.forResource("BoxedTypesPrivateFieldsIgnoreNull.java");
JavaFileObject generatedTypeMapping = JavaFileObjects.forResource("BoxedTypesPrivateFieldsIgnoreNullContentResolverTypeMapping.java");
JavaFileObject generatedDeleteResolver = JavaFileObjects.forResource("BoxedTypesPrivateFieldsIgnoreNullStorIOContentResolverDeleteResolver.java");
JavaFileObject generatedGetResolver = JavaFileObjects.forResource("BoxedTypesPrivateFieldsIgnoreNullStorIOContentResolverGetResolver.java");
JavaFileObject generatedPutResolver = JavaFileObjects.forResource("BoxedTypesPrivateFieldsIgnoreNullStorIOContentResolverPutResolver.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 shouldCompileWithBoxedTypesFieldsMarkedAsIgnoreNull.
@Test
public void shouldCompileWithBoxedTypesFieldsMarkedAsIgnoreNull() {
JavaFileObject model = JavaFileObjects.forResource("BoxedTypesFieldsIgnoreNull.java");
JavaFileObject generatedTypeMapping = JavaFileObjects.forResource("BoxedTypesFieldsIgnoreNullContentResolverTypeMapping.java");
JavaFileObject generatedDeleteResolver = JavaFileObjects.forResource("BoxedTypesFieldsIgnoreNullStorIOContentResolverDeleteResolver.java");
JavaFileObject generatedGetResolver = JavaFileObjects.forResource("BoxedTypesFieldsIgnoreNullStorIOContentResolverGetResolver.java");
JavaFileObject generatedPutResolver = JavaFileObjects.forResource("BoxedTypesFieldsIgnoreNullStorIOContentResolverPutResolver.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 shouldNotCompileWithPrivateFieldsWithoutCreator.
@Test
public void shouldNotCompileWithPrivateFieldsWithoutCreator() {
JavaFileObject model = JavaFileObjects.forResource("PrivateFieldsWithoutCreator.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: PrivateFieldsWithoutCreator");
}
Aggregations