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 | fcc6dc5cd355cb0fd0340c2bcf095c8d055d1cb5 (patch) | |
| tree | 8a764bdb350e8b3589b85de483f2fa11aa11c6f7 /qpid/python | |
| parent | e7be65166ffb08622ad089c844098d50895920ee (diff) | |
| download | qpid-python-fcc6dc5cd355cb0fd0340c2bcf095c8d055d1cb5.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@747833 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python')
| -rw-r--r-- | qpid/python/tests_0-10/message.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/qpid/python/tests_0-10/message.py b/qpid/python/tests_0-10/message.py index cbcef5602f..f2e2dc88ee 100644 --- a/qpid/python/tests_0-10/message.py +++ b/qpid/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 |
