QPIDJMS-326: have the connection desire the DELAYED_DELIVERY capability

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

Branch: refs/heads/master
Commit: 2f3c13c4f011dcbfe6f2a86b7853758582707b71
Parents: f4fcfab
Author: Robbie Gemmell <[email protected]>
Authored: Fri Sep 29 12:19:00 2017 +0100
Committer: Robbie Gemmell <[email protected]>
Committed: Fri Sep 29 12:21:39 2017 +0100

----------------------------------------------------------------------
 .../amqp/builders/AmqpConnectionBuilder.java        |  3 ++-
 .../jms/integration/IntegrationTestFixture.java     |  9 ++-------
 .../integration/SubscriptionsIntegrationTest.java   |  2 +-
 .../apache/qpid/jms/test/testpeer/TestAmqpPeer.java | 16 ++++++++++------
 4 files changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/2f3c13c4/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/builders/AmqpConnectionBuilder.java
----------------------------------------------------------------------
diff --git 
a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/builders/AmqpConnectionBuilder.java
 
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/builders/AmqpConnectionBuilder.java
index 98cabfc..6ff7a6d 100644
--- 
a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/builders/AmqpConnectionBuilder.java
+++ 
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/builders/AmqpConnectionBuilder.java
@@ -17,6 +17,7 @@
 package org.apache.qpid.jms.provider.amqp.builders;
 
 import static 
org.apache.qpid.jms.provider.amqp.AmqpSupport.SOLE_CONNECTION_CAPABILITY;
+import static org.apache.qpid.jms.provider.amqp.AmqpSupport.DELAYED_DELIVERY;
 
 import java.net.URI;
 import java.util.ArrayList;
@@ -116,7 +117,7 @@ public class AmqpConnectionBuilder extends 
AmqpResourceBuilder<AmqpConnection, A
         Connection connection = getParent().getProtonConnection();
         connection.setHostname(hostname);
         connection.setContainer(resourceInfo.getClientId());
-        connection.setDesiredCapabilities(new Symbol[] { 
SOLE_CONNECTION_CAPABILITY });
+        connection.setDesiredCapabilities(new Symbol[] { 
SOLE_CONNECTION_CAPABILITY, DELAYED_DELIVERY });
         connection.setProperties(props);
 
         return connection;

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/2f3c13c4/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/IntegrationTestFixture.java
----------------------------------------------------------------------
diff --git 
a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/IntegrationTestFixture.java
 
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/IntegrationTestFixture.java
index acb386f..03cdf6e 100644
--- 
a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/IntegrationTestFixture.java
+++ 
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/IntegrationTestFixture.java
@@ -28,7 +28,6 @@ import javax.jms.JMSContext;
 import javax.jms.JMSException;
 
 import org.apache.qpid.jms.JmsConnectionFactory;
-import org.apache.qpid.jms.provider.amqp.AmqpSupport;
 import org.apache.qpid.jms.test.testpeer.TestAmqpPeer;
 import org.apache.qpid.proton.amqp.Symbol;
 
