qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob...@apache.org
Subject [2/2] qpid-jms git commit: QPIDJMS-56: throw InvalidClientIDException dueing connection failure when hint is present that the container-id field was the problem
Date Thu, 28 May 2015 11:26:20 GMT
QPIDJMS-56: throw InvalidClientIDException dueing connection failure when hint is present that
the container-id field was the problem

Changes by Tim and I.


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

Branch: refs/heads/master
Commit: 7e1325e9afae349b9a474ddcb33c8b7bbc1bbbd6
Parents: 639243b
Author: Robert Gemmell <robbie@apache.org>
Authored: Thu May 28 12:23:20 2015 +0100
Committer: Robert Gemmell <robbie@apache.org>
Committed: Thu May 28 12:24:54 2015 +0100

----------------------------------------------------------------------
 .../jms/provider/amqp/AmqpAbstractResource.java | 18 +++++++++--
 .../qpid/jms/provider/amqp/AmqpConnection.java  |  4 +--
 .../provider/amqp/AmqpConnectionProperties.java | 10 +++---
 .../qpid/jms/provider/amqp/AmqpSupport.java     | 33 ++++++++++++++++++++
 .../integration/ConnectionIntegrationTest.java  | 30 +++++++++++++++++-
 .../FailedConnectionsIntegrationTest.java       |  2 +-
 .../jms/integration/IntegrationTestFixture.java |  4 +--
 .../jms/integration/MessageIntegrationTest.java | 11 ++++---
 .../jms/integration/SessionIntegrationTest.java |  8 ++---
 .../provider/failover/FailoverRedirectTest.java |  4 +--
 .../qpid/jms/test/testpeer/TestAmqpPeer.java    |  9 +++---
 .../org/apache/qpid/jms/JmsConnectionTest.java  |  2 ++
 12 files changed, 105 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/7e1325e9/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpAbstractResource.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpAbstractResource.java
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpAbstractResource.java
index 3a00f34..cc05312 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpAbstractResource.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpAbstractResource.java
@@ -16,9 +16,13 @@
  */
 package org.apache.qpid.jms.provider.amqp;
 
+import static org.apache.qpid.jms.provider.amqp.AmqpSupport.CONTAINER_ID;
+import static org.apache.qpid.jms.provider.amqp.AmqpSupport.INVALID_FIELD;
+
 import java.io.IOException;
 import java.util.Map;
 
+import javax.jms.InvalidClientIDException;
 import javax.jms.InvalidDestinationException;
 import javax.jms.JMSException;
 import javax.jms.JMSSecurityException;
