예제 #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private java.util.List<Object[]> call(String name, Object... args) throws org.neo4j.internal.kernel.api.exceptions.ProcedureException, org.neo4j.internal.kernel.api.exceptions.schema.IndexNotFoundKernelException
        private IList <object[]> Call(string name, params object[] args)
        {
            BasicContext ctx = new BasicContext();

            ctx.Put(KERNEL_TRANSACTION, _tx);
            ctx.Put(_dependencyResolver, _resolver);
            ctx.Put(_graphdatabaseapi, _graphDatabaseAPI);
            ctx.Put(SECURITY_CONTEXT, SecurityContext.AUTH_DISABLED);
            ctx.Put(_log, _log);
            when(_graphDatabaseAPI.DependencyResolver).thenReturn(_resolver);
            when(_resolver.resolveDependency(typeof(Procedures))).thenReturn(_procs);
            when(_resolver.resolveDependency(typeof(IndexingService))).thenReturn(_indexingService);
            when(_schemaReadCore.indexGetPopulationProgress(any(typeof(IndexReference)))).thenReturn(Org.Neo4j.Storageengine.Api.schema.PopulationProgress_Fields.Done);
            return(Iterators.asList(_procs.callProcedure(ctx, ProcedureSignature.procedureName(name.Split("\\.", true)), args, _resourceTracker)));
        }
예제 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldMakeContextAvailable() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldMakeContextAvailable()
        {
            // Given
            Key <string> someKey = key("someKey", typeof(string));

            _procs.register(new CallableUserFunction_BasicUserFunctionAnonymousInnerClass(this, _signature, someKey));

            BasicContext ctx = new BasicContext();

            ctx.Put(someKey, "hello, world");

            // When
            object result = _procs.callFunction(ctx, _signature.name(), new AnyValue[0]);

            // Then
            assertThat(result, equalTo(Values.of("hello, world")));
        }
예제 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldMakeContextAvailable() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldMakeContextAvailable()
        {
            // Given
            Key <string> someKey = key("someKey", typeof(string));

            _procs.register(new CallableProcedure_BasicProcedureAnonymousInnerClass(this, _signature, someKey));

            BasicContext ctx = new BasicContext();

            ctx.Put(someKey, "hello, world");

            // When
            RawIterator <object[], ProcedureException> result = _procs.callProcedure(ctx, _signature.name(), new object[0], _resourceTracker);

            // Then
            assertThat(asList(result), contains(equalTo(new object[] { "hello, world" })));
        }