use of org.apache.activemq.command.ActiveMQDestination in project activemq-artemis by apache.
the class DestinationMapTest method assertMapValue.
protected void assertMapValue(String destinationName, Object expected) {
ActiveMQDestination destination = createDestination(destinationName);
assertMapValue(destination, expected);
}
use of org.apache.activemq.command.ActiveMQDestination in project activemq-artemis by apache.
the class DestinationMapTest method testCompositeDestinations.
public void testCompositeDestinations() throws Exception {
ActiveMQDestination d1 = createDestination("TEST.BAR.D2");
ActiveMQDestination d2 = createDestination("TEST.BAR.D3");
map.put(d1, d1);
map.put(d2, d2);
map.get(createDestination("TEST.BAR.D2,TEST.BAR.D3"));
}
use of org.apache.activemq.command.ActiveMQDestination in project activemq-artemis by apache.
the class JmsTopicWildcardSendReceiveTest method testReceiveWildcardTopicMidAsterisk.
@Test
public void testReceiveWildcardTopicMidAsterisk() throws Exception {
connection.start();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
ActiveMQDestination destination1 = (ActiveMQDestination) session.createTopic(destination1String);
ActiveMQDestination destination4 = (ActiveMQDestination) session.createTopic(destination4String);
Message m = null;
MessageConsumer consumer = null;
String text = null;
ActiveMQDestination destination8 = (ActiveMQDestination) session.createTopic("TEST.*.ONE");
consumer = session.createConsumer(destination8);
sendMessage(session, destination1, destination1String);
sendMessage(session, destination4, destination4String);
m = consumer.receive(1000);
assertNotNull(m);
text = ((TextMessage) m).getText();
if (!(text.equals(destination1String) || text.equals(destination4String))) {
fail("unexpected message:" + text);
}
m = consumer.receive(1000);
assertNotNull(m);
text = ((TextMessage) m).getText();
if (!(text.equals(destination1String) || text.equals(destination4String))) {
fail("unexpected message:" + text);
}
assertNull(consumer.receiveNoWait());
}
use of org.apache.activemq.command.ActiveMQDestination in project activemq-artemis by apache.
the class JmsTopicWildcardSendReceiveTest method testReceiveWildcardTopicEndGreaterThan.
@Test
public void testReceiveWildcardTopicEndGreaterThan() throws Exception {
connection.start();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
ActiveMQDestination destination1 = (ActiveMQDestination) session.createTopic(destination1String);
ActiveMQDestination destination2 = (ActiveMQDestination) session.createTopic(destination2String);
ActiveMQDestination destination3 = (ActiveMQDestination) session.createTopic(destination3String);
Message m = null;
MessageConsumer consumer = null;
String text = null;
ActiveMQDestination destination7 = (ActiveMQDestination) session.createTopic("TEST.ONE.>");
consumer = session.createConsumer(destination7);
sendMessage(session, destination1, destination1String);
sendMessage(session, destination2, destination2String);
sendMessage(session, destination3, destination3String);
m = consumer.receive(1000);
assertNotNull(m);
text = ((TextMessage) m).getText();
if (!(text.equals(destination1String) || text.equals(destination2String) || text.equals(destination3String))) {
fail("unexpected message:" + text);
}
m = consumer.receive(1000);
assertNotNull(m);
if (!(text.equals(destination1String) || text.equals(destination2String) || text.equals(destination3String))) {
fail("unexpected message:" + text);
}
m = consumer.receive(1000);
assertNotNull(m);
if (!(text.equals(destination1String) || text.equals(destination2String) || text.equals(destination3String))) {
fail("unexpected message:" + text);
}
assertNull(consumer.receiveNoWait());
}
use of org.apache.activemq.command.ActiveMQDestination in project activemq-artemis by apache.
the class JmsTopicWildcardSendReceiveTest method testReceiveWildcardTopicMatchSinglePastTheEndWildcard.
@Test
public void testReceiveWildcardTopicMatchSinglePastTheEndWildcard() throws Exception {
connection.start();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
ActiveMQDestination destination1 = (ActiveMQDestination) session.createTopic("a.>");
ActiveMQDestination destination2 = (ActiveMQDestination) session.createTopic("a");
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());
}
Aggregations