Search in sources :

Example 41 with StorIOSQLiteProcessor

use of com.pushtorefresh.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor in project storio by pushtorefresh.

the class StorIOSQLiteAnnotationsProcessorTest method shouldNotCompileIfCreatorInsideNotAnnotatedClass.

@Test
public void shouldNotCompileIfCreatorInsideNotAnnotatedClass() {
    JavaFileObject model = JavaFileObjects.forResource("CreatorInsideNotAnnotatedClass.java");
    assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).failsToCompile().withErrorContaining("Please annotate class CreatorInsideNotAnnotatedClass with StorIOSQLiteType");
}
Also used : JavaFileObject(javax.tools.JavaFileObject) StorIOSQLiteProcessor(com.pushtorefresh.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor) Test(org.junit.Test)

Example 42 with StorIOSQLiteProcessor

use of com.pushtorefresh.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor 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");
}
Also used : JavaFileObject(javax.tools.JavaFileObject) StorIOSQLiteProcessor(com.pushtorefresh.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor) Test(org.junit.Test)

Example 43 with StorIOSQLiteProcessor

use of com.pushtorefresh.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor in project storio by pushtorefresh.

the class StorIOSQLiteAnnotationsProcessorTest method shouldCompileWithPrivateFinalFieldWithGetterAndCreator.

@Test
public void shouldCompileWithPrivateFinalFieldWithGetterAndCreator() {
    JavaFileObject model = JavaFileObjects.forResource("PrivateFinalFieldWithGetterAndCreator.java");
    assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).compilesWithoutError();
}
Also used : JavaFileObject(javax.tools.JavaFileObject) StorIOSQLiteProcessor(com.pushtorefresh.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor) Test(org.junit.Test)

Example 44 with StorIOSQLiteProcessor

use of com.pushtorefresh.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor in project storio by pushtorefresh.

the class StorIOSQLiteAnnotationsProcessorTest method shouldCompileWithPrivateBoxedTypesFieldsWithCorrespondingGetters.

@Test
public void shouldCompileWithPrivateBoxedTypesFieldsWithCorrespondingGetters() {
    JavaFileObject model = JavaFileObjects.forResource("BoxedTypesPrivateFields.java");
    JavaFileObject generatedTypeMapping = JavaFileObjects.forResource("BoxedTypesPrivateFieldsSQLiteTypeMapping.java");
    JavaFileObject generatedDeleteResolver = JavaFileObjects.forResource("BoxedTypesPrivateFieldsStorIOSQLiteDeleteResolver.java");
    JavaFileObject generatedGetResolver = JavaFileObjects.forResource("BoxedTypesPrivateFieldsStorIOSQLiteGetResolver.java");
    JavaFileObject generatedPutResolver = JavaFileObjects.forResource("BoxedTypesPrivateFieldsStorIOSQLitePutResolver.java");
    assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).compilesWithoutError().and().generatesSources(generatedTypeMapping, generatedDeleteResolver, generatedGetResolver, generatedPutResolver);
}
Also used : JavaFileObject(javax.tools.JavaFileObject) StorIOSQLiteProcessor(com.pushtorefresh.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor) Test(org.junit.Test)

Example 45 with StorIOSQLiteProcessor

use of com.pushtorefresh.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor in project storio by pushtorefresh.

the class StorIOSQLiteAnnotationsProcessorTest method shouldNotCompileIfTypeIsUnsupported.

@Test
public void shouldNotCompileIfTypeIsUnsupported() {
    JavaFileObject model = JavaFileObjects.forResource("UnsupportedType.java");
    assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).failsToCompile().withErrorContaining("Unsupported type of field or method for StorIOSQLiteColumn annotation, if you need to serialize/deserialize" + " field of that type -> please write your own resolver");
}
Also used : JavaFileObject(javax.tools.JavaFileObject) StorIOSQLiteProcessor(com.pushtorefresh.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor) Test(org.junit.Test)

Aggregations

StorIOSQLiteProcessor (com.pushtorefresh.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor)47 JavaFileObject (javax.tools.JavaFileObject)47 Test (org.junit.Test)47