You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by sh...@apache.org on 2013/06/06 19:22:33 UTC
svn commit: r1490365 - /qpid/trunk/qpid/cpp/src/tests/store.py
Author: shuston
Date: Thu Jun 6 17:22:33 2013
New Revision: 1490365
URL: http://svn.apache.org/r1490365
Log:
Add a test for recovering a message with 0-length body. NO-JIRA.
Modified:
qpid/trunk/qpid/cpp/src/tests/store.py
Modified: qpid/trunk/qpid/cpp/src/tests/store.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/store.py?rev=1490365&r1=1490364&r2=1490365&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/store.py (original)
+++ qpid/trunk/qpid/cpp/src/tests/store.py Thu Jun 6 17:22:33 2013
@@ -127,6 +127,12 @@ class StoreTests(BrokerTest):
self.ssn.exchange_declare(exchange="DB_E1", type="direct", durable=True)
self.ssn.exchange_bind(exchange="DB_E1", queue="DB_Q1", binding_key="K1")
+ # Queue up 2 messages, one with non-zero body, one with zero-length.
+ # 2 = delivery_mode.persistent
+ dp = self.ssn.delivery_properties(routing_key="DB_Q1", delivery_mode=2)
+ self.ssn.message_transfer(message=Message(dp, "normal message"))
+ self.ssn.message_transfer(message=Message(dp, ""))
+
# Cycle the broker and make sure the binding recovers
self.cycle_broker()
response = self.ssn.exchange_bound(exchange="DB_E1", queue="DB_Q1", binding_key="K1")
@@ -135,6 +141,17 @@ class StoreTests(BrokerTest):
self.assert_(not response.queue_not_matched)
self.assert_(not response.key_not_matched)
+ # Are the messages still there?
+ self.ssn.message_subscribe(destination="msgs", queue="DB_Q1", accept_mode=1, acquire_mode=0)
+ self.ssn.message_flow(unit = 1, value = 0xFFFFFFFFL, destination = "msgs")
+ self.ssn.message_flow(unit = 0, value = 10, destination = "msgs")
+ message_arrivals = self.ssn.incoming("msgs")
+ try:
+ message_arrivals.get(timeout=1)
+ message_arrivals.get(timeout=1)
+ except Empty:
+ assert False, 'Durable message(s) not recovered'
+
self.ssn.exchange_unbind(queue="DB_Q1", exchange="DB_E1", binding_key="K1")
self.ssn.exchange_delete(exchange="DB_E1")
self.ssn.queue_delete(queue="DB_Q1")
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org