Search in sources :

Example 1 with StorIOSQLiteProcessor

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

the class StorIOSQLiteAnnotationsProcessorTest method shouldCompileWithMethodsReturningBoxedTypesAndConstructorAsCreator.

@Test
public void shouldCompileWithMethodsReturningBoxedTypesAndConstructorAsCreator() {
    JavaFileObject model = JavaFileObjects.forResource("BoxedTypesMethodsConstructor.java");
    JavaFileObject generatedTypeMapping = JavaFileObjects.forResource("BoxedTypesMethodsConstructorSQLiteTypeMapping.java");
    JavaFileObject generatedDeleteResolver = JavaFileObjects.forResource("BoxedTypesMethodsConstructorStorIOSQLiteDeleteResolver.java");
    JavaFileObject generatedGetResolver = JavaFileObjects.forResource("BoxedTypesMethodsConstructorStorIOSQLiteGetResolver.java");
    JavaFileObject generatedPutResolver = JavaFileObjects.forResource("BoxedTypesMethodsConstructorStorIOSQLitePutResolver.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 2 with StorIOSQLiteProcessor

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

the class StorIOSQLiteAnnotationsProcessorTest method shouldNotCompileIfCreatorMethodReturnsDifferentType.

@Test
public void shouldNotCompileIfCreatorMethodReturnsDifferentType() {
    JavaFileObject model = JavaFileObjects.forResource("CreatorMethodWithDifferentReturnType.java");
    assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).failsToCompile().withErrorContaining("StorIOSQLiteCreator can not be applied to method with return type different from" + " CreatorMethodWithDifferentReturnType");
}
Also used : JavaFileObject(javax.tools.JavaFileObject) StorIOSQLiteProcessor(com.pushtorefresh.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor) Test(org.junit.Test)

Example 3 with StorIOSQLiteProcessor

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

the class StorIOSQLiteAnnotationsProcessorTest method shouldCompileWithMethodsReturningBoxedTypesAndMarkedAsIgnoreNullAndFactoryMethodAsCreator.

@Test
public void shouldCompileWithMethodsReturningBoxedTypesAndMarkedAsIgnoreNullAndFactoryMethodAsCreator() {
    JavaFileObject model = JavaFileObjects.forResource("BoxedTypesMethodsFactoryMethodIgnoreNull.java");
    JavaFileObject generatedTypeMapping = JavaFileObjects.forResource("BoxedTypesMethodsFactoryMethodIgnoreNullSQLiteTypeMapping.java");
    JavaFileObject generatedDeleteResolver = JavaFileObjects.forResource("BoxedTypesMethodsFactoryMethodIgnoreNullStorIOSQLiteDeleteResolver.java");
    JavaFileObject generatedGetResolver = JavaFileObjects.forResource("BoxedTypesMethodsFactoryMethodIgnoreNullStorIOSQLiteGetResolver.java");
    JavaFileObject generatedPutResolver = JavaFileObjects.forResource("BoxedTypesMethodsFactoryMethodIgnoreNullStorIOSQLitePutResolver.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 4 with StorIOSQLiteProcessor

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

the class StorIOSQLiteAnnotationsProcessorTest method shouldCompileWithMethodsReturningPrimitivesAndConstructorAsCreator.

@Test
public void shouldCompileWithMethodsReturningPrimitivesAndConstructorAsCreator() {
    JavaFileObject model = JavaFileObjects.forResource("PrimitiveMethodsConstructor.java");
    JavaFileObject generatedTypeMapping = JavaFileObjects.forResource("PrimitiveMethodsConstructorSQLiteTypeMapping.java");
    JavaFileObject generatedDeleteResolver = JavaFileObjects.forResource("PrimitiveMethodsConstructorStorIOSQLiteDeleteResolver.java");
    JavaFileObject generatedGetResolver = JavaFileObjects.forResource("PrimitiveMethodsConstructorStorIOSQLiteGetResolver.java");
    JavaFileObject generatedPutResolver = JavaFileObjects.forResource("PrimitiveMethodsConstructorStorIOSQLitePutResolver.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 5 with StorIOSQLiteProcessor

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

the class StorIOSQLiteAnnotationsProcessorTest method shouldCompileWithMethodsReturningPrimitivesAndFactoryMethodAsCreator.

@Test
public void shouldCompileWithMethodsReturningPrimitivesAndFactoryMethodAsCreator() {
    JavaFileObject model = JavaFileObjects.forResource("PrimitiveMethodsFactoryMethod.java");
    JavaFileObject generatedTypeMapping = JavaFileObjects.forResource("PrimitiveMethodsFactoryMethodSQLiteTypeMapping.java");
    JavaFileObject generatedDeleteResolver = JavaFileObjects.forResource("PrimitiveMethodsFactoryMethodStorIOSQLiteDeleteResolver.java");
    JavaFileObject generatedGetResolver = JavaFileObjects.forResource("PrimitiveMethodsFactoryMethodStorIOSQLiteGetResolver.java");
    JavaFileObject generatedPutResolver = JavaFileObjects.forResource("PrimitiveMethodsFactoryMethodStorIOSQLitePutResolver.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