This commit is contained in:
rajdavies 2013-11-13 18:48:50 +00:00
parent 99278dfb9c
commit 2a6aab40b4
2 changed files with 28 additions and 1 deletions

View File

@ -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));

View File

@ -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);
}