summaryrefslogtreecommitdiff
path: root/qpid/python
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-10-04 16:06:05 +0000
committerGordon Sim <gsim@apache.org>2007-10-04 16:06:05 +0000
commite15418d64f9b44de937b3a4f4ba08ec0a5f58c03 (patch)
tree58f77239093f4ded69b09d0489b04539970da09c /qpid/python
parentf6afed79c8618f02431bdd9d3ca25e75deef184e (diff)
downloadqpid-python-e15418d64f9b44de937b3a4f4ba08ec0a5f58c03.tar.gz
Additional tests and fixes
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@581957 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python')
-rw-r--r--qpid/python/tests_0-10/message.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/qpid/python/tests_0-10/message.py b/qpid/python/tests_0-10/message.py
index 6931f83a6b..416eaeba3e 100644
--- a/qpid/python/tests_0-10/message.py
+++ b/qpid/python/tests_0-10/message.py
@@ -612,6 +612,29 @@ class MessageTests(TestBase):
for i in range (1, 11):
self.assertEquals("released message %s" % (i), queue.get(timeout = 1).content.body)
+ def test_ranged_ack(self):
+ """
+ Test acking of messages ranges
+ """
+ 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 = "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")
+ for i in range (1, 11):
+ self.assertEquals("message %s" % (i), queue.get(timeout = 1).content.body)
+ self.assertEmpty(queue)
+
+ #ack all but the third message (command id 2)
+ channel.execution_complete(cumulative_execution_mark=0xFFFFFFFF, ranged_execution_set=[0,1,3,6,7,7,8,9])
+ channel.message_recover()
+ self.assertEquals("message 3", queue.get(timeout = 1).content.body)
+ self.assertEmpty(queue)
+
def assertDataEquals(self, channel, msg, expected):
self.assertEquals(expected, msg.content.body)