Author: jonathan.robie
Date: 2010-09-28 09:01:23 -0400 (Tue, 28 Sep 2010)
New Revision: 4354
Modified:
store/trunk/cpp/tests/python_tests/client_persistence.py
Log:
Added test to make sure that rejected messages are also dequeued, and will not reappear on
broker restart.
This is a test for Bug 621468.
Modified: store/trunk/cpp/tests/python_tests/client_persistence.py
===================================================================
--- store/trunk/cpp/tests/python_tests/client_persistence.py 2010-09-28 12:38:47 UTC (rev
4353)
+++ store/trunk/cpp/tests/python_tests/client_persistence.py 2010-09-28 13:01:23 UTC (rev
4354)
@@ -23,8 +23,7 @@
from qpid.brokertest import EXPECT_EXIT_OK
from store_test import StoreTest, Qmf, store_args
-from qpid.messaging import Message
-
+from qpid.messaging import *
class ExchangeQueueTests(StoreTest):
"""
@@ -116,9 +115,25 @@
self.check_messages(broker, "q1", [msg1, msg2], True)
self.check_messages(broker, "q2", [msg1, msg2], True)
self.check_messages(broker, "q3", [msg1, msg2], True)
+
+
+ def test_message_reject(self):
+ broker = self.broker(store_args(), name="test_message_reject",
expect=EXPECT_EXIT_OK)
+ ssn = broker.connect().session()
+ snd = ssn.sender("tmr; {create:always, node:{type:queue,
durable:True}}")
+ rcv = ssn.receiver("tmr; {create:always, node:{type:queue,
durable:True}}")
+ m1 = Message("test_message_reject", durable=True,
correlation_id="Msg0001")
+ snd.send(m1)
+ m2 = rcv.fetch()
+ ssn.acknowledge(message=m2, disposition=Disposition(REJECTED))
+ broker.terminate()
+
+ broker = self.broker(store_args(), name="test_message_reject")
+ qmf = Qmf(broker)
+ assert qmf.queue_message_count("tmr") == 0
-class AlternateExchagePropertyTests(StoreTest):
+class AlternateExchangePropertyTests(StoreTest):
"""
Test the persistence of the Alternate Exchange property for exchanges and queues.
"""