use of javax.tools.JavaFileObject in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldCompileIfAnnotatedMethodIsFinal.
@Test
public void shouldCompileIfAnnotatedMethodIsFinal() {
JavaFileObject model = JavaFileObjects.forResource("FinalMethod.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).compilesWithoutError();
}
use of javax.tools.JavaFileObject in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldNotCompileIfIgnoreNullIsUsedOnPrimitive.
@Test
public void shouldNotCompileIfIgnoreNullIsUsedOnPrimitive() {
JavaFileObject model = JavaFileObjects.forResource("IgnoreNullOnPrimitive.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("ignoreNull should not be used for primitive type: id");
}
use of javax.tools.JavaFileObject in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldCompileWithMethodsReturningBoxedTypesAndFactoryMethodAsCreator.
@Test
public void shouldCompileWithMethodsReturningBoxedTypesAndFactoryMethodAsCreator() {
JavaFileObject model = JavaFileObjects.forResource("BoxedTypesMethodsFactoryMethod.java");
JavaFileObject generatedTypeMapping = JavaFileObjects.forResource("BoxedTypesMethodsFactoryMethodContentResolverTypeMapping.java");
JavaFileObject generatedDeleteResolver = JavaFileObjects.forResource("BoxedTypesMethodsFactoryMethodStorIOContentResolverDeleteResolver.java");
JavaFileObject generatedGetResolver = JavaFileObjects.forResource("BoxedTypesMethodsFactoryMethodStorIOContentResolverGetResolver.java");
JavaFileObject generatedPutResolver = JavaFileObjects.forResource("BoxedTypesMethodsFactoryMethodStorIOContentResolverPutResolver.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).compilesWithoutError().and().generatesSources(generatedTypeMapping, generatedDeleteResolver, generatedGetResolver, generatedPutResolver);
}
use of javax.tools.JavaFileObject in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldCompileWithMethodsReturningPrimitivesAndFactoryMethodAsCreator.
@Test
public void shouldCompileWithMethodsReturningPrimitivesAndFactoryMethodAsCreator() {
JavaFileObject model = JavaFileObjects.forResource("PrimitiveMethodsFactoryMethod.java");
JavaFileObject generatedTypeMapping = JavaFileObjects.forResource("PrimitiveMethodsFactoryMethodContentResolverTypeMapping.java");
JavaFileObject generatedDeleteResolver = JavaFileObjects.forResource("PrimitiveMethodsFactoryMethodStorIOContentResolverDeleteResolver.java");
JavaFileObject generatedGetResolver = JavaFileObjects.forResource("PrimitiveMethodsFactoryMethodStorIOContentResolverGetResolver.java");
JavaFileObject generatedPutResolver = JavaFileObjects.forResource("PrimitiveMethodsFactoryMethodStorIOContentResolverPutResolver.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).compilesWithoutError().and().generatesSources(generatedTypeMapping, generatedDeleteResolver, generatedGetResolver, generatedPutResolver);
}
use of javax.tools.JavaFileObject in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldNotCompileIfTypeIsUnsupported.
@Test
public void shouldNotCompileIfTypeIsUnsupported() {
JavaFileObject model = JavaFileObjects.forResource("UnsupportedType.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("Unsupported type of field or method for StorIOContentResolverColumn annotation," + " if you need to serialize/deserialize field of that type -> please write your own resolver");
}
Aggregations