use of com.pushtorefresh.storio.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");
}
use of com.pushtorefresh.storio.sqlite.annotations.processor.StorIOSQLiteProcessor in project storio by pushtorefresh.
the class StorIOSQLiteAnnotationsProcessorTest method shouldNotCompileIfIgnoreNullIsUsedOnPrimitive.
@Test
public void shouldNotCompileIfIgnoreNullIsUsedOnPrimitive() {
JavaFileObject model = JavaFileObjects.forResource("IgnoreNullOnPrimitive.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).failsToCompile().withErrorContaining("ignoreNull should not be used for primitive type: id");
}
use of com.pushtorefresh.storio.sqlite.annotations.processor.StorIOSQLiteProcessor in project storio by pushtorefresh.
the class StorIOSQLiteAnnotationsProcessorTest method shouldNotCompileIfInnerClassAnnotatedWithTypeAnnotation.
@Test
public void shouldNotCompileIfInnerClassAnnotatedWithTypeAnnotation() {
JavaFileObject model = JavaFileObjects.forResource("InnerClass.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).failsToCompile().withErrorContaining("StorIOSQLiteType can't be applied to nested or inner classes: ActualClass");
}
use of com.pushtorefresh.storio.sqlite.annotations.processor.StorIOSQLiteProcessor in project storio by pushtorefresh.
the class StorIOSQLiteAnnotationsProcessorTest method shouldCompileWithMethodsReturningBoxedTypesAndMarkedAsIgnoreNullAndConstructorAsCreator.
@Test
public void shouldCompileWithMethodsReturningBoxedTypesAndMarkedAsIgnoreNullAndConstructorAsCreator() {
JavaFileObject model = JavaFileObjects.forResource("BoxedTypesMethodsConstructorIgnoreNull.java");
JavaFileObject generatedTypeMapping = JavaFileObjects.forResource("BoxedTypesMethodsConstructorIgnoreNullSQLiteTypeMapping.java");
JavaFileObject generatedDeleteResolver = JavaFileObjects.forResource("BoxedTypesMethodsConstructorIgnoreNullStorIOSQLiteDeleteResolver.java");
JavaFileObject generatedGetResolver = JavaFileObjects.forResource("BoxedTypesMethodsConstructorIgnoreNullStorIOSQLiteGetResolver.java");
JavaFileObject generatedPutResolver = JavaFileObjects.forResource("BoxedTypesMethodsConstructorIgnoreNullStorIOSQLitePutResolver.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).compilesWithoutError().and().generatesSources(generatedTypeMapping, generatedDeleteResolver, generatedGetResolver, generatedPutResolver);
}
use of com.pushtorefresh.storio.sqlite.annotations.processor.StorIOSQLiteProcessor in project storio by pushtorefresh.
the class StorIOSQLiteAnnotationsProcessorTest method shouldNotCompileIfAnnotatedMethodHasParameters.
@Test
public void shouldNotCompileIfAnnotatedMethodHasParameters() {
JavaFileObject model = JavaFileObjects.forResource("MethodWithParameters.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).failsToCompile().withErrorContaining("StorIOSQLiteColumn can not be applied to method with parameters: id");
}
Aggregations