mirror of https://github.com/apache/activemq.git
no jira - fix intermittent test failure due to incorrect assertion
This commit is contained in:
parent
1846df4863
commit
f7e212ca0b
|
@ -182,18 +182,17 @@ public class ActiveMQXAConnectionTxInterruptTest {
|
|||
|
||||
try {
|
||||
resource.end(tid, XAResource.TMSUCCESS);
|
||||
fail("Expect end to fail");
|
||||
} catch (Throwable expectedWithInterrupt) {
|
||||
assertTrue(expectedWithInterrupt instanceof XAException);
|
||||
assertCause(expectedWithInterrupt, new Class[]{InterruptedException.class});
|
||||
}
|
||||
|
||||
assertTrue("Was interrupted during ack!", Thread.currentThread().isInterrupted());
|
||||
try {
|
||||
resource.rollback(tid);
|
||||
fail("Expect rollback to fail due to connection being closed");
|
||||
} catch (Throwable expectedWithInterrupt) {
|
||||
assertTrue(expectedWithInterrupt instanceof XAException);
|
||||
assertCause(expectedWithInterrupt, new Class[]{ConnectionClosedException.class, InterruptedException.class});
|
||||
} catch (Throwable expectedWithInterruptIfClosed) {
|
||||
assertTrue(expectedWithInterruptIfClosed.toString(), expectedWithInterruptIfClosed instanceof XAException);
|
||||
assertCause(expectedWithInterruptIfClosed, new Class[]{ConnectionClosedException.class, InterruptedException.class});
|
||||
}
|
||||
session.close();
|
||||
|
||||
|
|
Loading…
Reference in New Issue