Search in sources :

Example 26 with CallableProcedure

use of org.neo4j.kernel.api.proc.CallableProcedure in project neo4j by neo4j.

the class ProcedureJarLoaderTest method shouldLoadProcedureFromJarWithMultipleProcedureClasses.

@Test
public void shouldLoadProcedureFromJarWithMultipleProcedureClasses() throws Throwable {
    // Given
    URL jar = createJarFor(ClassWithOneProcedure.class, ClassWithAnotherProcedure.class, ClassWithNoProcedureAtAll.class);
    // When
    List<CallableProcedure> procedures = jarloader.loadProcedures(jar).procedures();
    // Then
    List<ProcedureSignature> signatures = procedures.stream().map(CallableProcedure::signature).collect(toList());
    assertThat(signatures, containsInAnyOrder(procedureSignature("org", "neo4j", "kernel", "impl", "proc", "myOtherProcedure").out("someNumber", NTInteger).build(), procedureSignature("org", "neo4j", "kernel", "impl", "proc", "myProcedure").out("someNumber", NTInteger).build()));
}
Also used : ProcedureSignature(org.neo4j.kernel.api.proc.ProcedureSignature) CallableProcedure(org.neo4j.kernel.api.proc.CallableProcedure) URL(java.net.URL) Test(org.junit.Test)

Aggregations

CallableProcedure (org.neo4j.kernel.api.proc.CallableProcedure)26 Test (org.junit.Test)22 BasicContext (org.neo4j.kernel.api.proc.BasicContext)15 ProcedureException (org.neo4j.kernel.api.exceptions.ProcedureException)10 ProcedureSignature (org.neo4j.kernel.api.proc.ProcedureSignature)7 Log (org.neo4j.logging.Log)7 NullLog (org.neo4j.logging.NullLog)6 URL (java.net.URL)4 CallableUserFunction (org.neo4j.kernel.api.proc.CallableUserFunction)3 MethodHandle (java.lang.invoke.MethodHandle)2 ComponentInjectionException (org.neo4j.kernel.api.exceptions.ComponentInjectionException)2 CallableUserAggregationFunction (org.neo4j.kernel.api.proc.CallableUserAggregationFunction)2 FailedLoadProcedure (org.neo4j.kernel.api.proc.FailedLoadProcedure)2 FieldSignature (org.neo4j.kernel.api.proc.FieldSignature)2 QualifiedName (org.neo4j.kernel.api.proc.QualifiedName)2 UserFunctionSignature (org.neo4j.kernel.api.proc.UserFunctionSignature)2 OutputMapper (org.neo4j.kernel.impl.proc.OutputMappers.OutputMapper)2 Mode (org.neo4j.procedure.Mode)2 Procedure (org.neo4j.procedure.Procedure)2 MethodHandles (java.lang.invoke.MethodHandles)1