diff options
| author | Gordon Sim <gsim@apache.org> | 2013-10-31 18:37:49 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2013-10-31 18:37:49 +0000 |
| commit | 81c95a528a716800efac7b90667c83dfe2149c6e (patch) | |
| tree | 6e56bd667758af5789abe91aa3147db92919baa2 /qpid/tests/src | |
| parent | 9637a0498399980bbc60311239d6368875d6f92b (diff) | |
| download | qpid-python-81c95a528a716800efac7b90667c83dfe2149c6e.tar.gz | |
QPID-5283: ensure queue has no consumers before granting exclusive ownership
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1537579 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/tests/src')
| -rw-r--r-- | qpid/tests/src/py/qpid_tests/broker_0_10/dtx.py | 1 | ||||
| -rw-r--r-- | qpid/tests/src/py/qpid_tests/broker_0_10/queue.py | 21 |
2 files changed, 20 insertions, 2 deletions
diff --git a/qpid/tests/src/py/qpid_tests/broker_0_10/dtx.py b/qpid/tests/src/py/qpid_tests/broker_0_10/dtx.py index 19a5c6a8d9..f8d6533a78 100644 --- a/qpid/tests/src/py/qpid_tests/broker_0_10/dtx.py +++ b/qpid/tests/src/py/qpid_tests/broker_0_10/dtx.py @@ -386,7 +386,6 @@ class DtxTests(TestBase010): """ guard = self.keepQueuesAlive(["tx-queue"]) session = self.conn.session("alternate", 1) - session.queue_declare(queue="tx-queue", exclusive=True, auto_delete=True) #publish a message under a transaction session.dtx_select() diff --git a/qpid/tests/src/py/qpid_tests/broker_0_10/queue.py b/qpid/tests/src/py/qpid_tests/broker_0_10/queue.py index 7e8218d092..545bc8cc23 100644 --- a/qpid/tests/src/py/qpid_tests/broker_0_10/queue.py +++ b/qpid/tests/src/py/qpid_tests/broker_0_10/queue.py @@ -99,7 +99,7 @@ class QueueTests(TestBase010): self.fail("Expected second exclusive queue_declare to raise a channel exception") except SessionException, e: self.assertEquals(405, e.args[0].error_code) - + s3 = self.conn.session("subscriber") try: #other connection should not be allowed to declare this: @@ -132,6 +132,25 @@ class QueueTests(TestBase010): except SessionException, e: self.assertEquals(405, e.args[0].error_code) + def test_declare_exclusive_alreadyinuse(self): + """ + Test that exclusivity is real if granted + """ + # TestBase.setUp has already opened session(1) + s1 = self.session + # Here we open a second separate connection: + s2 = self.conn.session("other") + + #declare an exclusive queue: + s1.queue_declare(queue="a-queue", auto_delete=True) + s1.message_subscribe(queue="a-queue") + try: + #other connection should not be allowed to declare this: + s2.queue_declare(queue="a-queue", exclusive=True, auto_delete=True) + self.fail("Expected request for exclusivity to fail") + except SessionException, e: + self.assertEquals(405, e.args[0].error_code) + def test_declare_passive(self): """ Test that the passive field is honoured in queue.declare |
