use of javax.tools.JavaFileObject in project neo4j by neo4j.
the class ProcedureProcessorTest method emits_warnings_if_context_injected_field_types_are_unsupported.
@Test
public void emits_warnings_if_context_injected_field_types_are_unsupported() {
JavaFileObject sproc = JavaFileObjectUtils.INSTANCE.procedureSource("invalid/bad_context_field/BadContextTypeSproc.java");
assert_().about(javaSource()).that(sproc).processedWith(processor).compilesWithoutError().withWarningCount(2).withWarningContaining("@org.neo4j.procedure.Context usage warning: found type: <org.neo4j.kernel.internal.GraphDatabaseAPI>, expected one of: <org.neo4j.graphdb.GraphDatabaseService>, <org.neo4j.logging.Log>").in(sproc).onLine(30);
}
use of javax.tools.JavaFileObject in project neo4j by neo4j.
the class UserFunctionProcessorTest method fails_if_parameters_are_not_properly_annotated.
@Test
public void fails_if_parameters_are_not_properly_annotated() {
JavaFileObject function = JavaFileObjectUtils.INSTANCE.procedureSource("invalid/missing_name/MissingNameUserFunction.java");
UnsuccessfulCompilationClause compilation = assert_().about(javaSource()).that(function).processedWith(processor).failsToCompile().withErrorCount(2);
compilation.withErrorContaining("@org.neo4j.procedure.Name usage error: missing on parameter <parameter>").in(function).onLine(28);
compilation.withErrorContaining("@org.neo4j.procedure.Name usage error: missing on parameter <otherParam>").in(function).onLine(28);
}
use of javax.tools.JavaFileObject in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldNotCompileIfCreatorMethodIsNotStatic.
@Test
public void shouldNotCompileIfCreatorMethodIsNotStatic() {
JavaFileObject model = JavaFileObjects.forResource("NonStaticCreatorMethod.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("StorIOContentResolverCreator can not be applied to non-static methods: creator");
}
use of javax.tools.JavaFileObject in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldNotCompileIfColumnNameIsEmpty.
@Test
public void shouldNotCompileIfColumnNameIsEmpty() {
JavaFileObject model = JavaFileObjects.forResource("EmptyColumnName.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("Column name is empty: id");
}
use of javax.tools.JavaFileObject in project storio by pushtorefresh.
the class StorIOContentResolverAnnotationsProcessorTest method shouldNotCompileIfAnnotatedFieldIsFinal.
@Test
public void shouldNotCompileIfAnnotatedFieldIsFinal() {
JavaFileObject model = JavaFileObjects.forResource("FinalField.java");
assert_().about(javaSource()).that(model).processedWith(new StorIOContentResolverProcessor()).failsToCompile().withErrorContaining("StorIOContentResolverColumn can not be applied to final field: id");
}
Aggregations