Author: kpvdr
Date: 2012-10-05 10:33:48 -0400 (Fri, 05 Oct 2012)
New Revision: 4515
Modified:
store/trunk/cpp/tests/python_tests/client_persistence.py
store/trunk/cpp/tests/python_tests/store_test.py
Log:
QPID-4347 - Checkin from kgiusti: Verifies that store/recovery of federation works
Modified: store/trunk/cpp/tests/python_tests/client_persistence.py
===================================================================
--- store/trunk/cpp/tests/python_tests/client_persistence.py 2012-09-25 20:44:25 UTC (rev
4514)
+++ store/trunk/cpp/tests/python_tests/client_persistence.py 2012-10-05 14:33:48 UTC (rev
4515)
@@ -132,8 +132,40 @@
broker = self.broker(store_args(), name="test_message_reject")
qmf = Qmf(broker)
assert qmf.queue_message_count("tmr") == 0
+
+ def test_route(self):
+ """ Test the recovery of a route (link and bridge
objects."""
+ broker = self.broker(store_args(), name="test_route",
expect=EXPECT_EXIT_OK)
+ qmf = Qmf(broker)
+ qmf_broker_obj = qmf.get_objects("broker")[0]
+
+ # create a "link"
+ link_args = {"host":"a.fake.host.com", "port":9999,
"durable":True,
+ "authMechanism":"PLAIN",
"username":"guest", "password":"guest",
+ "transport":"tcp"}
+ result = qmf_broker_obj.create("link", "test-link",
link_args, False)
+ self.assertEqual(result.status, 0, result)
+ link = qmf.get_objects("link")[0]
+
+ # create bridge
+ bridge_args = {"link":"test-link",
"src":"amq.direct", "dest":"amq.fanout",
+ "key":"my-key", "durable":True}
+ result = qmf_broker_obj.create("bridge", "test-bridge",
bridge_args, False);
+ self.assertEqual(result.status, 0, result)
+ bridge = qmf.get_objects("bridge")[0]
+
+ broker.terminate()
+
+ # recover the link and bridge
+ broker = self.broker(store_args(), name="test_route")
+ qmf = Qmf(broker)
+ qmf_broker_obj = qmf.get_objects("broker")[0]
+ self.assertEqual(len(qmf.get_objects("link")), 1)
+ self.assertEqual(len(qmf.get_objects("bridge")), 1)
+
+
class AlternateExchangePropertyTests(StoreTest):
"""
Test the persistence of the Alternate Exchange property for exchanges and queues.
Modified: store/trunk/cpp/tests/python_tests/store_test.py
===================================================================
--- store/trunk/cpp/tests/python_tests/store_test.py 2012-09-25 20:44:25 UTC (rev 4514)
+++ store/trunk/cpp/tests/python_tests/store_test.py 2012-10-05 14:33:48 UTC (rev 4515)
@@ -109,6 +109,10 @@
def queue_empty(self, queue_name):
"""Check if a queue is empty (has no messages
waiting)"""
return self.queue_message_count(queue_name) == 0
+
+ def get_objects(self, target_class,
target_package="org.apache.qpid.broker"):
+ return self.__session.getObjects(_class=target_class, _package=target_package)
+
def close(self):
self.__session.delBroker(self.__broker)
Show replies by date