activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/2] activemq-artemis git commit: ARTEMIS-1068 Add Routing Exclusivity test for JMS AMQP
Date Fri, 24 Mar 2017 21:43:23 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 91ee5272b -> eb961e0a9


ARTEMIS-1068 Add Routing Exclusivity test for JMS AMQP


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/a9c3e437
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/a9c3e437
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/a9c3e437

Branch: refs/heads/master
Commit: a9c3e437d87625c049ac78b0811064cd646a9f2e
Parents: 91ee527
Author: Martyn Taylor <mtaylor@redhat.com>
Authored: Fri Mar 24 16:05:18 2017 +0000
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Fri Mar 24 17:40:36 2017 -0400

----------------------------------------------------------------------
 .../tests/integration/amqp/ProtonTest.java      | 45 ++++++++++++++++++++
 .../integration/client/AcknowledgeTest.java     |  1 -
 .../tests/integration/client/RoutingTest.java   |  1 -
 3 files changed, 45 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a9c3e437/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ProtonTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ProtonTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ProtonTest.java
index 1308c37..fb5e90a 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ProtonTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ProtonTest.java
@@ -79,6 +79,7 @@ import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
 import org.apache.activemq.artemis.tests.util.Wait;
 import org.apache.activemq.artemis.utils.ByteUtil;
 import org.apache.activemq.artemis.utils.TimeUtils;
+import org.apache.activemq.artemis.utils.UUIDGenerator;
 import org.apache.activemq.artemis.utils.VersionLoader;
 import org.apache.activemq.transport.amqp.client.AmqpClient;
 import org.apache.activemq.transport.amqp.client.AmqpConnection;
@@ -1855,6 +1856,50 @@ public class ProtonTest extends ProtonTestBase {
       }
    }
 
+   /**
+    * If we have an address configured with both ANYCAST and MULTICAST routing types enabled,
we must ensure that any
+    * messages sent specifically to MULTICAST (e.g. JMS TopicProducer) are only delivered
to MULTICAST queues (e.g.
+    * i.e. subscription queues) and **NOT** to ANYCAST queues (e.g. JMS Queue).
+    *
+    * @throws Exception
+    */
+   @Test
+   public void testRoutingExclusivity() throws Exception {
+
+      // Create Address with both ANYCAST and MULTICAST enabled
+      String testAddress = "testRoutingExclusivity";
+      SimpleString ssTestAddress = new SimpleString(testAddress);
+
+      AddressInfo addressInfo = new AddressInfo(ssTestAddress);
+      addressInfo.addRoutingType(RoutingType.MULTICAST);
+      addressInfo.addRoutingType(RoutingType.ANYCAST);
+
+      server.addAddressInfo(addressInfo);
+      server.createQueue(ssTestAddress, RoutingType.ANYCAST, ssTestAddress, null, true, false);
+
+      Connection connection = createConnection(UUIDGenerator.getInstance().generateStringUUID());
+
+      try {
+
+         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         Topic topic = session.createTopic(testAddress);
+         javax.jms.Queue queue = session.createQueue(testAddress);
+
+         MessageProducer producer = session.createProducer(topic);
+
+         MessageConsumer queueConsumer = session.createConsumer(queue);
+         MessageConsumer topicConsumer = session.createConsumer(topic);
+
+         producer.send(session.createTextMessage("testMessage"));
+
+         assertNotNull(topicConsumer.receive(1000));
+         assertNull(queueConsumer.receive(1000));
+      } finally {
+         connection.close();
+      }
+   }
+
    @Test
    public void testReleaseDisposition() throws Exception {
       AmqpClient client = new AmqpClient(new URI(tcpAmqpConnectionUri), userName, password);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a9c3e437/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AcknowledgeTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AcknowledgeTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AcknowledgeTest.java
index 604b630..d7c9855 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AcknowledgeTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AcknowledgeTest.java
@@ -28,7 +28,6 @@ import org.apache.activemq.artemis.api.core.ActiveMQPropertyConversionException;
 import org.apache.activemq.artemis.api.core.ICoreMessage;
 import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.RefCountMessage;
-import org.apache.activemq.artemis.api.core.RoutingType;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a9c3e437/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RoutingTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RoutingTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RoutingTest.java
index 8de6958..9d66b61 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RoutingTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/RoutingTest.java
@@ -19,7 +19,6 @@ package org.apache.activemq.artemis.tests.integration.client;
 import java.util.HashSet;
 import java.util.Set;
 
-import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.client.ClientConsumer;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;


Mime
View raw message