diff options
author | Alan Conway <aconway@apache.org> | 2008-07-08 22:58:37 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-07-08 22:58:37 +0000 |
commit | 8c3baf496f9424249e2a666d79f0e3b38ba8d8fc (patch) | |
tree | 5fd950f023cacb47cf3cc9dc11aed91c94f380f8 /cpp/src/tests/cluster_test.cpp | |
parent | 391608a73f18a1797ab0c358f0a94364dc888eb2 (diff) | |
download | qpid-python-8c3baf496f9424249e2a666d79f0e3b38ba8d8fc.tar.gz |
HandlerChain: plug-in handler chain extension points. Replaces Handler<T>::Chain.
Updated Sessoin & Connection handler chains and Cluster.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@675017 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/cluster_test.cpp')
-rw-r--r-- | cpp/src/tests/cluster_test.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/cpp/src/tests/cluster_test.cpp b/cpp/src/tests/cluster_test.cpp index 65aa4d5a28..beab305f75 100644 --- a/cpp/src/tests/cluster_test.cpp +++ b/cpp/src/tests/cluster_test.cpp @@ -174,7 +174,7 @@ QPID_AUTO_TEST_CASE(testWiringReplication) { } } -QPID_AUTO_TEST_CASE(testMessageReplication) { +QPID_AUTO_TEST_CASE(testMessageEnqueue) { // Enqueue on one broker, dequeue on another. ClusterFixture cluster(2); Client c0(cluster[0].getPort()); @@ -190,6 +190,28 @@ QPID_AUTO_TEST_CASE(testMessageReplication) { BOOST_CHECK_EQUAL(string("bar"), msg.getData()); } -// TODO aconway 2008-06-25: dequeue replication, failover. +QPID_AUTO_TEST_CASE(testMessageDequeue) { + // Enqueue on one broker, dequeue on two others. + ClusterFixture cluster (3); + Client c0(cluster[0].getPort()); + c0.session.queueDeclare("q"); + c0.session.messageTransfer(arg::content=TransferContent("foo", "q")); + c0.session.messageTransfer(arg::content=TransferContent("bar", "q")); + c0.session.close(); + + Message msg; + + Client c1(cluster[1].getPort()); + BOOST_CHECK(c1.subs.get(msg, "q")); + BOOST_CHECK_EQUAL("foo", msg.getData()); + + Client c2(cluster[2].getPort()); + BOOST_CHECK(c1.subs.get(msg, "q")); + BOOST_CHECK_EQUAL("bar", msg.getData()); + QueueQueryResult r = c2.session.queueQuery("q"); + BOOST_CHECK_EQUAL(0, r.getMessageCount()); +} + +// TODO aconway 2008-06-25: failover. QPID_AUTO_TEST_SUITE_END() |