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 | f8903ef9bf3767041bb3a8437c8423ea984e5893 (patch) | |
| tree | 4d350dfd5d525b14973f193053a2e8cf1ee150b4 /qpid/cpp/src/tests/Cluster.cpp | |
| parent | 90a3700bc22ee8edbc98431da50e55a8bf8c14b0 (diff) | |
| download | qpid-python-f8903ef9bf3767041bb3a8437c8423ea984e5893.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@553543 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/Cluster.cpp')
| -rw-r--r-- | qpid/cpp/src/tests/Cluster.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/qpid/cpp/src/tests/Cluster.cpp b/qpid/cpp/src/tests/Cluster.cpp index ccc1b52249..2e6d9ecfff 100644 --- a/qpid/cpp/src/tests/Cluster.cpp +++ b/qpid/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); } + |