@@ -59,10 +58,8 @@ public class IntegrationTestFixture {
     }
 
     Connection establishConnecton(TestAmqpPeer testPeer, boolean ssl, String 
optionsString, Symbol[] serverCapabilities, Map<Symbol, Object> 
serverProperties, boolean setClientId) throws JMSException {
-        Symbol[] desiredCapabilities = new Symbol[] { 
AmqpSupport.SOLE_CONNECTION_CAPABILITY };
-
         testPeer.expectSaslPlain("guest", "guest");
-        testPeer.expectOpen(desiredCapabilities, serverCapabilities, 
serverProperties);
+        testPeer.expectOpen(serverProperties, serverCapabilities);
 
         // Each connection creates a session for managing temporary 
destinations etc
         testPeer.expectBegin();
@@ -111,10 +108,8 @@ public class IntegrationTestFixture {
     }
 
     JMSContext createJMSContext(TestAmqpPeer testPeer, boolean ssl, String 
optionsString, Symbol[] serverCapabilities, Map<Symbol, Object> 
serverProperties, boolean setClientId, int sessionMode) throws JMSException {
-        Symbol[] desiredCapabilities = new Symbol[] { 
AmqpSupport.SOLE_CONNECTION_CAPABILITY };
-
         testPeer.expectSaslPlain("guest", "guest");
-        testPeer.expectOpen(desiredCapabilities, serverCapabilities, 
serverProperties);
+        testPeer.expectOpen(serverProperties, serverCapabilities);
 
         // Each connection creates a session for managing temporary 
destinations etc
         testPeer.expectBegin();

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/2f3c13c4/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SubscriptionsIntegrationTest.java
----------------------------------------------------------------------
diff --git 
a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SubscriptionsIntegrationTest.java
 
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SubscriptionsIntegrationTest.java
index e9739ed..5bd59e9 100644
--- 
a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SubscriptionsIntegrationTest.java
+++ 
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SubscriptionsIntegrationTest.java
@@ -1604,7 +1604,7 @@ public class SubscriptionsIntegrationTest extends 
QpidJmsTestCase {
             Symbol[] serverCapabilities = new Symbol[]{SHARED_SUBS};
 
             testPeer.expectSaslAnonymous();
-            testPeer.expectOpen(new Symbol[] { 
AmqpSupport.SOLE_CONNECTION_CAPABILITY }, serverCapabilities, null);
+            testPeer.expectOpen(null, serverCapabilities);
             testPeer.expectBegin();
 
             ConnectionFactory factory = new 
JmsConnectionFactory("amqp://localhost:" + serverPort + 
"?jms.awaitClientID=false");

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/2f3c13c4/qpid-jms-client/src/test/java/org/apache/qpid/jms/test/testpeer/TestAmqpPeer.java
----------------------------------------------------------------------
diff --git 
a/qpid-jms-client/src/test/java/org/apache/qpid/jms/test/testpeer/TestAmqpPeer.java
 
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/test/testpeer/TestAmqpPeer.java
index fcb9421..5081667 100644
--- 
a/qpid-jms-client/src/test/java/org/apache/qpid/jms/test/testpeer/TestAmqpPeer.java
+++ 
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/test/testpeer/TestAmqpPeer.java
@@ -18,9 +18,12 @@
  */
 package org.apache.qpid.jms.test.testpeer;
 
+import static org.apache.qpid.jms.provider.amqp.AmqpSupport.DELAYED_DELIVERY;
 import static 
org.apache.qpid.jms.provider.amqp.AmqpSupport.DYNAMIC_NODE_LIFETIME_POLICY;
 import static org.apache.qpid.jms.provider.amqp.AmqpSupport.GLOBAL;
 import static org.apache.qpid.jms.provider.amqp.AmqpSupport.SHARED;
+import static 
org.apache.qpid.jms.provider.amqp.AmqpSupport.SOLE_CONNECTION_CAPABILITY;
+
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.arrayContaining;
 import static org.hamcrest.Matchers.equalTo;
@@ -139,6 +142,7 @@ public class TestAmqpPeer implements AutoCloseable
     private static final UnsignedByte SASL_FAIL_AUTH = 
UnsignedByte.valueOf((byte)1);
     private static final int CONNECTION_CHANNEL = 0;
     private static final int DEFAULT_PRODUCER_CREDIT = 100;
+    private static final Symbol[] DEFAULT_DESIRED_CAPABILITIES = new Symbol[] 
{ SOLE_CONNECTION_CAPABILITY, DELAYED_DELIVERY};
 
     private volatile AssertionError _firstAssertionError = null;
     private final TestAmqpPeerRunner _driverRunnable;
@@ -809,7 +813,11 @@ public class TestAmqpPeer implements AutoCloseable
     }
 
     public void expectOpen(Map<Symbol, Object> serverProperties) {
-        expectOpen(new Symbol[] { AmqpSupport.SOLE_CONNECTION_CAPABILITY }, 
new Symbol[] { AmqpSupport.SOLE_CONNECTION_CAPABILITY }, null, 
serverProperties, null, null, false);
+        expectOpen(DEFAULT_DESIRED_CAPABILITIES, new Symbol[] { 
AmqpSupport.SOLE_CONNECTION_CAPABILITY }, null, serverProperties, null, null, 
false);
+    }
+
+    public void expectOpen(Map<Symbol, Object> serverProperties, Symbol[] 
serverCapabilities) {
+        expectOpen(DEFAULT_DESIRED_CAPABILITIES, serverCapabilities, null, 
serverProperties, null, null, false);
     }
 
     public void expectOpen(Matcher<?> clientPropertiesMatcher, Matcher<?> 
hostnameMatcher, boolean deferOpened) {
@@ -817,11 +825,7 @@ public class TestAmqpPeer implements AutoCloseable
     }
 
     public void expectOpen(Matcher<?> clientPropertiesMatcher, Matcher<?> 
idleTimeoutMatcher, Matcher<?> hostnameMatcher, boolean deferOpened) {
-        expectOpen(new Symbol[] { AmqpSupport.SOLE_CONNECTION_CAPABILITY }, 
new Symbol[] { AmqpSupport.SOLE_CONNECTION_CAPABILITY }, 
clientPropertiesMatcher, null, null, hostnameMatcher, deferOpened);
-    }
-
-    public void expectOpen(Symbol[] desiredCapabilities, Symbol[] 
serverCapabilities, Map<Symbol, Object> serverProperties) {
-        expectOpen(desiredCapabilities, serverCapabilities, null, 
serverProperties, null, null, false);
+        expectOpen(DEFAULT_DESIRED_CAPABILITIES, new Symbol[] { 
AmqpSupport.SOLE_CONNECTION_CAPABILITY }, clientPropertiesMatcher, null, null, 
hostnameMatcher, deferOpened);
     }
 
     public void sendPreemptiveServerOpenFrame() {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to