use of com.pushtorefresh.storio.sqlite.annotations.processor.StorIOSQLiteProcessor in project storio by pushtorefresh.
the class StorIOSQLiteAnnotationsProcessorTest method shouldNotCompileIfColumnNameIsEmpty.
@Test
public void shouldNotCompileIfColumnNameIsEmpty() {
JavaFileObject model = JavaFileObjects.forResource("EmptyColumnName.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).failsToCompile().withErrorContaining("Column name is empty: id");
}
use of com.pushtorefresh.storio.sqlite.annotations.processor.StorIOSQLiteProcessor in project storio by pushtorefresh.
the class StorIOSQLiteAnnotationsProcessorTest method shouldCompileWithPrimitiveFields.
@Test
public void shouldCompileWithPrimitiveFields() {
JavaFileObject model = JavaFileObjects.forResource("PrimitiveFields.java");
JavaFileObject generatedTypeMapping = JavaFileObjects.forResource("PrimitiveFieldsSQLiteTypeMapping.java");
JavaFileObject generatedDeleteResolver = JavaFileObjects.forResource("PrimitiveFieldsStorIOSQLiteDeleteResolver.java");
JavaFileObject generatedGetResolver = JavaFileObjects.forResource("PrimitiveFieldsStorIOSQLiteGetResolver.java");
JavaFileObject generatedPutResolver = JavaFileObjects.forResource("PrimitiveFieldsStorIOSQLitePutResolver.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 shouldNotCompileIfClassDoesNotHaveKey.
@Test
public void shouldNotCompileIfClassDoesNotHaveKey() {
JavaFileObject model = JavaFileObjects.forResource("NoKey.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).failsToCompile().withErrorContaining("Class marked with StorIOSQLiteType annotation should have at least one KEY field or method marked with " + "StorIOSQLiteColumn annotation: NoKey");
}
use of com.pushtorefresh.storio.sqlite.annotations.processor.StorIOSQLiteProcessor in project storio by pushtorefresh.
the class StorIOSQLiteAnnotationsProcessorTest method shouldNotCompileIfClassContainsMultipleCreators.
@Test
public void shouldNotCompileIfClassContainsMultipleCreators() {
JavaFileObject model = JavaFileObjects.forResource("MultipleCreators.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).failsToCompile().withErrorContaining("Only one creator method or constructor is allowed: MultipleCreators");
}
use of com.pushtorefresh.storio.sqlite.annotations.processor.StorIOSQLiteProcessor in project storio by pushtorefresh.
the class StorIOSQLiteAnnotationsProcessorTest method shouldNotCompileIfClassNeedsCreatorAndDoesNotHaveOne.
@Test
public void shouldNotCompileIfClassNeedsCreatorAndDoesNotHaveOne() {
JavaFileObject model = JavaFileObjects.forResource("NoCreator.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).failsToCompile().withErrorContaining("Class marked with StorIOSQLiteType annotation needs factory method or constructor marked with " + "StorIOSQLiteCreator annotation: NoCreator");
}
Aggregations