QPID-6933: [System Tests] Refactor routing tests as JMS 1.1 system test

Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/8d028eff
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/8d028eff
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/8d028eff

Branch: refs/heads/master
Commit: 8d028eff837c91aaff411ddea0059833395c0e9b
Parents: 0904d66
Author: Alex Rudyy <[email protected]>
Authored: Thu Jan 4 22:59:40 2018 +0000
Committer: Alex Rudyy <[email protected]>
Committed: Thu Jan 4 23:43:53 2018 +0000

----------------------------------------------------------------------
 .../routing/AlternateBindingRoutingTest.java    | 116 +++++++++++
 .../extensions/routing/ExchangeRoutingTest.java | 192 +++++++++++++++++++
 .../routing/AlternateBindingRoutingTest.java    |  88 ---------
 .../server/routing/ExchangeRoutingTest.java     | 187 ------------------
 test-profiles/CPPExcludes                       |   4 +-
 5 files changed, 309 insertions(+), 278 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/8d028eff/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/routing/AlternateBindingRoutingTest.java
----------------------------------------------------------------------
diff --git 
a/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/routing/AlternateBindingRoutingTest.java
 
b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/routing/AlternateBindingRoutingTest.java
new file mode 100644
index 0000000..529d42f
--- /dev/null
+++ 
b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/routing/AlternateBindingRoutingTest.java
@@ -0,0 +1,116 @@
+/*
+ *
+ * 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.systests.jms_1_1.extensions.routing;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.jms.Connection;
+import javax.jms.Queue;
+import javax.jms.Session;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.junit.Test;
+
+import org.apache.qpid.server.model.AlternateBinding;
+import org.apache.qpid.systests.JmsTestBase;
+import org.apache.qpid.systests.Utils;
+
+public class AlternateBindingRoutingTest extends JmsTestBase
+{
+    @Test
+    public void testFanoutExchangeAsAlternateBinding() throws Exception
+    {
+        String queueName = getTestName();
+        String deadLetterQueueName = queueName + "_DeadLetter";
+        String deadLetterExchangeName = "deadLetterExchange";
+
+        createEntityUsingAmqpManagement(deadLetterQueueName,
+                                        "org.apache.qpid.StandardQueue",
+                                        Collections.emptyMap());
+        createEntityUsingAmqpManagement(deadLetterExchangeName,
+                                        "org.apache.qpid.FanoutExchange",
+                                        Collections.emptyMap());
+
+        final Map<String, Object> arguments = new HashMap<>();
+        arguments.put("destination", deadLetterQueueName);
+        arguments.put("bindingKey", queueName);
+        performOperationUsingAmqpManagement(deadLetterExchangeName,
+                                            "bind",
+                                            "org.apache.qpid.Exchange",
+                                            arguments);
+
+        final Map<String, Object> attributes = new HashMap<>();
+        attributes.put(org.apache.qpid.server.model.Queue.NAME, queueName);
+        attributes.put(org.apache.qpid.server.model.Queue.ALTERNATE_BINDING,
+                       new 
ObjectMapper().writeValueAsString(Collections.singletonMap(AlternateBinding.DESTINATION,
+                                                                               
       deadLetterExchangeName)));
+        createEntityUsingAmqpManagement(queueName,
+                                        "org.apache.qpid.StandardQueue",
+                                        attributes);
+
+        Queue testQueue = createQueue(queueName);
+
+        Connection connection = getConnection();
+        try
+        {
+            connection.start();
+            Session session = connection.createSession(true, 
Session.SESSION_TRANSACTED);
+
+            Utils.sendMessages(session, testQueue, 1);
+
+            assertEquals("Unexpected number of messages on queue", 1, 
getQueueDepth(queueName));
+            assertEquals("Unexpected number of messages on DLQ", 0, 
getQueueDepth(deadLetterQueueName));
+
+            performOperationUsingAmqpManagement(queueName,
+                                                "DELETE",
+                                                "org.apache.qpid.Queue",
+                                                Collections.emptyMap());
+
+            assertEquals("Unexpected number of messages on DLQ after 
deletion", 1, getQueueDepth(deadLetterQueueName));
+        }
+        finally
+        {
+            connection.close();
+        }
+    }
+
+    private int getQueueDepth(final String queueName) throws Exception
+    {
+        Map<String, Object> arguments =
+                Collections.singletonMap("statistics", 
Collections.singletonList("queueDepthMessages"));
+        Object statistics = performOperationUsingAmqpManagement(queueName,
+                                                                
"getStatistics",
+                                                                
"org.apache.qpid.Queue",
+                                                                arguments);
+        assertNotNull("Statistics is null", statistics);
+        assertTrue("Statistics is not map", statistics instanceof Map);
+        @SuppressWarnings("unchecked")
+        Map<String, Object> statisticsMap = (Map<String, Object>) statistics;
+        assertTrue("queueDepthMessages is not present", 
statisticsMap.get("queueDepthMessages") instanceof Number);
+        return ((Number) statisticsMap.get("queueDepthMessages")).intValue();
+    }
+}

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/8d028eff/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/routing/ExchangeRoutingTest.java
----------------------------------------------------------------------
diff --git 
a/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/routing/ExchangeRoutingTest.java
 
b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/routing/ExchangeRoutingTest.java
new file mode 100644
index 0000000..fd116a9
--- /dev/null
+++ 
b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/routing/ExchangeRoutingTest.java
@@ -0,0 +1,192 @@
+/*
+ *
+ * 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.systests.jms_1_1.extensions.routing;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.jms.Connection;
+import javax.jms.Destination;
+import javax.jms.Session;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.junit.Test;
+
+import org.apache.qpid.server.model.Binding;
+import org.apache.qpid.server.model.Protocol;
+import org.apache.qpid.systests.JmsTestBase;
+import org.apache.qpid.systests.Utils;
+
+
+public class ExchangeRoutingTest extends JmsTestBase
+{
+
+    private static final String AMQP_MNG_QPID_EXCHANGE_DIRECT = 
"org.apache.qpid.DirectExchange";
+    private static final String AMQP_MNG_QPID_QUEUE_STANDARD = 
"org.apache.qpid.StandardQueue";
+
+    @Test
+    public void testExchangeToQueueRouting() throws Exception
+    {
+        String queueName = getTestName() + "Queue";
+        String exchangeName = getTestName() + "Exchange";
+        String routingKey = "key";
+
+        createEntityUsingAmqpManagement(queueName, 
AMQP_MNG_QPID_QUEUE_STANDARD, Collections.emptyMap());
+        createEntityUsingAmqpManagement(exchangeName, 
AMQP_MNG_QPID_EXCHANGE_DIRECT, Collections.emptyMap());
+
+        final Map<String, Object> bindingArguments = new HashMap<>();
+        bindingArguments.put("destination", queueName);
+        bindingArguments.put("bindingKey", routingKey);
+
+        performOperationUsingAmqpManagement(exchangeName,
+                                            "bind",
+                                            "org.apache.qpid.Exchange",
+                                            bindingArguments);
+
+        routeTest(exchangeName, queueName, "unboundKey", 0, 0);
+        routeTest(exchangeName, queueName, routingKey, 0, 1);
+    }
+
+    @Test
+    public void testExchangeToExchangeToQueueRouting() throws Exception
+    {
+        String queueName = getTestName() + "Queue";
+        String exchangeName1 = getTestName() + "Exchange1";
+        String exchangeName2 = getTestName() + "Exchange2";
+        String bindingKey = "key";
+
+        createEntityUsingAmqpManagement(queueName, 
AMQP_MNG_QPID_QUEUE_STANDARD, Collections.emptyMap());
+        createEntityUsingAmqpManagement(exchangeName1, 
AMQP_MNG_QPID_EXCHANGE_DIRECT, Collections.emptyMap());
+        createEntityUsingAmqpManagement(exchangeName2, 
AMQP_MNG_QPID_EXCHANGE_DIRECT, Collections.emptyMap());
+
+        final Map<String, Object> binding1Arguments = new HashMap<>();
+        binding1Arguments.put("destination", exchangeName2);
+        binding1Arguments.put("bindingKey", bindingKey);
+
+        performOperationUsingAmqpManagement(exchangeName1,
+                                            "bind",
+                                            "org.apache.qpid.Exchange",
+                                            binding1Arguments);
+
+        final Map<String, Object> binding2Arguments = new HashMap<>();
+        binding2Arguments.put("destination", queueName);
+        binding2Arguments.put("bindingKey", bindingKey);
+
+        performOperationUsingAmqpManagement(exchangeName2,
+                                            "bind",
+                                            "org.apache.qpid.Exchange",
+                                            binding2Arguments);
+
+        routeTest(exchangeName1, queueName, bindingKey, 0, 1);
+    }
+
+    @Test
+    public void 
testExchangeToExchangeToQueueRoutingWithReplacementRoutingKey() throws Exception
+    {
+        String queueName = getTestName() + "Queue";
+        String exchangeName1 = getTestName() + "Exchange1";
+        String exchangeName2 = getTestName() + "Exchange2";
+        String bindingKey1 = "key1";
+        String bindingKey2 = "key2";
+
+        createEntityUsingAmqpManagement(queueName, 
AMQP_MNG_QPID_QUEUE_STANDARD, Collections.emptyMap());
+        createEntityUsingAmqpManagement(exchangeName1, 
AMQP_MNG_QPID_EXCHANGE_DIRECT, Collections.emptyMap());
+        createEntityUsingAmqpManagement(exchangeName2, 
AMQP_MNG_QPID_EXCHANGE_DIRECT, Collections.emptyMap());
+
+        final Map<String, Object> binding1Arguments = new HashMap<>();
+        binding1Arguments.put("destination", exchangeName2);
+        binding1Arguments.put("bindingKey", bindingKey1);
+        binding1Arguments.put("arguments",
+                              new 
ObjectMapper().writeValueAsString(Collections.singletonMap(Binding.BINDING_ARGUMENT_REPLACEMENT_ROUTING_KEY,
+                                                                               
              bindingKey2)));
+
+        performOperationUsingAmqpManagement(exchangeName1,
+                                            "bind",
+                                            "org.apache.qpid.Exchange",
+                                            binding1Arguments);
+
+        final Map<String, Object> binding2Arguments = new HashMap<>();
+        binding2Arguments.put("destination", queueName);
+        binding2Arguments.put("bindingKey", bindingKey2);
+
+        performOperationUsingAmqpManagement(exchangeName2,
+                                            "bind",
+                                            "org.apache.qpid.Exchange",
+                                            binding2Arguments);
+
+        routeTest(exchangeName1, queueName, bindingKey1, 0, 1);
+    }
+
+    private void routeTest(final String fromExchangeName,
+                           final String queueName,
+                           final String routingKey,
+                           final int expectedDepthBefore,
+                           final int expectedDepthAfter) throws Exception
+    {
+        Connection connection = getConnection();
+        try
+        {
+            Session session = connection.createSession(false, 
Session.AUTO_ACKNOWLEDGE);
+            Destination ingressExchangeDestination =
+                    
session.createQueue(getDestinationAddress(fromExchangeName, routingKey));
+
+            assertEquals(String.format("Unexpected number of messages on queue 
'%s'", queueName),
+                         expectedDepthBefore, getQueueDepth(queueName));
+
+            Utils.sendMessages(connection, ingressExchangeDestination, 1);
+
+            assertEquals(String.format("Unexpected number of messages on queue 
'%s", queueName),
+                         expectedDepthAfter, getQueueDepth(queueName));
+        }
+        finally
+        {
+            connection.close();
+        }
+    }
+
+    private String getDestinationAddress(final String exchangeName, final 
String routingKey)
+    {
+        return getProtocol() == Protocol.AMQP_1_0
+                ? String.format("%s/%s", exchangeName, routingKey)
+                : String.format("ADDR:%s/%s", exchangeName, routingKey);
+    }
+
+    private int getQueueDepth(final String queueName) throws Exception
+    {
+        Map<String, Object> arguments =
+                Collections.singletonMap("statistics", 
Collections.singletonList("queueDepthMessages"));
+        Object statistics = performOperationUsingAmqpManagement(queueName,
+                                                                
"getStatistics",
+                                                                
"org.apache.qpid.Queue",
+                                                                arguments);
+        assertNotNull("Statistics is null", statistics);
+        assertTrue("Statistics is not map", statistics instanceof Map);
+        @SuppressWarnings("unchecked")
+        Map<String, Object> statisticsMap = (Map<String, Object>) statistics;
+        assertTrue("queueDepthMessages is not present", 
statisticsMap.get("queueDepthMessages") instanceof Number);
+        return ((Number) statisticsMap.get("queueDepthMessages")).intValue();
+    }
+}

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/8d028eff/systests/src/test/java/org/apache/qpid/server/routing/AlternateBindingRoutingTest.java
----------------------------------------------------------------------
diff --git 
a/systests/src/test/java/org/apache/qpid/server/routing/AlternateBindingRoutingTest.java
 
b/systests/src/test/java/org/apache/qpid/server/routing/AlternateBindingRoutingTest.java
deleted file mode 100644
index 86ab13f..0000000
--- 
a/systests/src/test/java/org/apache/qpid/server/routing/AlternateBindingRoutingTest.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- *
- * 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.server.routing;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.jms.Connection;
-import javax.jms.Queue;
-import javax.jms.Session;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import org.apache.qpid.server.model.AlternateBinding;
-import org.apache.qpid.test.utils.QpidBrokerTestCase;
-
-public class AlternateBindingRoutingTest extends QpidBrokerTestCase
-{
-    public void testFanoutExchangeAsAlternateBinding() throws Exception
-    {
-        Connection connection = getConnection();
-        connection.start();
-        Session session = connection.createSession(true, 
Session.SESSION_TRANSACTED);
-
-        String queueName = getTestQueueName();
-        String deadLetterQueueName = queueName + "_DeadLetter";
-        String deadLetterExchangeName = "deadLetterExchange";
-
-        Queue deadLetterQueue = createTestQueue(session, deadLetterQueueName);
-
-        createEntityUsingAmqpManagement(deadLetterExchangeName,
-                                        session,
-                                        "org.apache.qpid.FanoutExchange");
-
-        final Map<String, Object> arguments = new HashMap<>();
-        arguments.put("destination", deadLetterQueueName);
-        arguments.put("bindingKey", queueName);
-        performOperationUsingAmqpManagement(deadLetterExchangeName,
-                                            "bind",
-                                            session,
-                                            "org.apache.qpid.Exchange",
-                                            arguments);
-
-        final Map<String, Object> attributes = new HashMap<>();
-        attributes.put(org.apache.qpid.server.model.Queue.NAME, queueName);
-        attributes.put(org.apache.qpid.server.model.Queue.ALTERNATE_BINDING,
-                       new 
ObjectMapper().writeValueAsString(Collections.singletonMap(AlternateBinding.DESTINATION,
-                                                                               
       deadLetterExchangeName)));
-        createEntityUsingAmqpManagement(queueName,
-                                        session,
-                                        "org.apache.qpid.StandardQueue",
-                                        attributes);
-        Queue testQueue = getQueueFromName(session, queueName);
-
-        sendMessage(session, testQueue, 1);
-        assertEquals("Unexpected number of messages on queueName", 1, 
getQueueDepth(connection, testQueue));
-
-        assertEquals("Unexpected number of messages on DLQ queueName", 0, 
getQueueDepth(connection, deadLetterQueue));
-
-        performOperationUsingAmqpManagement(queueName,
-                                            "DELETE",
-                                            session,
-                                            "org.apache.qpid.Queue",
-                                            Collections.emptyMap());
-
-        assertEquals("Unexpected number of messages on DLQ queueName", 1, 
getQueueDepth(connection, deadLetterQueue));
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/8d028eff/systests/src/test/java/org/apache/qpid/server/routing/ExchangeRoutingTest.java
----------------------------------------------------------------------
diff --git 
a/systests/src/test/java/org/apache/qpid/server/routing/ExchangeRoutingTest.java
 
b/systests/src/test/java/org/apache/qpid/server/routing/ExchangeRoutingTest.java
deleted file mode 100644
index 55e1640..0000000
--- 
a/systests/src/test/java/org/apache/qpid/server/routing/ExchangeRoutingTest.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- *
- * 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.server.routing;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.jms.Connection;
-import javax.jms.Destination;
-import javax.jms.Queue;
-import javax.jms.Session;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import org.apache.qpid.jms.ConnectionURL;
-import org.apache.qpid.server.model.Binding;
-import org.apache.qpid.test.utils.QpidBrokerTestCase;
-
-public class ExchangeRoutingTest extends QpidBrokerTestCase
-{
-
-    private static final String AMQP_MNG_QPID_EXCHANGE_DIRECT = 
"org.apache.qpid.DirectExchange";
-    private static final String AMQP_MNG_QPID_EXCHANGE_FANOUT = 
"org.apache.qpid.FanoutExchange";
-    private static final String AMQP_MNG_QPID_EXCHANGE_TOPIC = 
"org.apache.qpid.FanoutExchange";
-    private static final String AMQP_MNG_QPID_QUEUE_STANDARD = 
"org.apache.qpid.StandardQueue";
-    private String _queueName;
-    private String _exchName1;
-    private String _exchName2;
-    private Connection _connection;
-    private Session _session;
-
-    @Override
-    protected void setUp() throws Exception
-    {
-        super.setUp();
-        _queueName = getTestQueueName() + "_queue";
-        _exchName1 = getTestQueueName() + "_exch1";
-        _exchName2 = getTestQueueName() + "_exch2";
-
-        _connection = createConnection();
-        _connection.start();
-        _session = _connection.createSession(true, Session.SESSION_TRANSACTED);
-
-        createEntityUsingAmqpManagement(_queueName, _session, 
AMQP_MNG_QPID_QUEUE_STANDARD);
-    }
-
-    private Connection createConnection() throws Exception
-    {
-        if (isBrokerPre010())
-        {
-            Map<String, String> options = new HashMap<>();
-            options.put(ConnectionURL.OPTIONS_CLOSE_WHEN_NO_ROUTE, 
Boolean.toString(false));
-            return getConnectionWithOptions(options);
-        }
-        else
-        {
-            return getConnection();
-        }
-    }
-
-    public void testExchangeToQueueRouting() throws Exception
-    {
-        String routingKey = "key";
-
-        createEntityUsingAmqpManagement(_exchName1, _session, 
AMQP_MNG_QPID_EXCHANGE_DIRECT);
-
-        final Map<String, Object> bindingArguments = new HashMap<>();
-        bindingArguments.put("destination", _queueName);
-        bindingArguments.put("bindingKey", routingKey);
-
-        performOperationUsingAmqpManagement(_exchName1,
-                                            "bind",
-                                            _connection.createSession(false, 
Session.AUTO_ACKNOWLEDGE),
-                                            "org.apache.qpid.Exchange",
-                                            bindingArguments);
-
-        routeTest(_exchName1, _queueName, "unboundKey", 0, 0);
-        routeTest(_exchName1, _queueName, routingKey, 0, 1);
-    }
-
-    public void testExchangeToExchangeToQueueRouting() throws Exception
-    {
-        String bindingKey = "key";
-
-        createEntityUsingAmqpManagement(_exchName1, _session, 
AMQP_MNG_QPID_EXCHANGE_DIRECT);
-        createEntityUsingAmqpManagement(_exchName2, _session, 
AMQP_MNG_QPID_EXCHANGE_DIRECT);
-
-        final Map<String, Object> binding1Arguments = new HashMap<>();
-        binding1Arguments.put("destination", _exchName2);
-        binding1Arguments.put("bindingKey", bindingKey);
-
-        performOperationUsingAmqpManagement(_exchName1,
-                                            "bind",
-                                            _connection.createSession(false, 
Session.AUTO_ACKNOWLEDGE),
-                                            "org.apache.qpid.Exchange",
-                                            binding1Arguments);
-
-        final Map<String, Object> binding2Arguments = new HashMap<>();
-        binding2Arguments.put("destination", _queueName);
-        binding2Arguments.put("bindingKey", bindingKey);
-
-        performOperationUsingAmqpManagement(_exchName2,
-                                            "bind",
-                                            _connection.createSession(false, 
Session.AUTO_ACKNOWLEDGE),
-                                            "org.apache.qpid.Exchange",
-                                            binding2Arguments);
-
-        routeTest(_exchName1, _queueName, bindingKey, 0, 1);
-    }
-
-    public void 
testExchangeToExchangeToQueueRoutingWithReplacementRoutingKey() throws Exception
-    {
-        String bindingKey1 = "key1";
-        String bindingKey2 = "key2";
-
-        createEntityUsingAmqpManagement(_exchName1, _session, 
AMQP_MNG_QPID_EXCHANGE_DIRECT);
-        createEntityUsingAmqpManagement(_exchName2, _session, 
AMQP_MNG_QPID_EXCHANGE_DIRECT);
-
-        final Map<String, Object> binding1Arguments = new HashMap<>();
-        binding1Arguments.put("destination", _exchName2);
-        binding1Arguments.put("bindingKey", bindingKey1);
-        binding1Arguments.put("arguments",
-                              new 
ObjectMapper().writeValueAsString(Collections.singletonMap(Binding.BINDING_ARGUMENT_REPLACEMENT_ROUTING_KEY,
-                                                                               
              bindingKey2)));
-
-        performOperationUsingAmqpManagement(_exchName1,
-                                            "bind",
-                                            _connection.createSession(false, 
Session.AUTO_ACKNOWLEDGE),
-                                            "org.apache.qpid.Exchange",
-                                            binding1Arguments);
-
-
-        final Map<String, Object> binding2Arguments = new HashMap<>();
-        binding2Arguments.put("destination", _queueName);
-        binding2Arguments.put("bindingKey", bindingKey2);
-
-        performOperationUsingAmqpManagement(_exchName2,
-                                            "bind",
-                                            _connection.createSession(false, 
Session.AUTO_ACKNOWLEDGE),
-                                            "org.apache.qpid.Exchange",
-                                            binding2Arguments);
-
-        routeTest(_exchName1, _queueName, bindingKey1, 0, 1);
-    }
-
-    private void routeTest(final String fromExchangeName,
-                           final String queueName,
-                           final String routingKey,
-                           final int expectedDepthBefore,
-                           final int expectedDepthAfter) throws Exception
-    {
-        Destination ingressExchangeDest = 
_session.createQueue(getDestinationAddress(fromExchangeName, routingKey));
-        Queue queueDest = _session.createQueue(queueName);
-
-        assertEquals(String.format("Unexpected number of messages on queue 
'%s'", queueName),
-                     expectedDepthBefore, getQueueDepth(_connection, 
queueDest));
-
-        sendMessage(_session, ingressExchangeDest, 1);
-
-        assertEquals(String.format("Unexpected number of messages on queue 
'%s", queueName),
-                     expectedDepthAfter, getQueueDepth(_connection, 
queueDest));
-    }
-
-    private String getDestinationAddress(final String exchangeName, final 
String routingKey)
-    {
-        return isBroker10() ? String.format("%s/%s", exchangeName,routingKey): 
String.format("ADDR:%s/%s", exchangeName,routingKey);
-    }
-}

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/8d028eff/test-profiles/CPPExcludes
----------------------------------------------------------------------
diff --git a/test-profiles/CPPExcludes b/test-profiles/CPPExcludes
index 8d0f750..182de05 100755
--- a/test-profiles/CPPExcludes
+++ b/test-profiles/CPPExcludes
@@ -175,12 +175,10 @@ org.apache.qpid.systests.jms_2_0.*
 org.apache.qpid.tests.protocol.v1_0.*
 
 # Tests require AMQP management
-org.apache.qpid.server.routing.AlternateBindingRoutingTest#*
 org.apache.qpid.server.queue.QueueDepthWithSelectorTest#test
 org.apache.qpid.test.unit.message.UTF8Test#*
 
 # Tests AMQP 1.0 specific routing semantics
 org.apache.qpid.systest.MessageRoutingTest#*
 
-# Exchange to Exchange bindings not support by CPP Broker.
-org.apache.qpid.server.routing.ExchangeRoutingTest#*
+


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

Reply via email to