no jira - fix intermittent test failure due to incorrect assertion

This commit is contained in:
gtully 2019-11-14 10:10:36 +00:00
parent 1846df4863
commit f7e212ca0b
1 changed files with 4 additions and 5 deletions

View File

@ -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();