From 592f2a9bc018b61ec5c0280907e0bb7628ad8fa4 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Tue, 15 Feb 2011 18:58:44 +0000 Subject: QPID-3000: Added optional delay for auto-deletion git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1071013 13f79535-47bb-0310-9956-ffa450edef68 --- tests/src/py/qpid_tests/broker_0_10/__init__.py | 1 + tests/src/py/qpid_tests/broker_0_10/extensions.py | 37 +++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 tests/src/py/qpid_tests/broker_0_10/extensions.py (limited to 'tests') diff --git a/tests/src/py/qpid_tests/broker_0_10/__init__.py b/tests/src/py/qpid_tests/broker_0_10/__init__.py index 46d56ee0c0..921786af22 100644 --- a/tests/src/py/qpid_tests/broker_0_10/__init__.py +++ b/tests/src/py/qpid_tests/broker_0_10/__init__.py @@ -32,3 +32,4 @@ from tx import * from lvq import * from priority import * from threshold import * +from extensions import * diff --git a/tests/src/py/qpid_tests/broker_0_10/extensions.py b/tests/src/py/qpid_tests/broker_0_10/extensions.py new file mode 100644 index 0000000000..26ea3cb0e9 --- /dev/null +++ b/tests/src/py/qpid_tests/broker_0_10/extensions.py @@ -0,0 +1,37 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +from qpid.client import Client, Closed +from qpid.queue import Empty +from qpid.content import Content +from qpid.testlib import TestBase010 +from time import sleep + +class ExtensionTests(TestBase010): + """Tests for various extensions to AMQP 0-10""" + + def test_timed_autodelete(self): + session = self.session + session2 = self.conn.session("another-session") + session2.queue_declare(queue="my-queue", exclusive=True, auto_delete=True, arguments={"qpid.auto_delete_timeout":5}) + session2.close() + result = session.queue_query(queue="my-queue") + self.assertEqual("my-queue", result.queue) + sleep(5) + result = session.queue_query(queue="my-queue") + self.assert_(not result.queue) -- cgit v1.2.1