From a5a52b65174dfb12dc06ed0fc70ce3c25f25b0f6 Mon Sep 17 00:00:00 2001 From: Timothy Bish Date: Tue, 14 Apr 2015 17:22:14 -0400 Subject: [PATCH] add a test that sends multiple messages at a Queue. --- .../amqp/interop/AmqpSenderTest.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSenderTest.java b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSenderTest.java index b060a0766b..d8f4c85f51 100644 --- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSenderTest.java +++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSenderTest.java @@ -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;