You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2014/11/26 19:54:15 UTC

qpid-jms git commit: update test to show the order of all messages received when failing.

Repository: qpid-jms
Updated Branches:
  refs/heads/master d51d41911 -> b7e7ecdd5


update test to show the order of all messages received when failing.


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

Branch: refs/heads/master
Commit: b7e7ecdd5f9816a7acef3d912bf59b5f52149d47
Parents: d51d419
Author: Robert Gemmell <ro...@apache.org>
Authored: Wed Nov 26 18:53:31 2014 +0000
Committer: Robert Gemmell <ro...@apache.org>
Committed: Wed Nov 26 18:53:57 2014 +0000

----------------------------------------------------------------------
 .../jms/transactions/JmsTransactedConsumerTest.java   | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/b7e7ecdd/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/transactions/JmsTransactedConsumerTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/transactions/JmsTransactedConsumerTest.java b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/transactions/JmsTransactedConsumerTest.java
index c4b61fa..468997d 100644
--- a/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/transactions/JmsTransactedConsumerTest.java
+++ b/qpid-jms-interop-tests/qpid-jms-activemq-tests/src/test/java/org/apache/qpid/jms/transactions/JmsTransactedConsumerTest.java
@@ -20,6 +20,9 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import javax.jms.Message;
 import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
@@ -193,14 +196,23 @@ public class JmsTransactedConsumerTest extends AmqpTestSupport {
 
         // Consume again.. the previously consumed messages should get delivered
         // again after the rollback and then the remainder should follow
+        List<Integer> messageNumbers = new ArrayList<Integer>();
         for(int i = 1; i <= totalCount; i++) {
             Message message = consumer.receive(1000);
             assertNotNull(message);
-            assertEquals("Unexpected message number after rollback", i, message.getIntProperty(QpidJmsTestSupport.MESSAGE_NUMBER));
+            int msgNum = message.getIntProperty(QpidJmsTestSupport.MESSAGE_NUMBER);
+            messageNumbers.add(msgNum);
         }
 
         session.commit();
 
+        assertEquals("Unexpected size of list", totalCount, messageNumbers.size());
+        for(int i = 0; i < messageNumbers.size(); i++)
+        {
+            assertEquals("Unexpected order of messages: " + messageNumbers, Integer.valueOf(i + 1), messageNumbers.get(i));
+        }
+
+
         assertEquals(0, proxy.getQueueSize());
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org