use of com.adaptris.core.StandaloneRequestor in project interlok by adaptris.
the class BasicActiveMqProducerTest method testTopicRequestReply_Bug2277.
@Test
public void testTopicRequestReply_Bug2277() throws Exception {
TopicLoopback echo = new TopicLoopback(activeMqBroker, getName());
try {
echo.start();
StandaloneRequestor standaloneProducer = new StandaloneRequestor(activeMqBroker.getJmsConnection(createVendorImpl()), new PasProducer().withTopic(getName()));
AdaptrisMessage msg = createMessage();
msg.addMetadata(JmsConstants.JMS_ASYNC_STATIC_REPLY_TO, getName() + "_reply");
ExampleServiceCase.execute(standaloneProducer, msg);
echo.waitFor(DEFAULT_TIMEOUT);
assertNotNull(echo.getLastMessage());
assertNotNull(echo.getLastMessage().getJMSReplyTo());
assertEquals("topic://" + getName() + "_reply", echo.getLastMessage().getJMSReplyTo().toString());
} finally {
echo.stop();
}
}
use of com.adaptris.core.StandaloneRequestor in project interlok by adaptris.
the class BasicActiveMqProducerTest method testQueueRequestReply.
@Test
public void testQueueRequestReply() throws Exception {
QueueLoopback echo = new QueueLoopback(activeMqBroker, getName());
try {
echo.start();
StandaloneRequestor standaloneProducer = new StandaloneRequestor(activeMqBroker.getJmsConnection(createVendorImpl()), new PtpProducer().withQueue((getName())));
AdaptrisMessage msg = createMessage();
ExampleServiceCase.execute(standaloneProducer, msg);
echo.waitFor(DEFAULT_TIMEOUT);
assertNotNull(echo.getLastMessage());
assertNotNull(echo.getLastMessage().getJMSReplyTo());
assertEquals(DEFAULT_PAYLOAD.toUpperCase(), msg.getContent());
} finally {
echo.stop();
}
}
use of com.adaptris.core.StandaloneRequestor in project interlok by adaptris.
the class BasicActiveMqProducerTest method testTopicRequestReply.
@Test
public void testTopicRequestReply() throws Exception {
TopicLoopback echo = new TopicLoopback(activeMqBroker, getName());
try {
echo.start();
StandaloneRequestor standaloneProducer = new StandaloneRequestor(activeMqBroker.getJmsConnection(createVendorImpl()), new PasProducer().withTopic(getName()));
AdaptrisMessage msg = createMessage();
ExampleServiceCase.execute(standaloneProducer, msg);
echo.waitFor(DEFAULT_TIMEOUT);
assertNotNull(echo.getLastMessage());
assertNotNull(echo.getLastMessage().getJMSReplyTo());
assertEquals(DEFAULT_PAYLOAD.toUpperCase(), msg.getContent());
} finally {
echo.stop();
}
}
use of com.adaptris.core.StandaloneRequestor in project interlok by adaptris.
the class BasicActiveMqProducerTest method testQueueRequestReply_Bug2277.
@Test
public void testQueueRequestReply_Bug2277() throws Exception {
QueueLoopback echo = new QueueLoopback(activeMqBroker, getName());
try {
echo.start();
StandaloneRequestor standaloneProducer = new StandaloneRequestor(activeMqBroker.getJmsConnection(createVendorImpl()), new PtpProducer().withQueue((getName())));
AdaptrisMessage msg = createMessage();
msg.addMetadata(JmsConstants.JMS_ASYNC_STATIC_REPLY_TO, getName() + "_reply");
ExampleServiceCase.execute(standaloneProducer, msg);
echo.waitFor(DEFAULT_TIMEOUT);
assertNotNull(echo.getLastMessage());
assertNotNull(echo.getLastMessage().getJMSReplyTo());
assertEquals("queue://" + getName() + "_reply", echo.getLastMessage().getJMSReplyTo().toString());
} finally {
echo.stop();
}
}
use of com.adaptris.core.StandaloneRequestor in project interlok by adaptris.
the class BasicActiveMqProducerTest method testTopicRequestReplyWithMessageWrongType.
@Test
public void testTopicRequestReplyWithMessageWrongType() throws Exception {
TopicLoopback echo = new TopicLoopback(activeMqBroker, getName(), false);
try {
echo.start();
PasProducer producer = new PasProducer().withTopic(getName());
producer.setMessageTranslator(new BytesMessageTranslator());
StandaloneRequestor req = new StandaloneRequestor(activeMqBroker.getJmsConnection(createVendorImpl()), producer);
AdaptrisMessage msg = createMessage();
ExampleServiceCase.execute(req, msg);
echo.waitFor(DEFAULT_TIMEOUT);
assertNotNull(echo.getLastMessage());
assertNotNull(echo.getLastMessage().getJMSReplyTo());
} finally {
echo.stop();
}
}
Aggregations