use of javax.tools.JavaFileObject in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldNotCompileIfAnnotatedMethodHasParameters.
@Test
public void shouldNotCompileIfAnnotatedMethodHasParameters() {
JavaFileObject model = JavaFileObjects.forResource("MethodWithParameters.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("StorIOContentResolverColumn can not be applied to method with parameters: id");
}
use of javax.tools.JavaFileObject in project storio by pushtorefresh.
the class StorIOSQLiteAnnotationsProcessorTest method shouldNotCompileIfThereIsAColumnWithSameName.
@Test
public void shouldNotCompileIfThereIsAColumnWithSameName() {
JavaFileObject model = JavaFileObjects.forResource("SameColumnName.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).failsToCompile().withErrorContaining("Column name already used in this class: id");
}
use of javax.tools.JavaFileObject in project storio by pushtorefresh.
the class StorIOSQLiteAnnotationsProcessorTest method shouldNotCompileIfCreatorMethodReturnsDifferentType.
@Test
public void shouldNotCompileIfCreatorMethodReturnsDifferentType() {
JavaFileObject model = JavaFileObjects.forResource("CreatorMethodWithDifferentReturnType.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).failsToCompile().withErrorContaining("StorIOSQLiteCreator can not be applied to method with return type different " + "from CreatorMethodWithDifferentReturnType");
}
use of javax.tools.JavaFileObject in project storio by pushtorefresh.
the class StorIOSQLiteAnnotationsProcessorTest method shouldNotCompileIfCreatorIsPrivate.
@Test
public void shouldNotCompileIfCreatorIsPrivate() {
JavaFileObject model = JavaFileObjects.forResource("PrivateCreator.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).failsToCompile().withErrorContaining("StorIOSQLiteCreator can not be applied to private methods or constructors: <init>");
}
use of javax.tools.JavaFileObject in project storio by pushtorefresh.
the class StorIOSQLiteAnnotationsProcessorTest method shouldCompileWithMethodsReturningPrimitivesAndFactoryMethodAsCreator.
@Test
public void shouldCompileWithMethodsReturningPrimitivesAndFactoryMethodAsCreator() {
JavaFileObject model = JavaFileObjects.forResource("PrimitiveMethodsFactoryMethod.java");
JavaFileObject generatedTypeMapping = JavaFileObjects.forResource("PrimitiveMethodsFactoryMethodSQLiteTypeMapping.java");
JavaFileObject generatedDeleteResolver = JavaFileObjects.forResource("PrimitiveMethodsFactoryMethodStorIOSQLiteDeleteResolver.java");
JavaFileObject generatedGetResolver = JavaFileObjects.forResource("PrimitiveMethodsFactoryMethodStorIOSQLiteGetResolver.java");
JavaFileObject generatedPutResolver = JavaFileObjects.forResource("PrimitiveMethodsFactoryMethodStorIOSQLitePutResolver.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).compilesWithoutError().and().generatesSources(generatedTypeMapping, generatedDeleteResolver, generatedGetResolver, generatedPutResolver);
}
Aggregations