Search in sources :

Example 11 with StorIOSQLiteProcessor

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

the class StorIOSQLiteAnnotationsProcessorTest method shouldNotCompileIfClassDoesNotHaveKey.

@Test
public void shouldNotCompileIfClassDoesNotHaveKey() {
    JavaFileObject model = JavaFileObjects.forResource("NoKey.java");
    assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).failsToCompile().withErrorContaining("Class marked with StorIOSQLiteType annotation should have at least one KEY field or method marked with" + " StorIOSQLiteColumn annotation: NoKey");
}
Also used : JavaFileObject(javax.tools.JavaFileObject) StorIOSQLiteProcessor(com.pushtorefresh.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor) Test(org.junit.Test)

Example 12 with StorIOSQLiteProcessor

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

the class StorIOSQLiteAnnotationsProcessorTest method shouldNotCompileIfIgnoreNullIsUsedOnPrimitive.

@Test
public void shouldNotCompileIfIgnoreNullIsUsedOnPrimitive() {
    JavaFileObject model = JavaFileObjects.forResource("IgnoreNullOnPrimitive.java");
    assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).failsToCompile().withErrorContaining("ignoreNull should not be used for primitive type: id");
}
Also used : JavaFileObject(javax.tools.JavaFileObject) StorIOSQLiteProcessor(com.pushtorefresh.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor) Test(org.junit.Test)

Example 13 with StorIOSQLiteProcessor

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

the class StorIOSQLiteAnnotationsProcessorTest method shouldNotCompileIfClassIsEmpty.

@Test
public void shouldNotCompileIfClassIsEmpty() {
    JavaFileObject model = JavaFileObjects.forResource("EmptyClass.java");
    assert_().about(javaSource()).that(model).processedWith(new StorIOSQLiteProcessor()).failsToCompile().withErrorContaining("Class marked with StorIOSQLiteType annotation should have at least one field or method marked with" + " StorIOSQLiteColumn annotation: EmptyClass");
}
Also used : JavaFileObject(javax.tools.JavaFileObject) StorIOSQLiteProcessor(com.pushtorefresh.storio3.sqlite.annotations.processor.StorIOSQLiteProcessor) Test(org.junit.Test)

Example 14 with StorIOSQLiteProcessor

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

the class StorIOSQLiteAnnotationsProcessorTest method shouldCompileIfAnnotatedFieldIsPrivateAndHasIsGetter.

@Test
public void shouldCompileIfAnnotatedFieldIsPrivateAndHasIsGetter() {
    JavaFileObject model = JavaFileObjects.forResource("PrivateFieldWithIsGetter.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 15 with StorIOSQLiteProcessor

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

the class StorIOSQLiteAnnotationsProcessorTest method shouldCompileIfAnnotatedFieldIsPrivateAndHasNameStartingWithIs.

@Test
public void shouldCompileIfAnnotatedFieldIsPrivateAndHasNameStartingWithIs() {
    JavaFileObject model = JavaFileObjects.forResource("PrivateFieldWithNameStartingWithIs.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)

Aggregations

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