summaryrefslogtreecommitdiff
path: root/cpp/src/tests/brokertest.py
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2011-04-15 17:03:17 +0000
committerAlan Conway <aconway@apache.org>2011-04-15 17:03:17 +0000
commit7952aa3296d4acedf09d9526f5947d8b32cee711 (patch)
tree56beb019eeeb10f07682b3612e93e739a222fd12 /cpp/src/tests/brokertest.py
parent13e1747a6b9a4615ce0cd5536a676a496b389450 (diff)
downloadqpid-python-7952aa3296d4acedf09d9526f5947d8b32cee711.tar.gz
QPID-3208: Exchanges make best effort to route messages if there is an error.
Previously if multiple queues were bound to the same routing key, then a failure to deliver to one of the queues (e.g. policy limit error) could prevent delivery on some of the other queues. With this commit the exchange delivers to every queue that did not have an error before raising an error. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1092765 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/brokertest.py')
-rw-r--r--cpp/src/tests/brokertest.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/cpp/src/tests/brokertest.py b/cpp/src/tests/brokertest.py
index 4abe4c2cbe..a19dd305e5 100644
--- a/cpp/src/tests/brokertest.py
+++ b/cpp/src/tests/brokertest.py
@@ -484,18 +484,24 @@ class BrokerTest(TestCase):
cluster = Cluster(self, count, args, expect=expect, wait=wait)
return cluster
- def assert_browse(self, session, queue, expect_contents, timeout=0):
+ def browse(self, session, queue, timeout=0):
"""Assert that the contents of messages on queue (as retrieved
using session and timeout) exactly match the strings in
expect_contents"""
-
r = session.receiver("%s;{mode:browse}"%(queue))
- actual_contents = []
try:
- for c in expect_contents: actual_contents.append(r.fetch(timeout=timeout).content)
- while True: actual_contents.append(r.fetch(timeout=0).content) # Check for extra messages.
- except messaging.Empty: pass
- r.close()
+ contents = []
+ try:
+ while True: contents.append(r.fetch(timeout=timeout).content)
+ except messaging.Empty: pass
+ finally: pass #FIXME aconway 2011-04-14: r.close()
+ return contents
+
+ def assert_browse(self, session, queue, expect_contents, timeout=0):
+ """Assert that the contents of messages on queue (as retrieved
+ using session and timeout) exactly match the strings in
+ expect_contents"""
+ actual_contents = self.browse(session, queue, timeout)
self.assertEqual(expect_contents, actual_contents)
def join(thread, timeout=10):