Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5E9F3C421 for ; Wed, 12 Mar 2014 17:07:05 +0000 (UTC) Received: (qmail 53154 invoked by uid 500); 12 Mar 2014 17:06:43 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 53056 invoked by uid 500); 12 Mar 2014 17:06:42 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 52988 invoked by uid 99); 12 Mar 2014 17:06:40 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Mar 2014 17:06:40 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 63826942267; Wed, 12 Mar 2014 17:06:40 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: hadrian@apache.org To: commits@activemq.apache.org Date: Wed, 12 Mar 2014 17:06:41 -0000 Message-Id: In-Reply-To: <445c4400deb94a4992c911846dab0d0e@git.apache.org> References: <445c4400deb94a4992c911846dab0d0e@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [02/18] git commit: Added testcase for https://issues.apache.org/jira/browse/AMQ-4884 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/d5904df9 Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/d5904df9 Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/d5904df9 Branch: refs/heads/activemq-5.9 Commit: d5904df97bff739107e3e69e9e4eadefe0163e18 Parents: 27f8d67 Author: rajdavies Authored: Wed Nov 13 18:48:50 2013 +0000 Committer: Hadrian Zbarcea Committed: Wed Mar 12 12:05:10 2014 -0400 ---------------------------------------------------------------------- .../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/d5904df9/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/d5904df9/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); }