activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r986673 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test: MapMessageTest.cpp MapMessageTest.h openwire/OpenwireMapMessageTest.h
Date Wed, 18 Aug 2010 13:44:59 GMT
Author: tabish
Date: Wed Aug 18 13:44:58 2010
New Revision: 986673

URL: http://svn.apache.org/viewvc?rev=986673&view=rev
Log:
Add additional test for Map setBytes called with empty vector

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/MapMessageTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/MapMessageTest.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireMapMessageTest.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/MapMessageTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/MapMessageTest.cpp?rev=986673&r1=986672&r2=986673&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/MapMessageTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/MapMessageTest.cpp
Wed Aug 18 13:44:58 2010
@@ -92,3 +92,30 @@ void MapMessageTest::testMapWithEmptyStr
     CPPUNIT_ASSERT( recvMapMessage->itemExists( "String3" ) == false );
     CPPUNIT_ASSERT( recvMapMessage->getString( "String2" ) == string( "value" ) );
 }
+
+////////////////////////////////////////////////////////////////////////////////
+void MapMessageTest::testMapSetEmptyBytesVector() {
+
+    // Create CMS Object for Comms
+    cms::Session* session( cmsProvider->getSession() );
+    cms::MessageConsumer* consumer = cmsProvider->getConsumer();
+    cms::MessageProducer* producer = cmsProvider->getProducer();
+    producer->setDeliveryMode( DeliveryMode::NON_PERSISTENT );
+
+    auto_ptr<cms::MapMessage> mapMessage( session->createMapMessage() );
+
+    std::vector<unsigned char> bytes;
+
+    mapMessage->setBytes( "BYTES", bytes );
+
+    // Send some text messages
+    producer->send( mapMessage.get() );
+
+    auto_ptr<cms::Message> message( consumer->receive( 2000 ) );
+    CPPUNIT_ASSERT( message.get() != NULL );
+
+    cms::MapMessage* recvMapMessage = dynamic_cast<MapMessage*>( message.get() );
+    CPPUNIT_ASSERT( recvMapMessage != NULL );
+    CPPUNIT_ASSERT( recvMapMessage->itemExists( "BYTES" ) == true );
+    CPPUNIT_ASSERT( recvMapMessage->getBytes( "BYTES" ).empty() == true );
+}

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/MapMessageTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/MapMessageTest.h?rev=986673&r1=986672&r2=986673&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/MapMessageTest.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/MapMessageTest.h
Wed Aug 18 13:44:58 2010
@@ -32,6 +32,7 @@ namespace test {
 
         void testEmptyMapSendReceive();
         void testMapWithEmptyStringValue();
+        void testMapSetEmptyBytesVector();
 
     };
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireMapMessageTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireMapMessageTest.h?rev=986673&r1=986672&r2=986673&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireMapMessageTest.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireMapMessageTest.h
Wed Aug 18 13:44:58 2010
@@ -30,6 +30,7 @@ namespace openwire {
         CPPUNIT_TEST_SUITE( OpenwireMapMessageTest );
         CPPUNIT_TEST( testEmptyMapSendReceive );
         CPPUNIT_TEST( testMapWithEmptyStringValue );
+        CPPUNIT_TEST( testMapSetEmptyBytesVector );
         CPPUNIT_TEST_SUITE_END();
 
     public:



Mime
View raw message