Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void startDefaultTransaction()
        public virtual void StartDefaultTransaction()
        {
            CypherExecutor cypherExecutor = new CypherExecutor(_database, _logProvider);

            cypherExecutor.Start();

            cypherExecutor.CreateTransactionContext(QUERY, VirtualValues.emptyMap(), _request);

            verify(_databaseQueryService).beginTransaction(KernelTransaction.Type.@implicit, AUTH_DISABLED);
            _logProvider.assertNoLoggingOccurred();
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void startTransactionWithCustomTimeout()
        public virtual void StartTransactionWithCustomTimeout()
        {
            when(_request.getHeader(HttpHeaderUtils.MAX_EXECUTION_TIME_HEADER)).thenReturn(CUSTOM_TRANSACTION_TIMEOUT.ToString());

            CypherExecutor cypherExecutor = new CypherExecutor(_database, _logProvider);

            cypherExecutor.Start();

            cypherExecutor.CreateTransactionContext(QUERY, VirtualValues.emptyMap(), _request);

            verify(_databaseQueryService).beginTransaction(KernelTransaction.Type.@implicit, AUTH_DISABLED, CUSTOM_TRANSACTION_TIMEOUT, TimeUnit.MILLISECONDS);
            _logProvider.assertNoLoggingOccurred();
        }
Ejemplo n.º 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void startDefaultTransactionIfTimeoutIsNegative()
        public virtual void StartDefaultTransactionIfTimeoutIsNegative()
        {
            when(_request.getHeader(HttpHeaderUtils.MAX_EXECUTION_TIME_HEADER)).thenReturn("-2");

            CypherExecutor cypherExecutor = new CypherExecutor(_database, _logProvider);

            cypherExecutor.Start();

            cypherExecutor.CreateTransactionContext(QUERY, VirtualValues.emptyMap(), _request);

            verify(_databaseQueryService).beginTransaction(KernelTransaction.Type.@implicit, AUTH_DISABLED);
            _logProvider.assertNoLoggingOccurred();
        }
Ejemplo n.º 4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void startDefaultTransactionWhenHeaderHasIncorrectValue()
        public virtual void StartDefaultTransactionWhenHeaderHasIncorrectValue()
        {
            when(_request.getHeader(HttpHeaderUtils.MAX_EXECUTION_TIME_HEADER)).thenReturn("not a number");

            CypherExecutor cypherExecutor = new CypherExecutor(_database, _logProvider);

            cypherExecutor.Start();

            cypherExecutor.CreateTransactionContext(QUERY, VirtualValues.emptyMap(), _request);

            verify(_databaseQueryService).beginTransaction(KernelTransaction.Type.@implicit, AUTH_DISABLED);
            _logProvider.rawMessageMatcher().assertContains("Fail to parse `max-execution-time` header with value: 'not a number'. Should be a positive number.");
        }