try
{
conn1 = JMSTestCase.cf.createQueueConnection();
QueueSession sess1 = conn1.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
QueueRequestor requestor = new QueueRequestor(sess1, HornetQServerTestCase.queue1);
conn1.start();
// And the responder
conn2 = JMSTestCase.cf.createQueueConnection();
QueueSession sess2 = conn2.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
TestMessageListener listener = new TestMessageListener(sess2);
QueueReceiver receiver = sess2.createReceiver(HornetQServerTestCase.queue1);
receiver.setMessageListener(listener);
conn2.start();
Message m1 = sess1.createMessage();
log.trace("Sending request message");
TextMessage m2 = (TextMessage)requestor.request(m1);
ProxyAssertSupport.assertNotNull(m2);
ProxyAssertSupport.assertEquals("This is the response", m2.getText());
}
finally