add a test that sends multiple messages at a Queue.

This commit is contained in:
Timothy Bish 2015-04-14 17:22:14 -04:00
parent cb370d06e9
commit a5a52b6517
1 changed files with 24 additions and 0 deletions

View File

@ -95,6 +95,30 @@ public class AmqpSenderTest extends AmqpClientTestSupport {
connection.close();
}
@Test(timeout = 60000)
public void testSendMultipleMessagesToQueue() throws Exception {
final int MSG_COUNT = 100;
AmqpClient client = createAmqpClient();
AmqpConnection connection = client.connect();
AmqpSession session = connection.createSession();
AmqpSender sender = session.createSender("queue://" + getTestName());
for (int i = 0; i < MSG_COUNT; ++i) {
AmqpMessage message = new AmqpMessage();
message.setText("Test-Message: " + i);
sender.send(message);
}
QueueViewMBean queue = getProxyToQueue(getTestName());
assertEquals(MSG_COUNT, queue.getQueueSize());
sender.close();
connection.close();
}
@Test(timeout = 60000)
public void testUnsettledSender() throws Exception {
final int MSG_COUNT = 1000;