activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r498207 - in /incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/utils: BooleanStreamTest.cpp BooleanStreamTest.h
Date Sat, 20 Jan 2007 23:11:21 GMT
Author: tabish
Date: Sat Jan 20 15:11:20 2007
New Revision: 498207

URL: http://svn.apache.org/viewvc?view=rev&rev=498207
Log:
http://issues.apache.org/activemq/browse/AMQCPP-30

Modified:
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/utils/BooleanStreamTest.cpp
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/utils/BooleanStreamTest.h

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/utils/BooleanStreamTest.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/utils/BooleanStreamTest.cpp?view=diff&rev=498207&r1=498206&r2=498207
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/utils/BooleanStreamTest.cpp
(original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/utils/BooleanStreamTest.cpp
Sat Jan 20 15:11:20 2007
@@ -18,3 +18,81 @@
 #include "BooleanStreamTest.h"
 
 CPPUNIT_TEST_SUITE_REGISTRATION( activemq::connector::openwire::utils::BooleanStreamTest
);
+
+#include <activemq/io/ByteArrayOutputStream.h>
+#include <activemq/io/ByteArrayInputStream.h>
+#include <activemq/io/DataOutputStream.h>
+#include <activemq/io/DataInputStream.h>
+
+using namespace activemq;
+using namespace activemq::io;
+using namespace activemq::connector;
+using namespace activemq::connector::openwire;
+using namespace activemq::connector::openwire::utils;
+
+////////////////////////////////////////////////////////////////////////////////
+void BooleanStreamTest::test() {
+
+    BooleanStream b1Stream;
+
+    io::ByteArrayOutputStream baoStream;
+    io::DataOutputStream daoStream( &baoStream );
+
+    b1Stream.writeBoolean( false );
+    b1Stream.writeBoolean( true );
+    b1Stream.writeBoolean( false );
+    b1Stream.writeBoolean( false );
+    b1Stream.writeBoolean( true );
+    b1Stream.writeBoolean( false );
+    b1Stream.writeBoolean( true );
+    b1Stream.writeBoolean( true );
+    
+    b1Stream.marshal( &daoStream );
+    
+    BooleanStream b2Stream;
+    io::ByteArrayInputStream baiStream( baoStream.getByteArray(),
+                                        baoStream.getByteArraySize() );
+    io::DataInputStream daiStream( &baiStream );
+
+    b2Stream.unmarshal( &daiStream );
+    
+    CPPUNIT_ASSERT( b2Stream.readBoolean() == false );
+    CPPUNIT_ASSERT( b2Stream.readBoolean() == true );
+    CPPUNIT_ASSERT( b2Stream.readBoolean() == false );
+    CPPUNIT_ASSERT( b2Stream.readBoolean() == false );
+    CPPUNIT_ASSERT( b2Stream.readBoolean() == true );
+    CPPUNIT_ASSERT( b2Stream.readBoolean() == false );
+    CPPUNIT_ASSERT( b2Stream.readBoolean() == true );
+    CPPUNIT_ASSERT( b2Stream.readBoolean() == true );
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void BooleanStreamTest::test2(){
+
+    BooleanStream b1Stream;
+
+    io::ByteArrayOutputStream baoStream;
+    io::DataOutputStream daoStream( &baoStream );
+
+    bool value = false;
+    for( int i = 0; i < 65536; i++ ) {
+        b1Stream.writeBoolean( value );
+        value = !value;
+    }
+
+    b1Stream.marshal( &daoStream );
+    
+    BooleanStream b2Stream;
+    io::ByteArrayInputStream baiStream( baoStream.getByteArray(),
+                                        baoStream.getByteArraySize() );
+    io::DataInputStream daiStream( &baiStream );
+
+    b2Stream.unmarshal( &daiStream );
+
+    value = false;
+    for( int i = 0; i < 65536; i++ ) {
+        CPPUNIT_ASSERT( b2Stream.readBoolean() == value );
+        value = !value;
+    }
+}

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/utils/BooleanStreamTest.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/utils/BooleanStreamTest.h?view=diff&rev=498207&r1=498206&r2=498207
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/utils/BooleanStreamTest.h
(original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/utils/BooleanStreamTest.h
Sat Jan 20 15:11:20 2007
@@ -23,11 +23,6 @@
 
 #include <activemq/connector/openwire/utils/BooleanStream.h>
 
-#include <activemq/io/ByteArrayOutputStream.h>
-#include <activemq/io/ByteArrayInputStream.h>
-#include <activemq/io/DataOutputStream.h>
-#include <activemq/io/DataInputStream.h>
-
 namespace activemq{
 namespace connector{
 namespace openwire{
@@ -45,71 +40,8 @@
         BooleanStreamTest() {}
         virtual ~BooleanStreamTest() {}
         
-        void test(){
-
-            BooleanStream b1Stream;
-
-            io::ByteArrayOutputStream baoStream;
-            io::DataOutputStream daoStream( &baoStream );
-
-            b1Stream.writeBoolean( false );
-            b1Stream.writeBoolean( true );
-            b1Stream.writeBoolean( false );
-            b1Stream.writeBoolean( false );
-            b1Stream.writeBoolean( true );
-            b1Stream.writeBoolean( false );
-            b1Stream.writeBoolean( true );
-            b1Stream.writeBoolean( true );
-            
-            b1Stream.marshal( &daoStream );
-            
-            BooleanStream b2Stream;
-            io::ByteArrayInputStream baiStream( baoStream.getByteArray(),
-                                                baoStream.getByteArraySize() );
-            io::DataInputStream daiStream( &baiStream );
-
-            b2Stream.unmarshal( &daiStream );
-            
-            CPPUNIT_ASSERT( b2Stream.readBoolean() == false );
-            CPPUNIT_ASSERT( b2Stream.readBoolean() == true );
-            CPPUNIT_ASSERT( b2Stream.readBoolean() == false );
-            CPPUNIT_ASSERT( b2Stream.readBoolean() == false );
-            CPPUNIT_ASSERT( b2Stream.readBoolean() == true );
-            CPPUNIT_ASSERT( b2Stream.readBoolean() == false );
-            CPPUNIT_ASSERT( b2Stream.readBoolean() == true );
-            CPPUNIT_ASSERT( b2Stream.readBoolean() == true );
-
-        }
-
-        void test2(){
-
-            BooleanStream b1Stream;
-
-            io::ByteArrayOutputStream baoStream;
-            io::DataOutputStream daoStream( &baoStream );
-
-            bool value = false;
-            for( int i = 0; i < 65536; i++ ) {
-                b1Stream.writeBoolean( value );
-                value = !value;
-            }
-
-            b1Stream.marshal( &daoStream );
-            
-            BooleanStream b2Stream;
-            io::ByteArrayInputStream baiStream( baoStream.getByteArray(),
-                                                baoStream.getByteArraySize() );
-            io::DataInputStream daiStream( &baiStream );
-
-            b2Stream.unmarshal( &daiStream );
-
-            value = false;
-            for( int i = 0; i < 65536; i++ ) {
-                CPPUNIT_ASSERT( b2Stream.readBoolean() == value );
-                value = !value;
-            }
-        }
-
+        void test();
+        void test2();
     };
 
 }}}}



Mime
View raw message