Пример #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test @Ignore("javac fails to publish the deferred diagnostic of the second error to com.google.testing.compile.Compiler") public void fails_if_aggregation_function_exposes_return_type_without_aggregation_methods()
        public virtual void FailsIfAggregationFunctionExposesReturnTypeWithoutAggregationMethods()
        {
            JavaFileObject function = JavaFileObjectUtils.INSTANCE.procedureSource("invalid/aggregation/FunctionWithoutAggregationMethods.java");

            CompileTester.UnsuccessfulCompilationClause unsuccessfulCompilationClause = assert_().about(javaSource()).that(function).processedWith(Processor()).failsToCompile().withErrorCount(2);

            unsuccessfulCompilationClause.withErrorContaining("@UserAggregationUpdate usage error: expected aggregation type " + "<org.neo4j.tooling.procedure.procedures.invalid.aggregation.FunctionWithoutAggregationMethods.MyAggregation> " + "to define exactly 1 method with this annotation. Found none.").@in(function).onLine(31);
            unsuccessfulCompilationClause.withErrorContaining("@UserAggregationResult usage error: expected aggregation type " + "<org.neo4j.tooling.procedure.procedures.invalid.aggregation.FunctionWithoutAggregationMethods.MyAggregation> " + "to define exactly 1 method with this annotation. Found none.").@in(function).onLine(31);
        }
Пример #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void fails_if_context_injected_fields_have_wrong_modifiers()
        public virtual void FailsIfContextInjectedFieldsHaveWrongModifiers()
        {
            JavaFileObject sproc = JavaFileObjectUtils.INSTANCE.procedureSource("invalid/bad_context_field/BadContextFields.java");

            CompileTester.UnsuccessfulCompilationClause unsuccessfulCompilationClause = assert_().about(javaSource()).that(sproc).processedWith(Processor()).failsToCompile().withErrorCount(4);

            unsuccessfulCompilationClause.withErrorContaining("@org.neo4j.procedure.Context usage error: field BadContextFields#shouldBeNonStatic should be public, " + "non-static and non-final").@in(sproc).onLine(35);

            unsuccessfulCompilationClause.withErrorContaining("@org.neo4j.procedure.Context usage error: field BadContextFields#shouldBeNonFinal should be public, " + "non-static and non-final").@in(sproc).onLine(38);

            unsuccessfulCompilationClause.withErrorContaining("@org.neo4j.procedure.Context usage error: field BadContextFields#shouldBePublic should be public, " + "non-static and non-final").@in(sproc).onLine(42);

            unsuccessfulCompilationClause.withErrorContaining("Field BadContextFields#shouldBeStatic should be static").@in(sproc).onLine(43);
        }