Author: aconway
Date: Fri Jul 27 12:27:43 2007
New Revision: 560356

URL: http://svn.apache.org/viewvc?view=rev&rev=560356
Log:
Drop SessionFrame, UUID is not required and more efficient to transmit plain
AMQFrames.

Modified:
    incubator/qpid/trunk/qpid/cpp/src/tests/Cluster.cpp
    incubator/qpid/trunk/qpid/cpp/src/tests/Cluster.h
    incubator/qpid/trunk/qpid/cpp/src/tests/Cluster_child.cpp
    incubator/qpid/trunk/qpid/cpp/src/tests/ais_check

Modified: incubator/qpid/trunk/qpid/cpp/src/tests/Cluster.cpp
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/Cluster.cpp?view=diff&rev=560356&r1=560355&r2=560356
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/Cluster.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/Cluster.cpp Fri Jul 27 12:27:43 2007
@@ -33,17 +33,11 @@
 /** Verify membership in a cluster with one member. */
 BOOST_AUTO_TEST_CASE(testClusterOne) {
     TestCluster cluster("clusterOne", "amqp:one:1");
-    AMQFrame frame(VER, 1, new SessionPingBody(VER));
-    Uuid id(true);
-    SessionFrame send(id, frame, true);
+    AMQFrame send(VER, 1, new SessionPingBody(VER));
     cluster.handle(send);
-    SessionFrame sf;
-    BOOST_REQUIRE(cluster.received.waitPop(sf));
-
-    BOOST_CHECK(sf.isIncoming);
-    BOOST_CHECK_EQUAL(id, sf.uuid);
-    BOOST_CHECK_TYPEID_EQUAL(SessionPingBody, *sf.frame.getBody());
-    
+    AMQFrame received;
+    BOOST_REQUIRE(cluster.received.waitPop(received));
+    BOOST_CHECK_TYPEID_EQUAL(SessionPingBody, *received.getBody());
     BOOST_CHECK_EQUAL(1u, cluster.size());
     Cluster::MemberList members = cluster.getMembers();
     BOOST_CHECK_EQUAL(1u, members.size());
@@ -65,18 +59,14 @@
         BOOST_REQUIRE(cluster.waitFor(2)); // Myself and child.
 
         // Exchange frames with child.
-        AMQFrame frame(VER, 1, new SessionPingBody(VER));
-        Uuid id(true);
-        SessionFrame send(id, frame, true);
+        AMQFrame send(VER, 1, new SessionPingBody(VER));
         cluster.handle(send);
-        SessionFrame sf;
-        BOOST_REQUIRE(cluster.received.waitPop(sf));
-        BOOST_CHECK_EQUAL(id, sf.uuid);
-        BOOST_CHECK(sf.isIncoming);
-        BOOST_CHECK_TYPEID_EQUAL(SessionPingBody, *sf.frame.getBody());
+        AMQFrame received;
+        BOOST_REQUIRE(cluster.received.waitPop(received));
+        BOOST_CHECK_TYPEID_EQUAL(SessionPingBody, *received.getBody());
         
-        BOOST_REQUIRE(cluster.received.waitPop(sf));
-        BOOST_CHECK_TYPEID_EQUAL(SessionPongBody, *sf.frame.getBody());
+        BOOST_REQUIRE(cluster.received.waitPop(received));
+        BOOST_CHECK_TYPEID_EQUAL(SessionPongBody, *received.getBody());
 
         if (!nofork) {
             // Wait for child to exit.

Modified: incubator/qpid/trunk/qpid/cpp/src/tests/Cluster.h
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/Cluster.h?view=diff&rev=560356&r1=560355&r2=560356
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/Cluster.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/Cluster.h Fri Jul 27 12:27:43 2007
@@ -54,7 +54,6 @@
 };
 
 typedef TestHandler<AMQFrame> TestFrameHandler;
-typedef TestHandler<SessionFrame> TestSessionFrameHandler;
 
 void nullDeleter(void*) {}
 
@@ -70,7 +69,7 @@
                         equal_to<size_t>(), bind(&Cluster::size,this), n));
     }
 
-    TestSessionFrameHandler received;
+    TestFrameHandler received;
 };
 
 

Modified: incubator/qpid/trunk/qpid/cpp/src/tests/Cluster_child.cpp
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/Cluster_child.cpp?view=diff&rev=560356&r1=560355&r2=560356
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/Cluster_child.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/Cluster_child.cpp Fri Jul 27 
12:27:43 2007
@@ -35,18 +35,15 @@
 /** Chlid part of Cluster::clusterTwo test */
 void clusterTwo() {
     TestCluster cluster("clusterTwo", "amqp:child:2");
-    SessionFrame sf;
-    BOOST_REQUIRE(cluster.received.waitPop(sf)); // Frame from parent.
-    BOOST_CHECK(sf.isIncoming);
-    BOOST_CHECK_TYPEID_EQUAL(SessionPingBody, *sf.frame.getBody());
+    AMQFrame frame;
+    BOOST_REQUIRE(cluster.received.waitPop(frame)); // Frame from parent.
+    BOOST_CHECK_TYPEID_EQUAL(SessionPingBody, *frame.getBody());
     BOOST_CHECK_EQUAL(2u, cluster.size()); // Me and parent
 
-    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());
+    AMQFrame send(VER, 1, new SessionPongBody(VER));
+    cluster.handle(send);
+    BOOST_REQUIRE(cluster.received.waitPop(frame));
+    BOOST_CHECK_TYPEID_EQUAL(SessionPongBody, *frame.getBody());
 } 
 
 int test_main(int, char**) {

Modified: incubator/qpid/trunk/qpid/cpp/src/tests/ais_check
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/ais_check?view=diff&rev=560356&r1=560355&r2=560356
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/ais_check (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/ais_check Fri Jul 27 12:27:43 2007
@@ -3,7 +3,7 @@
 #
 
 test `id -ng` = "ais" || BADGROUP=yes
-ps -u root | grep aisexec > /dev/null 2>&1 || NOAISEXEC=yes
+{ ps -u root | grep aisexec >/dev/null; } || NOAISEXEC=yes
 
 if test -n "$BADGROUP" -o -n "$NOAISEXEC"; then
     cat <<EOF
@@ -14,12 +14,12 @@
     will not be run because:
 
 EOF
-    test -n"$BADGROUP" || cat <<EOF
+    test -n "$BADGROUP" && cat <<EOF
     You do not appear to have you group ID set to "ais". Make ais your
     primary group, or run "newgrp ais" before running the tests.
 
 EOF
-    test -n "$NOAISEXEC" || cat <<EOF    
+    test -n "$NOAISEXEC" && cat <<EOF    
     The aisexec daemon is not running. Make sure /etc/ais/openais.conf
     is a valid configuration and aisexec is run by root.
 EOF


Reply via email to