summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/Cluster_child.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-07-02 22:35:33 +0000
committerAlan Conway <aconway@apache.org>2007-07-02 22:35:33 +0000
commiteb7f88e2818ddb98bc02ff7fc39c936d421d16d8 (patch)
treebd50d2cae9f686436513620f50eecfeac06d5585 /qpid/cpp/src/tests/Cluster_child.cpp
parent8380592eddec548cf70bc63cd43be886ea68a57f (diff)
downloadqpid-python-eb7f88e2818ddb98bc02ff7fc39c936d421d16d8.tar.gz
2007-06-30 <aconway@redhat.com>
* src/qpid/cluster/Cluster.cpp: Refactor - expose 4 handler points for all traffic to/from cluster. Removed HandlerUpdater functionality, separate class. Cluster only deals with membership and connecting the 4 handler points to CPG multicast. * src/tests/cluster.mk: Dropped newgrp ais wrapper scripts, its much simpler if the user just does "newgrp ais" before building. * src/tests/ais_check: Test script to check if users gid is ais and give clear notice if not. * src/tests/Cluster.cpp: Updated for changes to Cluster. * src/qpid/cluster/Cpg.cpp: Better messages for common errors. * Handler.h: Remove nextHandler() minor convenience is outweighted by risk of undetected errors if handlers that expect next() to be set are called when it's not set. * src/qpid/cluster/Cpg.cpp: Added logging. Replaced boost::function with traditional virtual interface (nasty stack traces.) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@552614 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/Cluster_child.cpp')
-rw-r--r--qpid/cpp/src/tests/Cluster_child.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/qpid/cpp/src/tests/Cluster_child.cpp b/qpid/cpp/src/tests/Cluster_child.cpp
index a5ac3e9669..d73d2bdbc7 100644
--- a/qpid/cpp/src/tests/Cluster_child.cpp
+++ b/qpid/cpp/src/tests/Cluster_child.cpp
@@ -26,20 +26,20 @@ using namespace qpid;
using namespace qpid::cluster;
using namespace qpid::framing;
using namespace qpid::sys;
-
+using namespace qpid::log;
static const ProtocolVersion VER;
/** Chlid part of Cluster::clusterTwo test */
void clusterTwo() {
- Cluster cluster("Test", "amqp::2");
- TestClusterHandler handler(cluster);
- BOOST_REQUIRE(handler.waitFrames(1));
- BOOST_CHECK_TYPEID_EQUAL(ChannelOkBody, *handler[0].getBody());
- AMQFrame frame(VER, 1, new BasicGetOkBody(VER));
- cluster.handle(frame);
- BOOST_REQUIRE(handler.waitFrames(2));
- BOOST_CHECK_TYPEID_EQUAL(BasicGetOkBody, *handler[1].getBody());
+ TestCluster cluster("clusterTwo", "amqp::2");
+ BOOST_REQUIRE(cluster.in.waitFor(1)); // Frame from parent.
+ BOOST_CHECK_TYPEID_EQUAL(ChannelPingBody, *cluster.in[0].getBody());
+ BOOST_CHECK_EQUAL(2u, cluster.size()); // Me and parent
+ AMQFrame frame(VER, 1, new ChannelOkBody(VER));
+ cluster.getToChains().out->handle(frame);
+ BOOST_REQUIRE(cluster.out.waitFor(1));
+ BOOST_CHECK_TYPEID_EQUAL(ChannelOkBody, *cluster.out[0].getBody());
}
int test_main(int, char**) {