From 312c15a3daeb89956b58540f55f65145062bda7a Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Wed, 10 Dec 2008 23:23:24 +0000 Subject: QPID-1526: add checks for exclusive ownership plus tests to verify they are executed git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@725483 13f79535-47bb-0310-9956-ffa450edef68 --- python/tests_0-10/queue.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'python') diff --git a/python/tests_0-10/queue.py b/python/tests_0-10/queue.py index a3b23a1c32..05e18081fa 100644 --- a/python/tests_0-10/queue.py +++ b/python/tests_0-10/queue.py @@ -88,7 +88,7 @@ class QueueTests(TestBase010): # TestBase.setUp has already opened session(1) s1 = self.session # Here we open a second separate connection: - s2 = self.conn.session("other", 2) + s2 = self.conn.session("other") #declare an exclusive queue: s1.queue_declare(queue="exclusive-queue", exclusive=True, auto_delete=True) @@ -98,6 +98,22 @@ 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: + s3.message_subscribe(queue="exclusive-queue") + self.fail("Expected message_subscribe on an exclusive queue to raise a channel exception") + except SessionException, e: + self.assertEquals(405, e.args[0].error_code) + + s4 = self.conn.session("deleter") + try: + #other connection should not be allowed to declare this: + s4.queue_delete(queue="exclusive-queue") + self.fail("Expected queue_delete on an exclusive queue to raise a channel exception") + except SessionException, e: + self.assertEquals(405, e.args[0].error_code) def test_declare_passive(self): -- cgit v1.2.1