summaryrefslogtreecommitdiff
path: root/qpid/python
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2010-01-22 10:58:20 +0000
committerGordon Sim <gsim@apache.org>2010-01-22 10:58:20 +0000
commit94414b346e8423c7d2ced919a022867e0217fbaf (patch)
treecc33eba0e3faccba8bd910739659a41d5f162403 /qpid/python
parentfa62d82fe2dfc127440de4675803d1a279807722 (diff)
downloadqpid-python-94414b346e8423c7d2ced919a022867e0217fbaf.tar.gz
QPID-2347: Signal deletion of queue to active subscribers via a resource-deleted exception.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@902055 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python')
-rw-r--r--qpid/python/qpid/tests/messaging.py6
-rw-r--r--qpid/python/tests_0-10/exchange.py4
2 files changed, 10 insertions, 0 deletions
diff --git a/qpid/python/qpid/tests/messaging.py b/qpid/python/qpid/tests/messaging.py
index 9a8a4c807c..683bb574ee 100644
--- a/qpid/python/qpid/tests/messaging.py
+++ b/qpid/python/qpid/tests/messaging.py
@@ -239,6 +239,12 @@ class SessionTests(Base):
pass
assert msgs == fetched, "expecting %s, got %s" % (msgs, fetched)
self.ssn.acknowledge()
+ #we set the capacity to 0 to prevent the deletion of the queue -
+ #triggered the deletion policy when the first receiver is closed -
+ #resulting in session exceptions being issued for the remaining
+ #active subscriptions:
+ for r in [rcv1, rcv2, rcv3]:
+ r.capacity = 0
# XXX, we need a convenient way to assert that required queues are
# empty on setup, and possibly also to drain queues on teardown
diff --git a/qpid/python/tests_0-10/exchange.py b/qpid/python/tests_0-10/exchange.py
index 8d9713076d..0ac78a4799 100644
--- a/qpid/python/tests_0-10/exchange.py
+++ b/qpid/python/tests_0-10/exchange.py
@@ -35,9 +35,12 @@ class TestHelper(TestBase010):
TestBase010.setUp(self)
self.queues = []
self.exchanges = []
+ self.subscriptions = []
def tearDown(self):
try:
+ for s in self.subscriptions:
+ self.session.message_cancel(destination=s)
for ssn, q in self.queues:
ssn.queue_delete(queue=q)
for ssn, ex in self.exchanges:
@@ -110,6 +113,7 @@ class TestHelper(TestBase010):
self.session.message_subscribe(queue=queueName, destination=consumer_tag)
self.session.message_flow(destination=consumer_tag, unit=self.session.credit_unit.message, value=0xFFFFFFFFL)
self.session.message_flow(destination=consumer_tag, unit=self.session.credit_unit.byte, value=0xFFFFFFFFL)
+ self.subscriptions.append(consumer_tag)
return self.session.incoming(consumer_tag)