activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject activemq git commit: NO-JIRA: Add some additional assertions so tests fail more cleanly in the case of a receive not getting a message before it's assigned timeout. (cherry picked from commit 33e27a4f5ac864c3bd7ee124b2e2f2e43e8c5983)
Date Wed, 17 Feb 2016 16:44:29 GMT
Repository: activemq
Updated Branches:
  refs/heads/activemq-5.13.x 0c9fdb5b4 -> ef295414b


NO-JIRA: Add some additional assertions so tests fail more cleanly in
the case of a receive not getting a message before it's assigned
timeout.
(cherry picked from commit 33e27a4f5ac864c3bd7ee124b2e2f2e43e8c5983)


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

Branch: refs/heads/activemq-5.13.x
Commit: ef295414b2beb42cf9e9086b06454f0e5cb20988
Parents: 0c9fdb5
Author: Timothy Bish <tabish121@gmail.com>
Authored: Wed Feb 17 11:34:25 2016 -0500
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Wed Feb 17 11:35:31 2016 -0500

----------------------------------------------------------------------
 .../transport/amqp/interop/AmqpSendReceiveTest.java      | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/ef295414/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSendReceiveTest.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSendReceiveTest.java
b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSendReceiveTest.java
index 906febf..4dd2f0c 100644
--- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSendReceiveTest.java
+++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpSendReceiveTest.java
@@ -67,6 +67,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport {
         AmqpReceiver receiver1 = session.createReceiver("queue://" + getTestName());
         receiver1.flow(MSG_COUNT);
         AmqpMessage received = receiver1.receive(5, TimeUnit.SECONDS);
+        assertNotNull("Should have got a message", received);
         assertEquals("msg0", received.getMessageId());
         receiver1.close();
 
@@ -74,6 +75,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport {
         receiver2.flow(200);
         for (int i = 0; i < MSG_COUNT; ++i) {
             received = receiver2.receive(5, TimeUnit.SECONDS);
+            assertNotNull("Should have got a message", received);
             assertEquals("msg" + i, received.getMessageId());
         }
 
@@ -103,7 +105,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport {
         AmqpReceiver receiver = session.createReceiver("queue://" + getTestName(), "sn =
100");
         receiver.flow(2);
         AmqpMessage received = receiver.receive(5, TimeUnit.SECONDS);
-        assertNotNull(received);
+        assertNotNull("Should have read a message", received);
         assertEquals(100, received.getApplicationProperty("sn"));
         assertEquals("abcdefg", received.getGroupId());
         received.accept();
@@ -139,6 +141,8 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport {
         receiver1.flow(2);
         AmqpMessage message1 = receiver1.receive(5, TimeUnit.SECONDS);
         AmqpMessage message2 = receiver1.receive(5, TimeUnit.SECONDS);
+        assertNotNull("Should have read message 1", message1);
+        assertNotNull("Should have read message 2", message2);
         assertEquals("msg0", message1.getMessageId());
         assertEquals("msg1", message2.getMessageId());
         message1.accept();
@@ -148,6 +152,8 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport {
         receiver2.flow(2);
         AmqpMessage message3 = receiver2.receive(5, TimeUnit.SECONDS);
         AmqpMessage message4 = receiver2.receive(5, TimeUnit.SECONDS);
+        assertNotNull("Should have read message 3", message3);
+        assertNotNull("Should have read message 4", message4);
         assertEquals("msg2", message3.getMessageId());
         assertEquals("msg3", message4.getMessageId());
         message3.accept();
@@ -156,6 +162,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport {
         receiver1.flow(MSG_COUNT - 4);
         for (int i = 4; i < MSG_COUNT - 4; i++) {
             AmqpMessage message = receiver1.receive(5, TimeUnit.SECONDS);
+            assertNotNull("Should have read a message", message);
             assertEquals("msg" + i, message.getMessageId());
             message.accept();
         }
@@ -185,6 +192,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport {
         assertEquals(1, queue.getQueueSize());
         receiver1.flow(1);
         message1 = receiver1.receive(50, TimeUnit.SECONDS);
+        assertNotNull("Should have read a message", message1);
         assertFalse("First message sent should not be durable", message1.isDurable());
         message1.accept();
 
@@ -198,6 +206,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport {
         assertEquals(1, queue.getQueueSize());
         receiver1.flow(1);
         message2 = receiver1.receive(50, TimeUnit.SECONDS);
+        assertNotNull("Should have read a message", message2);
         assertTrue("Second message sent should be durable", message2.isDurable());
         message2.accept();
 


Mime
View raw message