diff options
author | Alan Conway <aconway@apache.org> | 2007-07-05 16:08:29 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2007-07-05 16:08:29 +0000 |
commit | 0865408d7fa16f913391ed9391fb13268a74d8a1 (patch) | |
tree | 3107946aae1031a960bc68921a33c9708c8bea53 /cpp/src/tests/Cluster.cpp | |
parent | 4e60e87b604f8959907a329a36264f98debc9536 (diff) | |
download | qpid-python-0865408d7fa16f913391ed9391fb13268a74d8a1.tar.gz |
* src/qpid/cluster/SessionFrame.cpp, .h: Wrap AMQFrame with
session UUID and direction.
* src/qpid/cluster/Cluster.cpp, .h: Use SessionFrame.
* src/qpid/framing/AMQFrame.h, .cpp: Added setBody(), inline getBody()
* src/qpid/framing/Uuid.h, .cpp: Clean up constructors, inline.
* src/qpid/framing/Buffer.h: Put/get byte*, size_T.
* src/qpid/cluster/SessionManager.cpp, .h:
- Maintain the session map.
- Handle frames from cluster, dispatch to proper channels.
- Implement HandlerUpdater for new channels and maintains
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@553543 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/Cluster.cpp')
-rw-r--r-- | cpp/src/tests/Cluster.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/cpp/src/tests/Cluster.cpp b/cpp/src/tests/Cluster.cpp index ccc1b52249..2e6d9ecfff 100644 --- a/cpp/src/tests/Cluster.cpp +++ b/cpp/src/tests/Cluster.cpp @@ -36,10 +36,13 @@ using namespace qpid::log; BOOST_AUTO_TEST_CASE(testClusterOne) { TestCluster cluster("clusterOne", "amqp:one:1"); AMQFrame frame(VER, 1, new ChannelPingBody(VER)); - cluster.getToChains().in->handle(frame); - BOOST_REQUIRE(cluster.in.waitFor(1)); + cluster.getSendChains().in->handle(frame); + BOOST_REQUIRE(cluster.received.waitFor(1)); - BOOST_CHECK_TYPEID_EQUAL(ChannelPingBody, *cluster.in[0].getBody()); + SessionFrame& sf=cluster.received[0]; + BOOST_CHECK(sf.isIncoming); + BOOST_CHECK_TYPEID_EQUAL(ChannelPingBody, *sf.frame.getBody()); + BOOST_CHECK_EQUAL(1u, cluster.size()); Cluster::MemberList members = cluster.getMembers(); BOOST_CHECK_EQUAL(1u, members.size()); @@ -57,11 +60,13 @@ BOOST_AUTO_TEST_CASE(testClusterTwo) { // Exchange frames with child. AMQFrame frame(VER, 1, new ChannelPingBody(VER)); - cluster.getToChains().in->handle(frame); - BOOST_REQUIRE(cluster.in.waitFor(1)); - BOOST_CHECK_TYPEID_EQUAL(ChannelPingBody, *cluster.in[0].getBody()); - BOOST_REQUIRE(cluster.out.waitFor(1)); - BOOST_CHECK_TYPEID_EQUAL(ChannelOkBody, *cluster.out[0].getBody()); + cluster.getSendChains().in->handle(frame); + BOOST_REQUIRE(cluster.received.waitFor(1)); + SessionFrame& sf=cluster.received[0]; + BOOST_CHECK(sf.isIncoming); + BOOST_CHECK_TYPEID_EQUAL(ChannelPingBody, *sf.frame.getBody()); + BOOST_REQUIRE(cluster.received.waitFor(2)); + BOOST_CHECK_TYPEID_EQUAL(ChannelOkBody, *cluster.received[1].frame.getBody()); // Wait for child to exit. int status; @@ -99,3 +104,4 @@ BOOST_AUTO_TEST_CASE(testClassifierHandlerWiring) { BOOST_CHECK_EQUAL(1u, other->count); } + |