throw new DeadlockDetectedException( waitingTx + " can't wait on resource " + resource + " since => " + circle );
@Test @SuppressWarnings( "unchecked" ) public void deadlockExceptionHasCorrectStatus() throws Exception { // given QueryExecutionEngine executionEngine = mock( QueryExecutionEngine.class ); when( executionEngine.executeQuery( anyString(), any( MapValue.class ), isNull() ) ) .thenThrow( new DeadlockDetectedException( "deadlock" ) ); GraphDatabaseQueryService queryService = mock( GraphDatabaseQueryService.class ); TransactionHandle handle = new TransactionHandle( mockKernel(), executionEngine, queryService, mock( TransactionRegistry.class ), uriScheme, true, AUTH_DISABLED, anyLong(), NullLogProvider.getInstance() ); ExecutionResultSerializer output = mock( ExecutionResultSerializer.class ); // when handle.execute( statements( new Statement( "query", map(), false, (ResultDataContent[]) null ) ), output, mock( HttpServletRequest.class ) ); // then verify( output ).errors( argThat( hasErrors( Status.Transaction.DeadlockDetected ) ) ); }
@Test public void shouldConvertDeadlockException() { // When Neo4jError error = Neo4jError.from( new DeadlockDetectedException( null ) ); // Then assertEquals( Status.Transaction.DeadlockDetected, error.status() ); }
throw new DeadlockDetectedException( "Deadlock" ); } ).when( ragManager ).checkWaitOn( lock, lockTransaction );
throw new DeadlockDetectedException( waitingTx + " can't wait on resource " + resource + " since => " + circle );
throw new DeadlockDetectedException( message );