qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r581880 - /incubator/qpid/trunk/qpid/python/tests_0-10/message.py
Date Thu, 04 Oct 2007 12:46:43 GMT
Author: gsim
Date: Thu Oct  4 05:46:42 2007
New Revision: 581880

URL: http://svn.apache.org/viewvc?rev=581880&view=rev
Log:
Added test for ordering of released messages


Modified:
    incubator/qpid/trunk/qpid/python/tests_0-10/message.py

Modified: incubator/qpid/trunk/qpid/python/tests_0-10/message.py
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/tests_0-10/message.py?rev=581880&r1=581879&r2=581880&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/tests_0-10/message.py (original)
+++ incubator/qpid/trunk/qpid/python/tests_0-10/message.py Thu Oct  4 05:46:42 2007
@@ -589,6 +589,30 @@
         #message should not have been removed from the queue:
         self.assertEquals(1, channel.queue_query(queue = "q").message_count)
 
+    def test_release_ordering(self):
+        """
+        Test order of released messages is as expected
+        """
+        channel = self.channel
+        channel.queue_declare(queue = "q", exclusive=True)
+        for i in range (1, 11):
+            channel.message_transfer(content=Content(properties={'routing_key' : "q"}, body
= "released message %s" % (i)))
+
+        channel.message_subscribe(queue = "q", destination = "a", confirm_mode = 1)
+        channel.message_flow(unit = 0, value = 10, destination = "a")
+        channel.message_flow(unit = 1, value = 0xFFFFFFFF, destination = "a")
+        queue = self.client.queue("a")
+        first = queue.get(timeout = 1)
+        for i in range (2, 10):        
+            self.assertEquals("released message %s" % (i), queue.get(timeout = 1).content.body)
+        last = queue.get(timeout = 1)
+        self.assertEmpty(queue)
+        channel.message_release([first.command_id, last.command_id])
+        last.complete()#will re-allocate credit, as in window mode
+        for i in range (1, 11):
+            self.assertEquals("released message %s" % (i), queue.get(timeout = 1).content.body)
+
+
     def assertDataEquals(self, channel, msg, expected):
         self.assertEquals(expected, msg.content.body)
 



Mime
View raw message