summaryrefslogtreecommitdiff
path: root/qpid/tests
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2014-05-14 16:25:12 +0000
committerGordon Sim <gsim@apache.org>2014-05-14 16:25:12 +0000
commitef5392fe1f9df62f348c06cec47f71d8983d5e86 (patch)
tree6616073185a466bbf0696164b306392df6a531ab /qpid/tests
parent3b8cb11a904b9c1f4a808c29fd37121a4e3e7c43 (diff)
downloadqpid-python-ef5392fe1f9df62f348c06cec47f71d8983d5e86.tar.gz
QPID-5765: don't invoke on dangling pointer
Strictly speaking comparing anything against the old pointer isn't correct either, but this is harder to change and the only negative effect is that in the event that a new connection has the same pointer value, it would be incorrectly interpreted as 'local'. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1594633 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/tests')
-rw-r--r--qpid/tests/src/py/qpid_tests/broker_0_10/new_api.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/qpid/tests/src/py/qpid_tests/broker_0_10/new_api.py b/qpid/tests/src/py/qpid_tests/broker_0_10/new_api.py
index 4140307266..282b23c1c7 100644
--- a/qpid/tests/src/py/qpid_tests/broker_0_10/new_api.py
+++ b/qpid/tests/src/py/qpid_tests/broker_0_10/new_api.py
@@ -149,6 +149,35 @@ class GeneralTests(Base):
expected.remove(c)
self.ssn.acknowledge()
+ def test_nolocal_rerouted(self):
+ conn2 = Connection.establish(self.broker, **self.connection_options())
+ ssn2 = conn2.session()
+
+ s1 = self.ssn.sender("holding_q; {create:always, delete:always, node:{x-declare:{alternate-exchange:'amq.fanout'}}}");
+ s2 = ssn2.sender("holding_q");
+
+ s2.send(Message("a"));
+ s1.send(Message("b"));
+ s2.send(Message("c"));
+
+ r = self.ssn.receiver("amq.fanout; {link:{x-declare:{arguments:{'no-local':True}}}}")
+
+ # close connection of one of the publishers
+ conn2.close()
+
+ # close sender which should cause the orphaned messages on
+ # holding_q to be rerouted through alternate exchange onto the
+ # subscription queue of the receiver above
+ s1.close()
+
+ received = []
+ try:
+ while True:
+ received.append(r.fetch(0).content)
+ except Empty: pass
+ self.assertEqual(received, ["a", "c"])
+
+
class SequenceNumberTests(Base):
"""
Tests of ring queue sequence number