session.verify();
tempQueue.verify();
}
public void testRequestMessage() {
MockMessage reply = new MockTextMessage();
MockMessage request = new MockTextMessage();
MockQueue queue = new MockQueue();
MockQueueReceiver receiver = new MockQueueReceiver();
MockQueueSender sender = new MockQueueSender();
MockQueueSession session = new MockQueueSession();
MockTemporaryQueue tempQueue = new MockTemporaryQueue();
request.setExpectedJMSReplyTo(tempQueue);
receiver.setExpectedReceiveCalls(1);
receiver.setupReceivedMessage(reply);
sender.setExpectedSendCalls(1);
session.setupReceiver(receiver);
session.setupSender(sender);
session.setupTemporaryQueue(tempQueue);
try {
QueueRequestor requestor = new QueueRequestor(session, queue);
Message jmsReply = requestor.request(request);
assertEquals(jmsReply, reply);
} catch (JMSException ex) {
fail("JMSException should not have been thrown.");
}
reply.verify();
request.verify();
queue.verify();
receiver.verify();
sender.verify();
session.verify();
tempQueue.verify();