mirror of https://github.com/apache/activemq.git
add a test that sends multiple messages at a Queue.
This commit is contained in:
parent
cb370d06e9
commit
a5a52b6517
|
@ -95,6 +95,30 @@ public class AmqpSenderTest extends AmqpClientTestSupport {
|
||||||
connection.close();
|
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)
|
@Test(timeout = 60000)
|
||||||
public void testUnsettledSender() throws Exception {
|
public void testUnsettledSender() throws Exception {
|
||||||
final int MSG_COUNT = 1000;
|
final int MSG_COUNT = 1000;
|
||||||
|
|
Loading…
Reference in New Issue