mirror of https://github.com/apache/activemq.git
Added testcase for https://issues.apache.org/jira/browse/AMQ-4884
This commit is contained in:
parent
99278dfb9c
commit
2a6aab40b4
|
@ -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));
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue