use of com.pushtorefresh.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor in project storio by pushtorefresh.
the class StorIOSQLiteAnnotationsProcessorTest method shouldGenerateTableClass.
@Test
public void shouldGenerateTableClass() {
JavaFileObject model = JavaFileObjects.forResource("WithGeneratedTable.java");
JavaFileObject generatedTableClass = JavaFileObjects.forResource("WithGeneratedTableTable.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).compilesWithoutError().and().generatesSources(generatedTableClass);
}
use of com.pushtorefresh.storio3.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.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor in project storio by pushtorefresh.
the class StorIOSQLiteAnnotationsProcessorTest method shouldNotCompileIfCreatorsParametersDoNotMatchWithColumns.
@Test
public void shouldNotCompileIfCreatorsParametersDoNotMatchWithColumns() {
JavaFileObject model = JavaFileObjects.forResource("CreatorWithNotMatchingArguments.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 with parameters matching CreatorWithNotMatchingArguments columns");
}
use of com.pushtorefresh.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor in project storio by pushtorefresh.
the class StorIOSQLiteAnnotationsProcessorTest method shouldNotCompileWithPrivateFieldsdWithoutCreator.
@Test
public void shouldNotCompileWithPrivateFieldsdWithoutCreator() {
JavaFileObject model = JavaFileObjects.forResource("PrivateFieldsWithoutCreator.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: PrivateFieldsWithoutCreator");
}
use of com.pushtorefresh.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor in project storio by pushtorefresh.
the class StorIOSQLiteAnnotationsProcessorTest method shouldCompileWithBoxedTypesFieldsMarkedAsIgnoreNull.
@Test
public void shouldCompileWithBoxedTypesFieldsMarkedAsIgnoreNull() {
JavaFileObject model = JavaFileObjects.forResource("BoxedTypesFieldsIgnoreNull.java");
JavaFileObject generatedTypeMapping = JavaFileObjects.forResource("BoxedTypesFieldsIgnoreNullSQLiteTypeMapping.java");
JavaFileObject generatedDeleteResolver = JavaFileObjects.forResource("BoxedTypesFieldsIgnoreNullStorIOSQLiteDeleteResolver.java");
JavaFileObject generatedGetResolver = JavaFileObjects.forResource("BoxedTypesFieldsIgnoreNullStorIOSQLiteGetResolver.java");
JavaFileObject generatedPutResolver = JavaFileObjects.forResource("BoxedTypesFieldsIgnoreNullStorIOSQLitePutResolver.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).compilesWithoutError().and().generatesSources(generatedTypeMapping, generatedDeleteResolver, generatedGetResolver, generatedPutResolver);
}
Aggregations