activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject activemq git commit: Add a test for the unsettled sate as well, and some logs.
Date Tue, 14 Apr 2015 16:33:15 GMT
Repository: activemq
Updated Branches:
  refs/heads/master b3bf8e74f -> cb370d06e


Add a test for the unsettled sate as well, and some logs. 

Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/cb370d06
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/cb370d06
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/cb370d06

Branch: refs/heads/master
Commit: cb370d06e9ac23b6c363ac93b0e484848a09f403
Parents: b3bf8e7
Author: Timothy Bish <tabish121@gmail.com>
Authored: Tue Apr 14 12:33:05 2015 -0400
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Tue Apr 14 12:33:05 2015 -0400

----------------------------------------------------------------------
 .../transport/amqp/interop/AmqpSenderTest.java  | 39 +++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/cb370d06/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSenderTest.java
----------------------------------------------------------------------
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 886a42e..b060a07 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
@@ -96,6 +96,39 @@ public class AmqpSenderTest extends AmqpClientTestSupport {
     }
 
     @Test(timeout = 60000)
+    public void testUnsettledSender() throws Exception {
+        final int MSG_COUNT = 1000;
+
+        AmqpClient client = createAmqpClient();
+        AmqpConnection connection = client.connect();
+        AmqpSession session = connection.createSession();
+
+        AmqpSender sender = session.createSender("topic://" + getTestName(), false);
+
+        for (int i = 1; i <= MSG_COUNT; ++i) {
+            AmqpMessage message = new AmqpMessage();
+            message.setText("Test-Message: " + i);
+            sender.send(message);
+
+            if (i % 1000 == 0) {
+                LOG.info("Sent message: {}", i);
+            }
+        }
+
+        final TopicViewMBean topic = getProxyToTopic(getTestName());
+        assertTrue("All messages should arrive", Wait.waitFor(new Wait.Condition() {
+
+            @Override
+            public boolean isSatisified() throws Exception {
+                return topic.getEnqueueCount() == MSG_COUNT;
+            }
+        }));
+
+        sender.close();
+        connection.close();
+    }
+
+    @Test(timeout = 60000)
     public void testPresettledSender() throws Exception {
         final int MSG_COUNT = 1000;
 
@@ -105,10 +138,14 @@ public class AmqpSenderTest extends AmqpClientTestSupport {
 
         AmqpSender sender = session.createSender("topic://" + getTestName(), true);
 
-        for (int i = 0; i < MSG_COUNT; ++i) {
+        for (int i = 1; i <= MSG_COUNT; ++i) {
             AmqpMessage message = new AmqpMessage();
             message.setText("Test-Message: " + i);
             sender.send(message);
+
+            if (i % 1000 == 0) {
+                LOG.info("Sent message: {}", i);
+            }
         }
 
         final TopicViewMBean topic = getProxyToTopic(getTestName());


Mime
View raw message