summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/XmlClientSessionTest.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-09-08 19:23:30 +0000
committerGordon Sim <gsim@apache.org>2008-09-08 19:23:30 +0000
commite884da88a52c44e238b05b66c60136d4e83c55fb (patch)
treebcfedf0ce0fba30009ee8600f58ec8f2c3d502a1 /qpid/cpp/src/tests/XmlClientSessionTest.cpp
parent7d4317b2ff39b61f529a2e7c187238c1370cae5c (diff)
downloadqpid-python-e884da88a52c44e238b05b66c60136d4e83c55fb.tar.gz
Fixes to xml exchange:
* changed locking for QPID-1264 * allow multiple queues to be bound with the same binding key * correct log message and management stats update on route git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@693208 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/XmlClientSessionTest.cpp')
-rw-r--r--qpid/cpp/src/tests/XmlClientSessionTest.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/qpid/cpp/src/tests/XmlClientSessionTest.cpp b/qpid/cpp/src/tests/XmlClientSessionTest.cpp
index d0a1520c81..fc92a338a8 100644
--- a/qpid/cpp/src/tests/XmlClientSessionTest.cpp
+++ b/qpid/cpp/src/tests/XmlClientSessionTest.cpp
@@ -146,6 +146,36 @@ QPID_AUTO_TEST_CASE(testXmlBinding) {
BOOST_CHECK_EQUAL(m, m2.getData());
}
+/**
+ * Ensure that multiple queues can be bound using the same routing key
+ */
+QPID_AUTO_TEST_CASE(testBindMultipleQueues) {
+ ClientSessionFixture f;
+
+ f.session.exchangeDeclare(arg::exchange="xml", arg::type="xml");
+ f.session.queueDeclare(arg::queue="blue", arg::exclusive=true, arg::autoDelete=true);
+ f.session.queueDeclare(arg::queue="red", arg::exclusive=true, arg::autoDelete=true);
+
+ FieldTable blue;
+ blue.setString("xquery", "./colour = 'blue'");
+ f.session.exchangeBind(arg::exchange="xml", arg::queue="blue", arg::bindingKey="by-colour", arg::arguments=blue);
+ FieldTable red;
+ red.setString("xquery", "./colour = 'red'");
+ f.session.exchangeBind(arg::exchange="xml", arg::queue="red", arg::bindingKey="by-colour", arg::arguments=red);
+
+ Message sent1("<colour>blue</colour>", "by-colour");
+ f.session.messageTransfer(arg::content=sent1, arg::destination="xml");
+
+ Message sent2("<colour>red</colour>", "by-colour");
+ f.session.messageTransfer(arg::content=sent2, arg::destination="xml");
+
+ Message received;
+ BOOST_CHECK(f.subs.get(received, "blue"));
+ BOOST_CHECK_EQUAL(sent1.getData(), received.getData());
+ BOOST_CHECK(f.subs.get(received, "red"));
+ BOOST_CHECK_EQUAL(sent2.getData(), received.getData());
+}
+
//### Test: Bad XML does not kill the server
//### Test: Bad XQuery does not kill the server