You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2018/03/22 12:54:06 UTC

qpid-jms git commit: QPIDJMS-366, QPIDJMS-369: fix final peer shutdown and non-use verification

Repository: qpid-jms
Updated Branches:
  refs/heads/master b37200f45 -> 7da7a3d0e


QPIDJMS-366, QPIDJMS-369: fix final peer shutdown and non-use verification


Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/7da7a3d0
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/7da7a3d0
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/7da7a3d0

Branch: refs/heads/master
Commit: 7da7a3d0ec81f5a32a9976315273900db0425146
Parents: b37200f
Author: Robbie Gemmell <ro...@apache.org>
Authored: Thu Mar 22 12:45:57 2018 +0000
Committer: Robbie Gemmell <ro...@apache.org>
Committed: Thu Mar 22 12:45:57 2018 +0000

----------------------------------------------------------------------
 .../failover/FailoverIntegrationTest.java       | 24 ++++++++++++--------
 1 file changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/7da7a3d0/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/failover/FailoverIntegrationTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/failover/FailoverIntegrationTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/failover/FailoverIntegrationTest.java
index 2f8776b..7f9cec5 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/failover/FailoverIntegrationTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/failover/FailoverIntegrationTest.java
@@ -1770,11 +1770,13 @@ public class FailoverIntegrationTest extends QpidJmsTestCase {
             secondPeer.waitForAllHandlersToCompleteNoAssert(2000);
             thirdPeer.waitForAllHandlersToCompleteNoAssert(2000);
 
-            try {
-                fourthPeer.purgeExpectations();
-                fourthPeer.close();
-                fail("Should have not executed any handlers.");
-            } catch (Throwable t) {}
+            // Shut down last peer and verify no connection made to it
+            fourthPeer.purgeExpectations();
+            fourthPeer.close();
+            assertNotNull("Peer 1 should have accepted a TCP connection", firstPeer.getClientSocket());
+            assertNotNull("Peer 2 should have accepted a TCP connection", secondPeer.getClientSocket());
+            assertNotNull("Peer 3 should have accepted a TCP connection", thirdPeer.getClientSocket());
+            assertNull("Peer 4 should not have accepted any TCP connection", fourthPeer.getClientSocket());
         }
     }
 
@@ -1832,11 +1834,13 @@ public class FailoverIntegrationTest extends QpidJmsTestCase {
             secondPeer.waitForAllHandlersToCompleteNoAssert(2000);
             thirdPeer.waitForAllHandlersToCompleteNoAssert(2000);
 
-            try {
-                fourthPeer.purgeExpectations();
-                fourthPeer.close();
-                fail("Should have not executed any handlers.");
-            } catch (Throwable t) {}
+            // Shut down last peer and verify no connection made to it
+            fourthPeer.purgeExpectations();
+            fourthPeer.close();
+            assertNotNull("Peer 1 should have accepted a TCP connection", firstPeer.getClientSocket());
+            assertNotNull("Peer 2 should have accepted a TCP connection", secondPeer.getClientSocket());
+            assertNotNull("Peer 3 should have accepted a TCP connection", thirdPeer.getClientSocket());
+            assertNull("Peer 4 should not have accepted any TCP connection", fourthPeer.getClientSocket());
         }
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org