activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r662078 - in /activemq/activemq-cpp/trunk/src/test/activemq/util: PrimitiveListTest.cpp PrimitiveListTest.h
Date Sat, 31 May 2008 20:36:02 GMT
Author: tabish
Date: Sat May 31 13:36:01 2008
New Revision: 662078

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

Modified:
    activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveListTest.cpp
    activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveListTest.h

Modified: activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveListTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveListTest.cpp?rev=662078&r1=662077&r2=662078&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveListTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveListTest.cpp Sat May 31 13:36:01
2008
@@ -18,6 +18,7 @@
 #include "PrimitiveListTest.h"
 
 #include <activemq/util/PrimitiveValueNode.h>
+#include <activemq/util/PrimitiveMap.h>
 
 using namespace activemq;
 using namespace activemq::util;
@@ -260,3 +261,45 @@
     plist.remove( PrimitiveValueNode(5) );
     CPPUNIT_ASSERT( plist.contains( 5 ) == false );
 }
+
+void PrimitiveListTest::testListOfLists() {
+
+    PrimitiveList list;
+    PrimitiveList sublist1;
+    PrimitiveList sublist2;
+    PrimitiveList sublist3;
+
+    sublist1.add( 1 );
+    sublist2.add( 2 );
+    sublist3.add( 3 );
+
+    list.add( sublist1 );
+    list.add( sublist2 );
+    list.add( sublist3 );
+
+    CPPUNIT_ASSERT( list.get(0).getList().get(0).getInt() == 1 );
+    CPPUNIT_ASSERT( list.get(1).getList().get(0).getInt() == 2 );
+    CPPUNIT_ASSERT( list.get(2).getList().get(0).getInt() == 3 );
+
+}
+
+void PrimitiveListTest::testListOfMaps() {
+
+    PrimitiveList list;
+    PrimitiveMap map1;
+    PrimitiveMap map2;
+    PrimitiveMap map3;
+
+    map1.setInt( "1", 1 );
+    map2.setInt( "2", 2 );
+    map3.setInt( "3", 3 );
+
+    list.add( map1 );
+    list.add( map2 );
+    list.add( map3 );
+
+    CPPUNIT_ASSERT( list.get(0).getMap().getValue("1").getInt() == 1 );
+    CPPUNIT_ASSERT( list.get(1).getMap().getValue("2").getInt() == 2 );
+    CPPUNIT_ASSERT( list.get(2).getMap().getValue("3").getInt() == 3 );
+
+}

Modified: activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveListTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveListTest.h?rev=662078&r1=662077&r2=662078&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveListTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveListTest.h Sat May 31 13:36:01
2008
@@ -36,6 +36,8 @@
         CPPUNIT_TEST( testClear );
         CPPUNIT_TEST( testCopy );
         CPPUNIT_TEST( testContains );
+        CPPUNIT_TEST( testListOfLists );
+        CPPUNIT_TEST( testListOfMaps );
         CPPUNIT_TEST_SUITE_END();
 
     public:
@@ -51,6 +53,9 @@
         void testCopy();
         void testClear();
         void testContains();
+        void testListOfLists();
+        void testListOfMaps();
+
     };
 
 }}



Mime
View raw message