activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject [1/2] git commit: Added testcase for https://issues.apache.org/jira/browse/AMQ-4884
Date Wed, 13 Nov 2013 18:51:22 GMT
Updated Branches:
  refs/heads/trunk 99278dfb9 -> 7f639a604


Added testcase for  https://issues.apache.org/jira/browse/AMQ-4884


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

Branch: refs/heads/trunk
Commit: 2a6aab40b4def2add11755868b3bb17fe45908e8
Parents: 99278df
Author: rajdavies <rajdavies@gmail.com>
Authored: Wed Nov 13 18:48:50 2013 +0000
Committer: rajdavies <rajdavies@gmail.com>
Committed: Wed Nov 13 18:50:56 2013 +0000

----------------------------------------------------------------------
 .../JmsTopicWildcardSendReceiveTest.java        | 27 +++++++++++++++++++-
 .../activemq/filter/DestinationMapTest.java     |  2 ++
 2 files changed, 28 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/2a6aab40/activemq-unit-tests/src/test/java/org/apache/activemq/JmsTopicWildcardSendReceiveTest.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/JmsTopicWildcardSendReceiveTest.java
b/activemq-unit-tests/src/test/java/org/apache/activemq/JmsTopicWildcardSendReceiveTest.java
index 7239fb3..52cf2be 100755
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/JmsTopicWildcardSendReceiveTest.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/JmsTopicWildcardSendReceiveTest.java
@@ -24,7 +24,6 @@ import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
 import javax.jms.Session;
 import javax.jms.TextMessage;
-
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.test.JmsTopicSendReceiveTest;
 
@@ -150,6 +149,32 @@ public class JmsTopicWildcardSendReceiveTest extends JmsTopicSendReceiveTest
{
 
     }
 
+    public void testReceiveWildcardTopicMatchDoubleWildcard() throws Exception {
+        connection.start();
+        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+        ActiveMQDestination destination1 = (ActiveMQDestination)session.createTopic("a.*.>.>");
+        ActiveMQDestination destination2 = (ActiveMQDestination)session.createTopic("a.b");
+
+        Message m = null;
+        MessageConsumer consumer = null;
+        String text = null;
+
+
+        consumer = session.createConsumer(destination1);
+        sendMessage(session, destination2, destination3String);
+
+        m = consumer.receive(1000);
+        assertNotNull(m);
+        text = ((TextMessage)m).getText();
+        if (!(text.equals(destination1String) || text.equals(destination3String))) {
+            fail("unexpected message:" + text);
+        }
+
+        assertNull(consumer.receiveNoWait());
+    }
+
+
     private void sendMessage(Session session, Destination destination, String text) throws
JMSException {
         MessageProducer producer = session.createProducer(destination);
         producer.send(session.createTextMessage(text));

http://git-wip-us.apache.org/repos/asf/activemq/blob/2a6aab40/activemq-unit-tests/src/test/java/org/apache/activemq/filter/DestinationMapTest.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/filter/DestinationMapTest.java
b/activemq-unit-tests/src/test/java/org/apache/activemq/filter/DestinationMapTest.java
index f3f5b72..5de46b7 100755
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/filter/DestinationMapTest.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/filter/DestinationMapTest.java
@@ -136,6 +136,8 @@ public class DestinationMapTest extends TestCase {
         assertMapValue(">", allValues);
         assertMapValue("TEST.>", allValues);
         assertMapValue("*.>", allValues);
+        assertMapValue("TEST.*.>", allValues);
+        assertMapValue("TEST.*.*.>", v2,v3);
 
         assertMapValue("FOO.>", null);
     }


Mime
View raw message