示例#1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(expected = org.neo4j.server.rest.transactional.error.InvalidTransactionId.class) public void gettingInterruptHandlerForUnknownIdShouldThrowErrorInvalidTransactionId() throws org.neo4j.server.rest.transactional.error.TransactionLifecycleException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void GettingInterruptHandlerForUnknownIdShouldThrowErrorInvalidTransactionId()
        {
            // Given
            AssertableLogProvider logProvider = new AssertableLogProvider();
            FakeClock             clock       = Clocks.fakeClock();
            int timeoutLength = 123;

            TransactionHandleRegistry registry = new TransactionHandleRegistry(clock, timeoutLength, logProvider);

            // When
            registry.Terminate(456);
        }
示例#2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldProvideInterruptHandlerForActiveTransaction() throws org.neo4j.server.rest.transactional.error.TransactionLifecycleException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldProvideInterruptHandlerForActiveTransaction()
        {
            // Given
            AssertableLogProvider logProvider = new AssertableLogProvider();
            FakeClock             clock       = Clocks.fakeClock();
            int timeoutLength = 123;

            TransactionHandleRegistry registry = new TransactionHandleRegistry(clock, timeoutLength, logProvider);
            TransactionHandle         handle   = mock(typeof(TransactionHandle));

            // Active Tx in Registry
            long id = registry.Begin(handle);

            // When
            registry.Terminate(id);

            // Then
            verify(handle, times(1)).terminate();
            verifyNoMoreInteractions(handle);
        }