diff options
author | Alan Conway <aconway@apache.org> | 2007-07-26 15:47:23 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2007-07-26 15:47:23 +0000 |
commit | 233cc9184c758702d8fa4a83d1bf8ec7dc0b3474 (patch) | |
tree | 6a73a6dfb117218e8fd94c8b447def68e0ab9de0 /cpp/src/tests/Cluster_child.cpp | |
parent | 89a8765ee2bac1d77be65f1011ffeeb2cbbabe2d (diff) | |
download | qpid-python-233cc9184c758702d8fa4a83d1bf8ec7dc0b3474.tar.gz |
* README: Instructions for openais install.
* configure.ac: Enable clustering if suitable openais is present.
* src/tests/Cluster.cpp, .h, Cluster_child: Updated for 0-10
* src/qpid/sys/ConcurrentQueue.h: Added waitPop()
* src/Makefile.am, src/qpid/sys/ThreadSafeQueue.h, ProducerConsumer.h:
Removed unused code, ConcurrentQueue provides same functionality.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@559859 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/Cluster_child.cpp')
-rw-r--r-- | cpp/src/tests/Cluster_child.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/cpp/src/tests/Cluster_child.cpp b/cpp/src/tests/Cluster_child.cpp index c509dc1950..fd4eb42e7b 100644 --- a/cpp/src/tests/Cluster_child.cpp +++ b/cpp/src/tests/Cluster_child.cpp @@ -20,6 +20,8 @@ #include "Cluster.h" #include "test_tools.h" +#include "qpid/framing/SessionPingBody.h" +#include "qpid/framing/SessionPongBody.h" using namespace std; using namespace qpid; @@ -33,17 +35,18 @@ static const ProtocolVersion VER; /** Chlid part of Cluster::clusterTwo test */ void clusterTwo() { TestCluster cluster("clusterTwo", "amqp:child:2"); - BOOST_REQUIRE(cluster.received.waitFor(1)); // Frame from parent. - BOOST_CHECK(cluster.received[0].isIncoming); - BOOST_CHECK_TYPEID_EQUAL(ChannelPingBody, *cluster.received[0].frame.getBody()); + SessionFrame sf; + BOOST_REQUIRE(cluster.received.waitPop(sf)); // Frame from parent. + BOOST_CHECK(sf.isIncoming); + BOOST_CHECK_TYPEID_EQUAL(SessionPingBody, *sf.frame.getBody()); BOOST_CHECK_EQUAL(2u, cluster.size()); // Me and parent - AMQFrame frame(VER, 1, new ChannelOkBody(VER)); - SessionFrame sf(cluster.received[0].uuid, frame, false); - cluster.handle(sf); - BOOST_REQUIRE(cluster.received.waitFor(2)); - BOOST_CHECK(!cluster.received[1].isIncoming); - BOOST_CHECK_TYPEID_EQUAL(ChannelOkBody, *cluster.received[1].frame.getBody()); + AMQFrame frame(VER, 1, new SessionPongBody(VER)); + SessionFrame sendframe(sf.uuid, frame, false); + cluster.handle(sendframe); + BOOST_REQUIRE(cluster.received.waitPop(sf)); + BOOST_CHECK(!sf.isIncoming); + BOOST_CHECK_TYPEID_EQUAL(SessionPongBody, *sf.frame.getBody()); } int test_main(int, char**) { |