use of javax.tools.JavaFileObject in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldCompileWithBoxedTypesFieldsMarkedAsIgnoreNull.
@Test
public void shouldCompileWithBoxedTypesFieldsMarkedAsIgnoreNull() {
JavaFileObject model = JavaFileObjects.forResource("BoxedTypesFieldsIgnoreNull.java");
JavaFileObject generatedTypeMapping = JavaFileObjects.forResource("BoxedTypesFieldsIgnoreNullContentResolverTypeMapping.java");
JavaFileObject generatedDeleteResolver = JavaFileObjects.forResource("BoxedTypesFieldsIgnoreNullStorIOContentResolverDeleteResolver.java");
JavaFileObject generatedGetResolver = JavaFileObjects.forResource("BoxedTypesFieldsIgnoreNullStorIOContentResolverGetResolver.java");
JavaFileObject generatedPutResolver = JavaFileObjects.forResource("BoxedTypesFieldsIgnoreNullStorIOContentResolverPutResolver.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 shouldNotCompileIfAnnotatedFieldIsPrivate.
@Test
public void shouldNotCompileIfAnnotatedFieldIsPrivate() {
JavaFileObject model = JavaFileObjects.forResource("PrivateField.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("StorIOContentResolverColumn can not be applied to private field or method: id");
}
use of javax.tools.JavaFileObject in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldCompileWithMethodsReturningPrimitivesAndConstructorAsCreator.
@Test
public void shouldCompileWithMethodsReturningPrimitivesAndConstructorAsCreator() {
JavaFileObject model = JavaFileObjects.forResource("PrimitiveMethodsConstructor.java");
JavaFileObject generatedTypeMapping = JavaFileObjects.forResource("PrimitiveMethodsConstructorContentResolverTypeMapping.java");
JavaFileObject generatedDeleteResolver = JavaFileObjects.forResource("PrimitiveMethodsConstructorStorIOContentResolverDeleteResolver.java");
JavaFileObject generatedGetResolver = JavaFileObjects.forResource("PrimitiveMethodsConstructorStorIOContentResolverGetResolver.java");
JavaFileObject generatedPutResolver = JavaFileObjects.forResource("PrimitiveMethodsConstructorStorIOContentResolverPutResolver.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 shouldCompileWithBoxedTypesFields.
@Test
public void shouldCompileWithBoxedTypesFields() {
JavaFileObject model = JavaFileObjects.forResource("BoxedTypesFields.java");
JavaFileObject generatedTypeMapping = JavaFileObjects.forResource("BoxedTypesFieldsContentResolverTypeMapping.java");
JavaFileObject generatedDeleteResolver = JavaFileObjects.forResource("BoxedTypesFieldsStorIOContentResolverDeleteResolver.java");
JavaFileObject generatedGetResolver = JavaFileObjects.forResource("BoxedTypesFieldsStorIOContentResolverGetResolver.java");
JavaFileObject generatedPutResolver = JavaFileObjects.forResource("BoxedTypesFieldsStorIOContentResolverPutResolver.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 shouldNotCompileIfCreatorMethodReturnsDifferentType.
@Test
public void shouldNotCompileIfCreatorMethodReturnsDifferentType() {
JavaFileObject model = JavaFileObjects.forResource("CreatorMethodWithDifferentReturnType.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("StorIOContentResolverCreator can not be applied to method with return type different " + "from CreatorMethodWithDifferentReturnType");
}
Aggregations