use of com.pushtorefresh.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor in project storio by pushtorefresh.
the class StorIOSQLiteAnnotationsProcessorTest method shouldNotCompileIfCreatorInsideNotAnnotatedClass.
@Test
public void shouldNotCompileIfCreatorInsideNotAnnotatedClass() {
JavaFileObject model = JavaFileObjects.forResource("CreatorInsideNotAnnotatedClass.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).failsToCompile().withErrorContaining("Please annotate class CreatorInsideNotAnnotatedClass with StorIOSQLiteType");
}
use of com.pushtorefresh.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor in project storio by pushtorefresh.
the class StorIOSQLiteAnnotationsProcessorTest method shouldNotCompileIfNotClassAnnotatedWithTypeAnnotations.
@Test
public void shouldNotCompileIfNotClassAnnotatedWithTypeAnnotations() {
JavaFileObject model = JavaFileObjects.forResource("AnnotatedInterface.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).failsToCompile().withErrorContaining("StorIOSQLiteType can be applied only to classes not to AnnotatedInterface");
}
use of com.pushtorefresh.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor in project storio by pushtorefresh.
the class StorIOSQLiteAnnotationsProcessorTest method shouldCompileWithPrivateFinalFieldWithGetterAndCreator.
@Test
public void shouldCompileWithPrivateFinalFieldWithGetterAndCreator() {
JavaFileObject model = JavaFileObjects.forResource("PrivateFinalFieldWithGetterAndCreator.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).compilesWithoutError();
}
use of com.pushtorefresh.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor in project storio by pushtorefresh.
the class StorIOSQLiteAnnotationsProcessorTest method shouldCompileWithPrivateBoxedTypesFieldsWithCorrespondingGetters.
@Test
public void shouldCompileWithPrivateBoxedTypesFieldsWithCorrespondingGetters() {
JavaFileObject model = JavaFileObjects.forResource("BoxedTypesPrivateFields.java");
JavaFileObject generatedTypeMapping = JavaFileObjects.forResource("BoxedTypesPrivateFieldsSQLiteTypeMapping.java");
JavaFileObject generatedDeleteResolver = JavaFileObjects.forResource("BoxedTypesPrivateFieldsStorIOSQLiteDeleteResolver.java");
JavaFileObject generatedGetResolver = JavaFileObjects.forResource("BoxedTypesPrivateFieldsStorIOSQLiteGetResolver.java");
JavaFileObject generatedPutResolver = JavaFileObjects.forResource("BoxedTypesPrivateFieldsStorIOSQLitePutResolver.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).compilesWithoutError().and().generatesSources(generatedTypeMapping, generatedDeleteResolver, generatedGetResolver, generatedPutResolver);
}
use of com.pushtorefresh.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor in project storio by pushtorefresh.
the class StorIOSQLiteAnnotationsProcessorTest method shouldNotCompileIfTypeIsUnsupported.
@Test
public void shouldNotCompileIfTypeIsUnsupported() {
JavaFileObject model = JavaFileObjects.forResource("UnsupportedType.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).failsToCompile().withErrorContaining("Unsupported type of field or method for StorIOSQLiteColumn annotation, if you need to serialize/deserialize" + " field of that type -> please write your own resolver");
}
Aggregations