You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ta...@apache.org on 2018/07/18 19:14:18 UTC

qpid-jms git commit: NO-JIRA Ensure connection not dropped until listener is set

Repository: qpid-jms
Updated Branches:
  refs/heads/master 965f989d3 -> b103810ba


NO-JIRA Ensure connection not dropped until listener is set

Make the consumer a zero prefetch consumer so that the flow isn't
emitted until the message listener is set so the connection isn't
dropped until the test is in the correct state to manage the outcome.

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

Branch: refs/heads/master
Commit: b103810babeed2cce9723d4dde5523ec7d446e9d
Parents: 965f989
Author: Timothy Bish <ta...@gmail.com>
Authored: Wed Jul 18 15:14:10 2018 -0400
Committer: Timothy Bish <ta...@gmail.com>
Committed: Wed Jul 18 15:14:10 2018 -0400

----------------------------------------------------------------------
 .../failover/FailoverIntegrationTest.java       | 35 ++++++++++----------
 1 file changed, 18 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/b103810b/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 7297e81..c38ba8d 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
@@ -1174,24 +1174,24 @@ public class FailoverIntegrationTest extends QpidJmsTestCase {
             originalPeer.dropAfterLastHandler();
 
             Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-            
+
             final CountDownLatch sessionCloseCompleted = new CountDownLatch(1);
             final AtomicBoolean sessionClosedThrew = new AtomicBoolean();
             Thread sessionCloseThread = new Thread(new Runnable() {
-				
-				@Override
-				public void run() {
-		            try {
-		            	session.close();
-		            	LOG.debug("Close of session returned ok");
-		            } catch (JMSException jmsEx) {
-		            	LOG.warn("Should not throw on session close when connection drops.", jmsEx);
-		            	sessionClosedThrew.set(true);
-		            } finally {
-		            	sessionCloseCompleted.countDown();
-		            }
-				}
-			}, "Session close thread");
+
+                @Override
+                public void run() {
+                    try {
+                        session.close();
+                        LOG.debug("Close of session returned ok");
+                    } catch (JMSException jmsEx) {
+                        LOG.warn("Should not throw on session close when connection drops.", jmsEx);
+                        sessionClosedThrew.set(true);
+                    } finally {
+                        sessionCloseCompleted.countDown();
+                    }
+                }
+            }, "Session close thread");
 
             sessionCloseThread.start();
 
@@ -1199,7 +1199,7 @@ public class FailoverIntegrationTest extends QpidJmsTestCase {
 
             assertTrue("Session close should have completed by now", sessionCloseCompleted.await(3, TimeUnit.SECONDS));
             assertFalse("Session close should have completed normally", sessionClosedThrew.get());
-            
+
             connection.close();
         }
     }
@@ -2637,7 +2637,8 @@ public class FailoverIntegrationTest extends QpidJmsTestCase {
             finalPeer.expectReceiverAttach(notNullValue(), notNullValue(), false, true, false, false, errorCondition, errorDescription);
             finalPeer.expectDetach(true, false, false);
 
-            final JmsConnection connection = establishAnonymousConnecton("jms.closeLinksThatFailOnReconnect=true", originalPeer, finalPeer);
+            final JmsConnection connection = establishAnonymousConnecton(
+                "jms.prefetchPolicy.all=0&jms.closeLinksThatFailOnReconnect=true", originalPeer, finalPeer);
             connection.setExceptionListener(new ExceptionListener() {
                 @Override
                 public void onException(JMSException exception) {


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