activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r967243 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test: MapMessageTest.cpp MapMessageTest.h openwire/OpenwireMapMessageTest.h
Date Fri, 23 Jul 2010 20:19:28 GMT
Author: tabish
Date: Fri Jul 23 20:19:27 2010
New Revision: 967243

URL: http://svn.apache.org/viewvc?rev=967243&view=rev
Log:
Add a test for the send of a MapMessage with an empty string in the values.

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=967243&r1=967242&r2=967243&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
Fri Jul 23 20:19:27 2010
@@ -63,3 +63,31 @@ void MapMessageTest::testEmptyMapSendRec
     CPPUNIT_ASSERT( recvMapMessage != NULL );
     CPPUNIT_ASSERT( recvMapMessage->itemExists( "SomeKey" ) == false );
 }
+
+////////////////////////////////////////////////////////////////////////////////
+void MapMessageTest::testMapWithEmptyStringValue() {
+
+    // 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() );
+
+    mapMessage->setString("String1", "");
+    mapMessage->setString("String2", "value");
+
+    // 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( "String1" ) == true );
+    CPPUNIT_ASSERT( recvMapMessage->itemExists( "String2" ) == true );
+    CPPUNIT_ASSERT( recvMapMessage->itemExists( "String3" ) == false );
+    CPPUNIT_ASSERT( recvMapMessage->getString( "String2" ) == string( "value" ) );
+}

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=967243&r1=967242&r2=967243&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
Fri Jul 23 20:19:27 2010
@@ -31,6 +31,7 @@ namespace test {
         virtual ~MapMessageTest();
 
         void testEmptyMapSendReceive();
+        void testMapWithEmptyStringValue();
 
     };
 

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=967243&r1=967242&r2=967243&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
Fri Jul 23 20:19:27 2010
@@ -29,6 +29,7 @@ namespace openwire {
 
         CPPUNIT_TEST_SUITE( OpenwireMapMessageTest );
         CPPUNIT_TEST( testEmptyMapSendReceive );
+        CPPUNIT_TEST( testMapWithEmptyStringValue );
         CPPUNIT_TEST_SUITE_END();
 
     public:



Mime
View raw message