//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void shouldCloseResultHandlesWhenConsumeFailsInExplicitTransaction() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: internal virtual void ShouldCloseResultHandlesWhenConsumeFailsInExplicitTransaction() { KernelTransaction transaction = NewTransaction(); TransactionStateMachineV1SPI stateMachineSPI = NewTransactionStateMachineSPI(transaction); TransactionStateMachine stateMachine = NewTransactionStateMachine(stateMachineSPI); stateMachine.BeginTransaction(null); stateMachine.StreamResult(boltResult => { }); stateMachine.Run("SOME STATEMENT", null); assertNotNull(stateMachine.Ctx.currentResultHandle); assertNotNull(stateMachine.Ctx.currentResult); Exception e = assertThrows(typeof(Exception), () => { stateMachine.StreamResult(boltResult => { throw new Exception("some error"); }); }); assertEquals("some error", e.Message); assertNull(stateMachine.Ctx.currentResultHandle); assertNull(stateMachine.Ctx.currentResult); assertNotNull(stateMachine.Ctx.currentTransaction); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void shouldUnbindTxAfterStreamResult() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: internal virtual void ShouldUnbindTxAfterStreamResult() { KernelTransaction transaction = NewTimedOutTransaction(); TransactionStateMachineV1SPI stateMachineSPI = NewTransactionStateMachineSPI(transaction); TransactionStateMachine stateMachine = NewTransactionStateMachine(stateMachineSPI); stateMachine.Run("SOME STATEMENT", null); stateMachine.StreamResult(boltResult => { }); verify(stateMachineSPI, times(2)).unbindTransactionFromCurrentThread(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void shouldThrowDuringStreamResultIfPendingTerminationNoticeExists() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: internal virtual void ShouldThrowDuringStreamResultIfPendingTerminationNoticeExists() { KernelTransaction transaction = NewTimedOutTransaction(); TransactionStateMachineV1SPI stateMachineSPI = NewTransactionStateMachineSPI(transaction); TransactionStateMachine stateMachine = NewTransactionStateMachine(stateMachineSPI); stateMachine.Run("SOME STATEMENT", null); stateMachine.Ctx.pendingTerminationNotice = Org.Neo4j.Kernel.Api.Exceptions.Status_Transaction.TransactionTimedOut; TransactionTerminatedException e = assertThrows(typeof(TransactionTerminatedException), () => { stateMachine.StreamResult(boltResult => { }); }); assertEquals(Org.Neo4j.Kernel.Api.Exceptions.Status_Transaction.TransactionTimedOut, e.Status()); }