use of javax.tools.JavaFileObject in project storio by pushtorefresh.
the class StorIOSQLiteAnnotationsProcessorTest method shouldCompileWithMethodsReturningPrimitivesAndConstructorAsCreator.
@Test
public void shouldCompileWithMethodsReturningPrimitivesAndConstructorAsCreator() {
JavaFileObject model = JavaFileObjects.forResource("PrimitiveMethodsConstructor.java");
JavaFileObject generatedTypeMapping = JavaFileObjects.forResource("PrimitiveMethodsConstructorSQLiteTypeMapping.java");
JavaFileObject generatedDeleteResolver = JavaFileObjects.forResource("PrimitiveMethodsConstructorStorIOSQLiteDeleteResolver.java");
JavaFileObject generatedGetResolver = JavaFileObjects.forResource("PrimitiveMethodsConstructorStorIOSQLiteGetResolver.java");
JavaFileObject generatedPutResolver = JavaFileObjects.forResource("PrimitiveMethodsConstructorStorIOSQLitePutResolver.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).compilesWithoutError().and().generatesSources(generatedTypeMapping, generatedDeleteResolver, generatedGetResolver, generatedPutResolver);
}
use of javax.tools.JavaFileObject in project storio by pushtorefresh.
the class StorIOSQLiteAnnotationsProcessorTest method shouldCompileWithMethodsReturningBoxedTypesAndFactoryMethodAsCreator.
@Test
public void shouldCompileWithMethodsReturningBoxedTypesAndFactoryMethodAsCreator() {
JavaFileObject model = JavaFileObjects.forResource("BoxedTypesMethodsFactoryMethod.java");
JavaFileObject generatedTypeMapping = JavaFileObjects.forResource("BoxedTypesMethodsFactoryMethodSQLiteTypeMapping.java");
JavaFileObject generatedDeleteResolver = JavaFileObjects.forResource("BoxedTypesMethodsFactoryMethodStorIOSQLiteDeleteResolver.java");
JavaFileObject generatedGetResolver = JavaFileObjects.forResource("BoxedTypesMethodsFactoryMethodStorIOSQLiteGetResolver.java");
JavaFileObject generatedPutResolver = JavaFileObjects.forResource("BoxedTypesMethodsFactoryMethodStorIOSQLitePutResolver.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).compilesWithoutError().and().generatesSources(generatedTypeMapping, generatedDeleteResolver, generatedGetResolver, generatedPutResolver);
}
use of javax.tools.JavaFileObject in project storio by pushtorefresh.
the class StorIOSQLiteAnnotationsProcessorTest method shouldCompileIfAnnotatedMethodIsFinal.
@Test
public void shouldCompileIfAnnotatedMethodIsFinal() {
JavaFileObject model = JavaFileObjects.forResource("FinalMethod.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).compilesWithoutError();
}
use of javax.tools.JavaFileObject in project storio by pushtorefresh.
the class StorIOSQLiteAnnotationsProcessorTest method shouldNotCompileIfNestedClassAnnotatedWithTypeAnnotation.
@Test
public void shouldNotCompileIfNestedClassAnnotatedWithTypeAnnotation() {
JavaFileObject model = JavaFileObjects.forResource("NestedClass.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).failsToCompile().withErrorContaining("StorIOSQLiteType can't be applied to nested or inner classes: ActualClass");
}
use of javax.tools.JavaFileObject 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");
}
Aggregations