Search in sources :

Example 36 with StorIOSQLiteProcessor

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

the class StorIOSQLiteAnnotationsProcessorTest method shouldGenerateTableClassWithMultipleKeys.

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

Example 37 with StorIOSQLiteProcessor

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

the class StorIOSQLiteAnnotationsProcessorTest method shouldNotCompileIfAnnotatedMethodHasParameters.

@Test
public void shouldNotCompileIfAnnotatedMethodHasParameters() {
    JavaFileObject model = JavaFileObjects.forResource("MethodWithParameters.java");
    assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).failsToCompile().withErrorContaining("StorIOSQLiteColumn can not be applied to method with parameters: id");
}
Also used : JavaFileObject(javax.tools.JavaFileObject) StorIOSQLiteProcessor(com.pushtorefresh.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor) Test(org.junit.Test)

Example 38 with StorIOSQLiteProcessor

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

the class StorIOSQLiteAnnotationsProcessorTest method shouldNotCompileIfInnerClassAnnotatedWithTypeAnnotation.

@Test
public void shouldNotCompileIfInnerClassAnnotatedWithTypeAnnotation() {
    JavaFileObject model = JavaFileObjects.forResource("InnerClass.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.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor) Test(org.junit.Test)

Example 39 with StorIOSQLiteProcessor

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

Example 40 with StorIOSQLiteProcessor

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

the class StorIOSQLiteAnnotationsProcessorTest method shouldCompileWithPrivateBoxedTypesFieldsWithCorrespondingGettersAndMarkedAsIgnoreNull.

@Test
public void shouldCompileWithPrivateBoxedTypesFieldsWithCorrespondingGettersAndMarkedAsIgnoreNull() {
    JavaFileObject model = JavaFileObjects.forResource("BoxedTypesPrivateFieldsIgnoreNull.java");
    JavaFileObject generatedTypeMapping = JavaFileObjects.forResource("BoxedTypesPrivateFieldsIgnoreNullSQLiteTypeMapping.java");
    JavaFileObject generatedDeleteResolver = JavaFileObjects.forResource("BoxedTypesPrivateFieldsIgnoreNullStorIOSQLiteDeleteResolver.java");
    JavaFileObject generatedGetResolver = JavaFileObjects.forResource("BoxedTypesPrivateFieldsIgnoreNullStorIOSQLiteGetResolver.java");
    JavaFileObject generatedPutResolver = JavaFileObjects.forResource("BoxedTypesPrivateFieldsIgnoreNullStorIOSQLitePutResolver.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)

Aggregations

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