@@ -221,7 +225,8 @@ public abstract class AmqpAbstractResource<R extends JmsResource, E
extends Endp
     @Override
     public Exception getRemoteError() {
         Exception remoteError = null;
-        Symbol error = getEndpoint().getRemoteCondition().getCondition();
+        ErrorCondition remoteCondition = getEndpoint().getRemoteCondition();
+        Symbol error = remoteCondition.getCondition();
         if (error != null) {
             String message = getRemoteErrorMessage();
             if (error.equals(AmqpError.UNAUTHORIZED_ACCESS)) {
@@ -229,7 +234,14 @@ public abstract class AmqpAbstractResource<R extends JmsResource,
E extends Endp
             } else if (error.equals(AmqpError.NOT_FOUND)) {
                 remoteError = new InvalidDestinationException(message);
             } else if (error.equals(ConnectionError.REDIRECT)) {
-                remoteError = createRedirectException(error, message, getEndpoint().getRemoteCondition());
+                remoteError = createRedirectException(error, message, remoteCondition);
+            } else if (error.equals(AmqpError.INVALID_FIELD)) {
+                Map<?, ?> info = remoteCondition.getInfo();
+                if (info != null && CONTAINER_ID.equals(info.get(INVALID_FIELD)))
{
+                    remoteError = new InvalidClientIDException(message);
+                } else {
+                    remoteError = new JMSException(message);
+                }
             } else {
                 remoteError = new JMSException(message);
             }
@@ -335,7 +347,7 @@ public abstract class AmqpAbstractResource<R extends JmsResource, E
extends Endp
     @SuppressWarnings("unchecked")
     protected Exception createRedirectException(Symbol error, String message, ErrorCondition
condition) {
         Exception result = null;
-        Map<String, Object> info = condition.getInfo();
+        Map<Object, Object> info = condition.getInfo();
 
         if (info == null) {
             result = new IOException(message + " : Redirection information not set.");

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/7e1325e9/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnection.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnection.java
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnection.java
index 8967bbd..17c4bd1 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnection.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnection.java
@@ -16,6 +16,8 @@
  */
 package org.apache.qpid.jms.provider.amqp;
 
+import static org.apache.qpid.jms.provider.amqp.AmqpSupport.SOLE_CONNECTION_CAPABILITY;
+
 import java.net.URI;
 import java.util.HashMap;
 import java.util.Map;
@@ -42,8 +44,6 @@ public class AmqpConnection extends AmqpAbstractResource<JmsConnectionInfo,
Conn
 
     private static final Logger LOG = LoggerFactory.getLogger(AmqpConnection.class);
 
-    public static final Symbol SOLE_CONNECTION_CAPABILITY = Symbol.valueOf("sole-connection-for-container");
-
     private final AmqpJmsMessageFactory amqpMessageFactory;
 
     private final URI remoteURI;

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/7e1325e9/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnectionProperties.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnectionProperties.java
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnectionProperties.java
index f6ed263..df7f477 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnectionProperties.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConnectionProperties.java
@@ -16,6 +16,11 @@
  */
 package org.apache.qpid.jms.provider.amqp;
 
+import static org.apache.qpid.jms.provider.amqp.AmqpSupport.ANONYMOUS_RELAY;
+import static org.apache.qpid.jms.provider.amqp.AmqpSupport.CONNECTION_OPEN_FAILED;
+import static org.apache.qpid.jms.provider.amqp.AmqpSupport.QUEUE_PREFIX;
+import static org.apache.qpid.jms.provider.amqp.AmqpSupport.TOPIC_PREFIX;
+
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
@@ -34,11 +39,6 @@ public class AmqpConnectionProperties {
 
     private static final Logger LOG = LoggerFactory.getLogger(AmqpConnectionProperties.class);
 
-    public static final Symbol ANONYMOUS_RELAY = Symbol.valueOf("ANONYMOUS-RELAY");
-    public static final Symbol QUEUE_PREFIX = Symbol.valueOf("queue-prefix");
-    public static final Symbol TOPIC_PREFIX = Symbol.valueOf("topic-prefix");
-    public static final Symbol CONNECTION_OPEN_FAILED = Symbol.valueOf("amqp:connection-establishment-failed");
-
     private final JmsConnectionInfo connectionInfo;
 
     private boolean anonymousRelaySupported = false;

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/7e1325e9/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpSupport.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpSupport.java
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpSupport.java
new file mode 100644
index 0000000..33b2c58
--- /dev/null
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpSupport.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.qpid.jms.provider.amqp;
+
+import org.apache.qpid.proton.amqp.Symbol;
+
+public class AmqpSupport {
+    // Symbols used for connection capabilities
+    public static final Symbol SOLE_CONNECTION_CAPABILITY = Symbol.valueOf("sole-connection-for-container");
+    public static final Symbol ANONYMOUS_RELAY = Symbol.valueOf("ANONYMOUS-RELAY");
+
+    // Symbols used to announce connection error information
+    public static final Symbol CONNECTION_OPEN_FAILED = Symbol.valueOf("amqp:connection-establishment-failed");
+    public static final Symbol INVALID_FIELD = Symbol.valueOf("invalid-field");
+    public static final Symbol CONTAINER_ID = Symbol.valueOf("container-id");
+
+    public static final Symbol QUEUE_PREFIX = Symbol.valueOf("queue-prefix");
+    public static final Symbol TOPIC_PREFIX = Symbol.valueOf("topic-prefix");
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/7e1325e9/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConnectionIntegrationTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConnectionIntegrationTest.java
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConnectionIntegrationTest.java
index 6027034..1ea529a 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConnectionIntegrationTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/ConnectionIntegrationTest.java
@@ -33,16 +33,20 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicReference;
 
 import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
 import javax.jms.ConnectionMetaData;
 import javax.jms.ExceptionListener;
 import javax.jms.IllegalStateException;
+import javax.jms.InvalidClientIDException;
 import javax.jms.JMSException;
 import javax.jms.MessageConsumer;
 import javax.jms.Queue;
 import javax.jms.Session;
 
 import org.apache.qpid.jms.JmsConnection;
+import org.apache.qpid.jms.JmsConnectionFactory;
 import org.apache.qpid.jms.provider.ProviderRedirectedException;
+import org.apache.qpid.jms.provider.amqp.AmqpSupport;
 import org.apache.qpid.jms.test.QpidJmsTestCase;
 import org.apache.qpid.jms.test.Wait;
 import org.apache.qpid.jms.test.testpeer.TestAmqpPeer;
@@ -142,6 +146,30 @@ public class ConnectionIntegrationTest extends QpidJmsTestCase {
         }
     }
 
+    @Test(timeout = 5000)
+    public void testConnectionThrowsInvalidClientIdExceptionWhenInvalidContainerHintPresent()
throws Exception {
+        try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
+            final String remoteURI = "amqp://localhost:" + testPeer.getServerPort();
+
+            Map<Object, Object> errorInfo = new HashMap<Object, Object>();
+            errorInfo.put(AmqpSupport.INVALID_FIELD, AmqpSupport.CONTAINER_ID);
+
+            testPeer.rejectConnect(AmqpError.INVALID_FIELD, "Client ID already in use", errorInfo);
+
+            try {
+                ConnectionFactory factory = new JmsConnectionFactory(remoteURI);
+                Connection connection = factory.createConnection();
+                connection.setClientID("in-use-client-id");
+
+                fail("Should have thrown InvalidClientIDException");
+            } catch (InvalidClientIDException e) {
+                // Expected
+            }
+
+            testPeer.waitForAllHandlersToComplete(1000);
+        }
+    }
+
     @Test(timeout = 10000)
     public void testRemotelyEndConnectionWithRedirect() throws Exception {
         try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
@@ -156,7 +184,7 @@ public class ConnectionIntegrationTest extends QpidJmsTestCase {
             Connection connection = testFixture.establishConnecton(testPeer, false, null,
null, null, false);
 
             // Tell the test peer to close the connection when executing its last handler
-            Map<String, Object> errorInfo = new HashMap<String, Object>();
+            Map<Object, Object> errorInfo = new HashMap<Object, Object>();
             errorInfo.put("hostname", REDIRECTED_HOSTNAME);
             errorInfo.put("network-host", REDIRECTED_NETWORK_HOST);
             errorInfo.put("port", 5677);

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/7e1325e9/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/FailedConnectionsIntegrationTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/FailedConnectionsIntegrationTest.java
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/FailedConnectionsIntegrationTest.java
index 7660632..f0208ea 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/FailedConnectionsIntegrationTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/FailedConnectionsIntegrationTest.java
@@ -76,7 +76,7 @@ public class FailedConnectionsIntegrationTest extends QpidJmsTestCase {
 
     @Test(timeout = 5000)
     public void testConnectWithRedirect() throws Exception {
-        Map<String, Object> redirectInfo = new HashMap<String, Object>();
+        Map<Object, Object> redirectInfo = new HashMap<Object, Object>();
 
         redirectInfo.put("hostname", "localhost");
         redirectInfo.put("network-host", "127.0.0.1");

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/7e1325e9/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 94574d7..1791cd8 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
@@ -27,7 +27,7 @@ import javax.jms.ConnectionFactory;
 import javax.jms.JMSException;
 
 import org.apache.qpid.jms.JmsConnectionFactory;
-import org.apache.qpid.jms.provider.amqp.AmqpConnection;
+import org.apache.qpid.jms.provider.amqp.AmqpSupport;
 import org.apache.qpid.jms.test.testpeer.TestAmqpPeer;
 import org.apache.qpid.proton.amqp.Symbol;
 
@@ -54,7 +54,7 @@ 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[] { AmqpConnection.SOLE_CONNECTION_CAPABILITY
};
+        Symbol[] desiredCapabilities = new Symbol[] { AmqpSupport.SOLE_CONNECTION_CAPABILITY
};
 
         testPeer.expectPlainConnect("guest", "guest", desiredCapabilities, serverCapabilities,
serverProperties);
 

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/7e1325e9/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MessageIntegrationTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MessageIntegrationTest.java
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MessageIntegrationTest.java
index 9449d4e..2ab5857 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MessageIntegrationTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MessageIntegrationTest.java
@@ -18,6 +18,8 @@
  */
 package org.apache.qpid.jms.integration;
 
+import static org.apache.qpid.jms.provider.amqp.AmqpSupport.QUEUE_PREFIX;
+import static org.apache.qpid.jms.provider.amqp.AmqpSupport.TOPIC_PREFIX;
 import static org.hamcrest.Matchers.equalTo;
 import static org.hamcrest.Matchers.notNullValue;
 import static org.hamcrest.Matchers.nullValue;
@@ -47,7 +49,6 @@ import javax.jms.Topic;
 
 import org.apache.qpid.jms.JmsClientProperties;
 import org.apache.qpid.jms.JmsConnection;
-import org.apache.qpid.jms.provider.amqp.AmqpConnectionProperties;
 import org.apache.qpid.jms.provider.amqp.message.AmqpDestinationHelper;
 import org.apache.qpid.jms.provider.amqp.message.AmqpMessageIdHelper;
 import org.apache.qpid.jms.provider.amqp.message.AmqpMessageSupport;
@@ -748,8 +749,8 @@ public class MessageIntegrationTest extends QpidJmsTestCase
         try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
             // Have the test peer provide the destination prefixes as connection properties
             Map<Symbol, Object> properties = new HashMap<Symbol, Object>();
-            properties.put(AmqpConnectionProperties.QUEUE_PREFIX, destPrefix);
-            properties.put(AmqpConnectionProperties.TOPIC_PREFIX, destPrefix);
+            properties.put(QUEUE_PREFIX, destPrefix);
+            properties.put(TOPIC_PREFIX, destPrefix);
 
             Connection connection = testFixture.establishConnecton(testPeer, null, null,
properties);
             connection.start();
@@ -858,8 +859,8 @@ public class MessageIntegrationTest extends QpidJmsTestCase
         try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
             // Have the test peer provide the destination prefixes as connection properties
             Map<Symbol, Object> properties = new HashMap<Symbol, Object>();
-            properties.put(AmqpConnectionProperties.QUEUE_PREFIX, destPrefix);
-            properties.put(AmqpConnectionProperties.TOPIC_PREFIX, destPrefix);
+            properties.put(QUEUE_PREFIX, destPrefix);
+            properties.put(TOPIC_PREFIX, destPrefix);
 
             Connection connection = testFixture.establishConnecton(testPeer, null, null,
properties);
 

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/7e1325e9/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SessionIntegrationTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SessionIntegrationTest.java
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SessionIntegrationTest.java
index fb2f8da..f6bd0d8 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SessionIntegrationTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/SessionIntegrationTest.java
@@ -18,6 +18,7 @@
  */
 package org.apache.qpid.jms.integration;
 
+import static org.apache.qpid.jms.provider.amqp.AmqpSupport.ANONYMOUS_RELAY;
 import static org.hamcrest.Matchers.arrayContaining;
 import static org.hamcrest.Matchers.equalTo;
 import static org.hamcrest.Matchers.greaterThan;
@@ -50,7 +51,6 @@ import javax.jms.Topic;
 import javax.jms.TopicSubscriber;
 
 import org.apache.qpid.jms.JmsConnection;
-import org.apache.qpid.jms.provider.amqp.AmqpConnectionProperties;
 import org.apache.qpid.jms.provider.amqp.message.AmqpDestinationHelper;
 import org.apache.qpid.jms.test.QpidJmsTestCase;
 import org.apache.qpid.jms.test.Wait;
@@ -460,7 +460,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
         try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
 
             //Add capability to indicate support for ANONYMOUS-RELAY
-            Symbol[] serverCapabilities = new Symbol[]{AmqpConnectionProperties.ANONYMOUS_RELAY};
+            Symbol[] serverCapabilities = new Symbol[]{ANONYMOUS_RELAY};
 
             Connection connection = testFixture.establishConnecton(testPeer, serverCapabilities);
             connection.start();
@@ -650,7 +650,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
     public void testCreateAnonymousProducerWhenAnonymousRelayNodeIsSupported() throws Exception
{
         try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
             //Add capability to indicate support for ANONYMOUS-RELAY
-            Symbol[] serverCapabilities = new Symbol[]{AmqpConnectionProperties.ANONYMOUS_RELAY};
+            Symbol[] serverCapabilities = new Symbol[]{ANONYMOUS_RELAY};
 
             Connection connection = testFixture.establishConnecton(testPeer, serverCapabilities);
             connection.start();
@@ -707,7 +707,7 @@ public class SessionIntegrationTest extends QpidJmsTestCase {
     private void doCreateAnonymousProducerFailsWhenAnonymousRelayNodeIsSupportedButLinkRefusedTestImpl(boolean
deferAttachFrameWrite) throws Exception {
         try (TestAmqpPeer testPeer = new TestAmqpPeer();) {
             //Add capability to indicate support for ANONYMOUS-RELAY
-            Symbol[] serverCapabilities = new Symbol[]{AmqpConnectionProperties.ANONYMOUS_RELAY};
+            Symbol[] serverCapabilities = new Symbol[]{ANONYMOUS_RELAY};
 
             Connection connection = testFixture.establishConnecton(testPeer, serverCapabilities);
             connection.start();

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/7e1325e9/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/failover/FailoverRedirectTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/failover/FailoverRedirectTest.java
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/failover/FailoverRedirectTest.java
index fb9e890..f6d7f5a 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/failover/FailoverRedirectTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/provider/failover/FailoverRedirectTest.java
@@ -59,7 +59,7 @@ public class FailoverRedirectTest extends QpidJmsTestCase {
             redirectedPeer.expectAnonymousConnect(true);
             redirectedPeer.expectBegin(true);
 
-            Map<String, Object> redirectInfo = new HashMap<String, Object>();
+            Map<Object, Object> redirectInfo = new HashMap<Object, Object>();
 
             redirectInfo.put("hostname", "localhost");
             redirectInfo.put("network-host", "localhost");
@@ -103,7 +103,7 @@ public class FailoverRedirectTest extends QpidJmsTestCase {
             redirectedPeer.expectAnonymousConnect(true);
             redirectedPeer.expectBegin(true);
 
-            Map<String, Object> redirectInfo = new HashMap<String, Object>();
+            Map<Object, Object> redirectInfo = new HashMap<Object, Object>();
 
             redirectInfo.put("hostname", "localhost");
             redirectInfo.put("network-host", "localhost");

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/7e1325e9/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 3fdf13e..684ff5b 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
@@ -37,7 +37,7 @@ import java.util.concurrent.TimeUnit;
 
 import javax.net.ssl.SSLContext;
 
-import org.apache.qpid.jms.provider.amqp.AmqpConnection;
+import org.apache.qpid.jms.provider.amqp.AmqpSupport;
 import org.apache.qpid.jms.provider.amqp.AmqpTemporaryDestination;
 import org.apache.qpid.jms.provider.amqp.message.AmqpDestinationHelper;
 import org.apache.qpid.jms.test.testpeer.basictypes.ReceiverSettleMode;
@@ -455,7 +455,7 @@ public class TestAmqpPeer implements AutoCloseable
 
     public void expectPlainConnect(String username, String password, Symbol[] serverCapabilities,
Map<Symbol, Object> serverProperties)
     {
-        expectPlainConnect(username, password, new Symbol[] { AmqpConnection.SOLE_CONNECTION_CAPABILITY
}, serverCapabilities, serverProperties);
+        expectPlainConnect(username, password, new Symbol[] { AmqpSupport.SOLE_CONNECTION_CAPABILITY
}, serverCapabilities, serverProperties);
     }
 
     public void expectPlainConnect(String username, String password, Symbol[] desiredCapabilities,
Symbol[] serverCapabilities, Map<Symbol, Object> serverProperties)
@@ -519,8 +519,7 @@ public class TestAmqpPeer implements AutoCloseable
     }
 
     // TODO - Reject any incoming connection using the supplied information
-    public void rejectConnect(Symbol errorType, String errorMessage, Map<String, Object>
errorInfo) {
-
+    public void rejectConnect(Symbol errorType, String errorMessage, Map<Object, Object>
errorInfo) {
         SaslMechanismsFrame saslMechanismsFrame = new SaslMechanismsFrame().setSaslServerMechanisms(Symbol.valueOf("ANONYMOUS"));
         addHandler(new HeaderHandlerImpl(AmqpHeader.SASL_HEADER, AmqpHeader.SASL_HEADER,
                                             new FrameSender(
@@ -1400,7 +1399,7 @@ public class TestAmqpPeer implements AutoCloseable
         remotelyCloseConnection(expectCloseResponse, errorType, errorMessage, null);
     }
 
-    public void remotelyCloseConnection(boolean expectCloseResponse, Symbol errorType, String
errorMessage, Map<String, Object> info) {
+    public void remotelyCloseConnection(boolean expectCloseResponse, Symbol errorType, String
errorMessage, Map<Object, Object> info) {
         synchronized (_handlersLock) {
             // Prepare a composite to insert this action at the end of the handler sequence
             CompositeAmqpPeerRunnable comp = insertCompsiteActionForLastHandler();

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/7e1325e9/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/JmsConnectionTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/JmsConnectionTest.java
b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/JmsConnectionTest.java
index 32a7c9c..b512f36 100644
--- a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/JmsConnectionTest.java
+++ b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/JmsConnectionTest.java
@@ -69,6 +69,8 @@ public class JmsConnectionTest extends AmqpTestSupport {
             connection2.setClientID("Test");
             fail("should have thrown a JMSException");
         } catch (JMSException ex) {
+            //TODO: change to InvalidClientIDException when updating to 5.12 or above
+            LOG.info("Remote threw ex: {}", ex);
         } catch (Exception unexpected) {
             fail("Wrong exception type thrown: " + unexpected);
         }


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


Mime
View raw message