diff options
| author | Gordon Sim <gsim@apache.org> | 2009-02-25 15:46:04 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2009-02-25 15:46:04 +0000 |
| commit | ecde9757abc26697220e00d3306a11919f2fe2ca (patch) | |
| tree | 12a12ab5d20cb01954e9d09ed00306fe63c5d5a1 /python | |
| parent | cddb14732340187296847418e419e70e3d007494 (diff) | |
| download | qpid-python-ecde9757abc26697220e00d3306a11919f2fe2ca.tar.gz | |
Fix for bug in credit reallocation, along with test from rafaels@redhat.com that reproduces it.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@747833 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python')
| -rw-r--r-- | python/tests_0-10/message.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/python/tests_0-10/message.py b/python/tests_0-10/message.py index cbcef5602f..f2e2dc88ee 100644 --- a/python/tests_0-10/message.py +++ b/python/tests_0-10/message.py @@ -462,6 +462,42 @@ class MessageTests(TestBase010): self.assertDataEquals(session, q.get(timeout = 1), "abcdefgh") self.assertEmpty(q) + def test_window_flush_ack_flow(self): + """ + Test basic window based flow control with unit = bytes + """ + #declare an exclusive queue + ssn = self.session + ssn.queue_declare(queue = "q", exclusive=True, auto_delete=True) + #create consumer + ssn.message_subscribe(queue = "q", destination = "c", + accept_mode=ssn.accept_mode.explicit) + ssn.message_set_flow_mode(flow_mode = ssn.flow_mode.window, destination = "c") + + #send message A + ssn.message_transfer(message=Message(ssn.delivery_properties(routing_key="q"), "A")) + + for unit in ssn.credit_unit.values(): + ssn.message_flow("c", unit, 0xFFFFFFFFL) + + q = ssn.incoming("c") + msgA = q.get(timeout=10) + + ssn.message_flush(destination="c") + + # XXX + ssn.receiver._completed.add(msgA.id) + ssn.channel.session_completed(ssn.receiver._completed) + ssn.message_accept(RangedSet(msgA.id)) + + for unit in ssn.credit_unit.values(): + ssn.message_flow("c", unit, 0xFFFFFFFFL) + + #send message B + ssn.message_transfer(message=Message(ssn.delivery_properties(routing_key="q"), "B")) + + msgB = q.get(timeout=10) + def test_subscribe_not_acquired(self): """ Test the not-acquired modes works as expected for a simple case |
