diff options
author | Gordon Sim <gsim@apache.org> | 2011-02-23 12:56:28 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2011-02-23 12:56:28 +0000 |
commit | e25908e06f3d4c7d10ad07a4ad4741ab248342a8 (patch) | |
tree | 35a17e8261e851ba6212d8819780bb1f12f4ac0c /qpid/tests | |
parent | 052e0384661c654f6067f21cb55254eb46885127 (diff) | |
download | qpid-python-e25908e06f3d4c7d10ad07a4ad4741ab248342a8.tar.gz |
QPID-529: Additional test: verify re-route works against priority enabled queues
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1073724 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/tests')
-rw-r--r-- | qpid/tests/src/py/qpid_tests/broker_0_10/management.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/qpid/tests/src/py/qpid_tests/broker_0_10/management.py b/qpid/tests/src/py/qpid_tests/broker_0_10/management.py index 06f3212a6f..b0d7ca5f52 100644 --- a/qpid/tests/src/py/qpid_tests/broker_0_10/management.py +++ b/qpid/tests/src/py/qpid_tests/broker_0_10/management.py @@ -242,6 +242,38 @@ class ManagementTest (TestBase010): pq = self.qmf.getObjects(_class="queue", name="purge-queue")[0] self.assertEqual (pq.msgDepth,0) + def test_reroute_priority_queue(self): + self.startQmf() + session = self.session + + #setup test queue supporting multiple priority levels + session.queue_declare(queue="test-queue", exclusive=True, auto_delete=True, arguments={'x-qpid-priorities':10}) + + #send some messages of varying priority to that queue: + for i in range(0, 5): + deliveryProps = session.delivery_properties(routing_key="test-queue", priority=i+5) + session.message_transfer(message=Message(deliveryProps, "Message %d" % (i+1))) + + + #declare and bind a queue to amq.fanout through which rerouted + #messages can be verified: + session.queue_declare(queue="rerouted", exclusive=True, auto_delete=True, arguments={'x-qpid-priorities':10}) + session.exchange_bind(queue="rerouted", exchange="amq.fanout") + + #reroute messages from test queue to amq.fanout (and hence to + #rerouted queue): + pq = self.qmf.getObjects(_class="queue", name="test-queue")[0] + result = pq.reroute(0, False, "amq.fanout") + self.assertEqual(result.status, 0) + + #verify messages are all rerouted: + self.subscribe(destination="incoming", queue="rerouted") + incoming = session.incoming("incoming") + for i in range(0, 5): + msg = incoming.get(timeout=1) + self.assertEqual("Message %d" % (5-i), msg.body) + + def test_reroute_queue(self): """ Test ability to reroute messages from the head of a queue. |