Search in sources :

Example 6 with StorIOSQLiteProcessor

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

Example 7 with StorIOSQLiteProcessor

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

Example 8 with StorIOSQLiteProcessor

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

Example 9 with StorIOSQLiteProcessor

use of com.pushtorefresh.storio.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.storio.sqlite.annotations.processor.StorIOSQLiteProcessor) Test(org.junit.Test)

Example 10 with StorIOSQLiteProcessor

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

the class StorIOSQLiteAnnotationsProcessorTest method shouldNotCompileIfNoArgConstructorIsAbsent.

@Test
public void shouldNotCompileIfNoArgConstructorIsAbsent() {
    JavaFileObject model = JavaFileObjects.forResource("AbsenceOfNoArgConstructor.java");
    assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).failsToCompile().withErrorContaining("constructor AbsenceOfNoArgConstructor in class " + "com.pushtorefresh.storio.sqlite.annotations.AbsenceOfNoArgConstructor cannot be applied to given types;\n" + "  required: long\n" + "  found: no arguments\n" + "  reason: actual and formal argument lists differ in length");
}
Also used : JavaFileObject(javax.tools.JavaFileObject) StorIOSQLiteProcessor(com.pushtorefresh.storio.sqlite.annotations.processor.StorIOSQLiteProcessor) Test(org.junit.Test)

Aggregations

StorIOSQLiteProcessor (com.pushtorefresh.storio.sqlite.annotations.processor.StorIOSQLiteProcessor)35 JavaFileObject (javax.tools.JavaFileObject)35 Test (org.junit.Test)35