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 validation.
Date Thu, 10 Nov 2016 17:46:01 GMT
Repository: activemq
Updated Branches:
  refs/heads/master 1a75e0f33 -> 097c0e7ea


NO-JIRA Add some additional validation.

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

Branch: refs/heads/master
Commit: 097c0e7eae360f376b525448863e86452ebc06cc
Parents: 1a75e0f
Author: Timothy Bish <tabish121@gmail.com>
Authored: Thu Nov 10 12:45:37 2016 -0500
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Thu Nov 10 12:45:37 2016 -0500

----------------------------------------------------------------------
 .../amqp/interop/AmqpScheduledMessageTest.java        | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/097c0e7e/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpScheduledMessageTest.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpScheduledMessageTest.java
b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpScheduledMessageTest.java
index 053ec7e..b91dac0 100644
--- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpScheduledMessageTest.java
+++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpScheduledMessageTest.java
@@ -18,6 +18,7 @@ package org.apache.activemq.transport.amqp.interop;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -171,6 +172,7 @@ public class AmqpScheduledMessageTest extends AmqpClientTestSupport {
         assertEquals(0, brokerService.getAdminView().getQueues().length);
 
         AmqpSender sender = session.createSender("queue://" + getTestName());
+        AmqpReceiver receiver = session.createReceiver("queue://" + getTestName());
 
         // Get the Queue View early to avoid racing the delivery.
         assertEquals(1, brokerService.getAdminView().getQueues().length);
@@ -184,20 +186,28 @@ public class AmqpScheduledMessageTest extends AmqpClientTestSupport
{
         sender.send(message);
         sender.close();
 
+        receiver.flow(1);
+
         // Read the message with short timeout, shouldn't get it.
         try {
-            readMessages(getTestName(), 1, false, 1000);
+            assertNull(receiver.receive(1, TimeUnit.SECONDS));
             fail("Should not read the message");
         } catch (Throwable ex) {
         }
 
         // Read the message with long timeout, should get it.
+        AmqpMessage delivered = null;
         try {
-            readMessages(getTestName(), 1, false, 10000);
+            delivered = receiver.receive(10, TimeUnit.SECONDS);
         } catch (Throwable ex) {
             fail("Should read the message");
         }
 
+        assertNotNull(delivered);
+        Long msgDeliveryTime = (Long) delivered.getMessageAnnotation("x-opt-delivery-delay");
+        assertNotNull(msgDeliveryTime);
+        assertEquals(delay, msgDeliveryTime.longValue());
+
         connection.close();
     }
 


Mime
View raw message