summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKenneth Anthony Giusti <kgiusti@apache.org>2012-02-02 23:46:35 +0000
committerKenneth Anthony Giusti <kgiusti@apache.org>2012-02-02 23:46:35 +0000
commit5e8ccd2a9ab02c167d96b61bc85af3949351dd22 (patch)
treefa9acd0f1195f3615e7e1ac5694b9320d86646d8 /tests
parentc73814f2a538edbef14369964a66dd36d6241996 (diff)
downloadqpid-python-5e8ccd2a9ab02c167d96b61bc85af3949351dd22.tar.gz
QPID-3804: do not skip released grouped messages
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1239939 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'tests')
-rw-r--r--tests/src/py/qpid_tests/broker_0_10/msg_groups.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/src/py/qpid_tests/broker_0_10/msg_groups.py b/tests/src/py/qpid_tests/broker_0_10/msg_groups.py
index 99d11151e8..4d6d77a46f 100644
--- a/tests/src/py/qpid_tests/broker_0_10/msg_groups.py
+++ b/tests/src/py/qpid_tests/broker_0_10/msg_groups.py
@@ -1068,6 +1068,55 @@ class MultiConsumerMsgGroupTests(Base):
self.qmf_session.delBroker(self.qmf_broker)
+ def test_transaction_order(self):
+ """ Verify that rollback does not reorder the messages with respect to
+ the consumer (QPID-3804)
+ """
+ snd = self.ssn.sender("msg-group-q; {create:always, delete:sender," +
+ " node: {x-declare: {arguments:" +
+ " {'qpid.group_header_key':'THE-GROUP'," +
+ "'qpid.shared_msg_group':1}}}}")
+
+ groups = ["A","B","A"]
+ messages = [Message(content={}, properties={"THE-GROUP": g}) for g in groups]
+ index = 0
+ for m in messages:
+ m.content['index'] = index
+ index += 1
+ snd.send(m)
+
+ s1 = self.conn.session(transactional=True)
+ c1 = s1.receiver("msg-group-q", options={"capacity":0})
+
+ # C1 gets group A
+ m1 = c1.fetch(0)
+ assert m1.properties['THE-GROUP'] == 'A'
+ assert m1.content['index'] == 0
+ s1.acknowledge(m1)
+
+ s1.rollback() # release A back to the queue
+
+ # the order should be preserved as follows:
+
+ m1 = c1.fetch(0)
+ assert m1.properties['THE-GROUP'] == 'A'
+ assert m1.content['index'] == 0
+
+ m2 = c1.fetch(0)
+ assert m2.properties['THE-GROUP'] == 'B'
+ assert m2.content['index'] == 1
+
+ m3 = c1.fetch(0)
+ assert m3.properties['THE-GROUP'] == 'A'
+ assert m3.content['index'] == 2
+
+ s1.commit()
+
+ c1.close()
+ s1.close()
+ snd.close()
+
+
class StickyConsumerMsgGroupTests(Base):
"""
Tests for the behavior of sticky-consumer message groups. These tests