This is an automated email from the ASF dual-hosted git repository.

gtully pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq.git


The following commit(s) were added to refs/heads/master by this push:
     new f7e212c  no jira - fix intermittent test failure due to incorrect 
assertion
f7e212c is described below

commit f7e212ca0bcde408b4befede4a329cc86b5e6302
Author: gtully <[email protected]>
AuthorDate: Thu Nov 14 10:10:36 2019 +0000

    no jira - fix intermittent test failure due to incorrect assertion
---
 .../org/apache/activemq/ActiveMQXAConnectionTxInterruptTest.java | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git 
a/activemq-unit-tests/src/test/java/org/apache/activemq/ActiveMQXAConnectionTxInterruptTest.java
 
b/activemq-unit-tests/src/test/java/org/apache/activemq/ActiveMQXAConnectionTxInterruptTest.java
index a297121..974d457 100644
--- 
a/activemq-unit-tests/src/test/java/org/apache/activemq/ActiveMQXAConnectionTxInterruptTest.java
+++ 
b/activemq-unit-tests/src/test/java/org/apache/activemq/ActiveMQXAConnectionTxInterruptTest.java
@@ -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();
 

Reply via email to