summaryrefslogtreecommitdiff
path: root/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
commit7feb5546e82e0d003f26027524ceb07e9b9b0452 (patch)
tree56cb4030dbd85911562f5486642343c1a60329fe /cpp/src/tests/XmlClientSessionTest.cpp
parent763b1172569f9d9f10ea6f1cbe4d519deee61ea6 (diff)
downloadqpid-python-7feb5546e82e0d003f26027524ceb07e9b9b0452.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/qpid@693208 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/XmlClientSessionTest.cpp')
-rw-r--r--cpp/src/tests/XmlClientSessionTest.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/cpp/src/tests/XmlClientSessionTest.cpp b/cpp/src/tests/XmlClientSessionTest.cpp
index d0a1520c81..fc92a338a8 100644
--- a/cpp/src/tests/XmlClientSessionTest.cpp
+++ b/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