activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r503441 - /activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/commands/ActiveMQBytesMessageTest.cpp
Date Sun, 04 Feb 2007 17:02:09 GMT
Author: tabish
Date: Sun Feb  4 09:02:09 2007
New Revision: 503441

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

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/commands/ActiveMQBytesMessageTest.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/commands/ActiveMQBytesMessageTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/commands/ActiveMQBytesMessageTest.cpp?view=diff&rev=503441&r1=503440&r2=503441
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/commands/ActiveMQBytesMessageTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/connector/openwire/commands/ActiveMQBytesMessageTest.cpp
Sun Feb  4 09:02:09 2007
@@ -34,4 +34,30 @@
 void ActiveMQBytesMessageTest::test()
 {
     ActiveMQBytesMessage myMessage;
+
+    CPPUNIT_ASSERT( myMessage.getDataStructureType() == ActiveMQBytesMessage::ID_ACTIVEMQBYTESMESSAGE
);
+
+    // Write some data
+    myMessage.writeBoolean( false );
+    myMessage.writeByte( 127 );
+    myMessage.writeShort( 32767 );
+    myMessage.writeDouble( 0.5622154 );
+    myMessage.writeDouble( 1.012 );
+    myMessage.writeFloat( 10.000005f );
+    
+    CPPUNIT_ASSERT( myMessage.getBodyLength() != 0 );
+
+    // Get ready to read
+    myMessage.reset();
+    
+    CPPUNIT_ASSERT( myMessage.readBoolean() == false );
+    CPPUNIT_ASSERT( myMessage.readByte() == 127 );
+    CPPUNIT_ASSERT( myMessage.readShort() == 32767 );
+    CPPUNIT_ASSERT( myMessage.readDouble() == 0.5622154 );
+    CPPUNIT_ASSERT( myMessage.readDouble() == 1.012 );
+    CPPUNIT_ASSERT( myMessage.readFloat() == 10.000005f );
+    
+    myMessage.clearBody();
+    
+    CPPUNIT_ASSERT( myMessage.getBodyLength() == 0 );
 }



Mime
View raw message