activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r507330 - /activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveMapTest.cpp
Date Wed, 14 Feb 2007 00:21:19 GMT
Author: tabish
Date: Tue Feb 13 16:21:18 2007
New Revision: 507330

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

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveMapTest.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveMapTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveMapTest.cpp?view=diff&rev=507330&r1=507329&r2=507330
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveMapTest.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveMapTest.cpp Tue
Feb 13 16:21:18 2007
@@ -19,47 +19,47 @@
 
 CPPUNIT_TEST_SUITE_REGISTRATION( activemq::util::PrimitiveMapTest );
 
-using namespace activemq::util; 
+using namespace activemq::util;
 
 void PrimitiveMapTest::testValueNode(){
-    
+
     PrimitiveMap::ValueNode node;
-    
+
     node.setBool( true );
     CPPUNIT_ASSERT( node.getValueType() == PrimitiveMap::BOOLEAN_TYPE );
     CPPUNIT_ASSERT( node.getBool() == true );
     node.setBool( false );
     CPPUNIT_ASSERT( node.getValueType() == PrimitiveMap::BOOLEAN_TYPE );
     CPPUNIT_ASSERT( node.getBool() == false );
-    
+
     node.setByte( 5 );
     CPPUNIT_ASSERT( node.getValueType() == PrimitiveMap::BYTE_TYPE );
     CPPUNIT_ASSERT( node.getByte() == 5 );
-    
+
     node.setChar( 'a' );
     CPPUNIT_ASSERT( node.getValueType() == PrimitiveMap::CHAR_TYPE );
     CPPUNIT_ASSERT( node.getChar() == 'a' );
-    
+
     node.setShort( 10 );
     CPPUNIT_ASSERT( node.getValueType() == PrimitiveMap::SHORT_TYPE );
     CPPUNIT_ASSERT( node.getShort() == 10 );
-    
+
     node.setInt( 10000 );
     CPPUNIT_ASSERT( node.getValueType() == PrimitiveMap::INTEGER_TYPE );
     CPPUNIT_ASSERT( node.getInt() == 10000 );
-    
+
     node.setLong( 100000L );
     CPPUNIT_ASSERT( node.getValueType() == PrimitiveMap::LONG_TYPE );
     CPPUNIT_ASSERT( node.getLong() == 100000L );
-    
+
     node.setDouble( 2.3 );
     CPPUNIT_ASSERT( node.getValueType() == PrimitiveMap::DOUBLE_TYPE );
     CPPUNIT_ASSERT( node.getDouble() == 2.3 );
-    
+
     node.setFloat( 3.2f );
     CPPUNIT_ASSERT( node.getValueType() == PrimitiveMap::FLOAT_TYPE );
     CPPUNIT_ASSERT( node.getFloat() == 3.2f );
-    
+
     node.setString( "hello" );
     CPPUNIT_ASSERT( node.getValueType() == PrimitiveMap::STRING_TYPE );
     CPPUNIT_ASSERT( node.getString() == "hello" );
@@ -69,25 +69,25 @@
     byteArray.push_back( 'b' );
     byteArray.push_back( 'c' );
     byteArray.push_back( 'd' );
-    
+
     node.setByteArray( byteArray );
     CPPUNIT_ASSERT( node.getValueType() == PrimitiveMap::BYTE_ARRAY_TYPE );
     CPPUNIT_ASSERT( node.getByteArray() == byteArray );
 
-    try{        
+    try{
         node.getFloat();
         CPPUNIT_ASSERT( false );
     } catch( activemq::exceptions::NoSuchElementException& e ){
     }
-    
+
     node.clear();
     CPPUNIT_ASSERT( node.getValueType() == PrimitiveMap::NULL_TYPE );
 }
 
 void PrimitiveMapTest::testSetGet(){
-    
+
     PrimitiveMap pmap;
-    
+
     try{
         pmap.getBool( "bool" );
         CPPUNIT_ASSERT( false );
@@ -96,69 +96,69 @@
     CPPUNIT_ASSERT( pmap.getBool("bool") == true );
     pmap.setBool( "bool", false );
     CPPUNIT_ASSERT( pmap.getBool("bool") == false );
-    
+
     try{
         pmap.getByte( "byte" );
         CPPUNIT_ASSERT( false );
     } catch( activemq::exceptions::NoSuchElementException& e ){}
     pmap.setByte( "byte", 1 );
     CPPUNIT_ASSERT( pmap.getByte("byte") == 1 );
-    
+
     try{
         pmap.getChar( "char" );
         CPPUNIT_ASSERT( false );
     } catch( activemq::exceptions::NoSuchElementException& e ){}
     pmap.setChar( "char", 'a' );
     CPPUNIT_ASSERT( pmap.getChar("char") == 'a' );
-    
+
     try{
         pmap.getShort( "short" );
         CPPUNIT_ASSERT( false );
     } catch( activemq::exceptions::NoSuchElementException& e ){}
     pmap.setShort( "short", 2 );
     CPPUNIT_ASSERT( pmap.getShort("short") == 2 );
-    
+
     try{
         pmap.getInt( "int" );
         CPPUNIT_ASSERT( false );
     } catch( activemq::exceptions::NoSuchElementException& e ){}
     pmap.setInt( "int", 3 );
     CPPUNIT_ASSERT( pmap.getInt("int") == 3 );
-    
+
     try{
         pmap.getLong( "long" );
         CPPUNIT_ASSERT( false );
     } catch( activemq::exceptions::NoSuchElementException& e ){}
     pmap.setLong( "long", 4L );
     CPPUNIT_ASSERT( pmap.getLong("long") == 4L );
-    
+
     try{
         pmap.getDouble( "double" );
         CPPUNIT_ASSERT( false );
     } catch( activemq::exceptions::NoSuchElementException& e ){}
     pmap.setDouble( "double", 2.3 );
     CPPUNIT_ASSERT( pmap.getDouble("double") == 2.3 );
-    
+
     try{
         pmap.getFloat( "float" );
         CPPUNIT_ASSERT( false );
     } catch( activemq::exceptions::NoSuchElementException& e ){}
     pmap.setFloat( "float", 3.2f );
     CPPUNIT_ASSERT( pmap.getFloat("float") == 3.2f );
-    
+
     try{
         pmap.getString( "string" );
         CPPUNIT_ASSERT( false );
     } catch( activemq::exceptions::NoSuchElementException& e ){}
     pmap.setString( "string", "hello" );
     CPPUNIT_ASSERT( pmap.getString("string") == "hello" );
-    
+
     std::vector<unsigned char> byteArray;
     byteArray.push_back( 'a' );
     byteArray.push_back( 'b' );
     byteArray.push_back( 'c' );
     byteArray.push_back( 'd' );
-    
+
     try{
         pmap.getByteArray( "byteArray" );
         CPPUNIT_ASSERT( false );
@@ -169,7 +169,7 @@
 }
 
 void PrimitiveMapTest::testRemove(){
-    
+
     PrimitiveMap pmap;
     pmap.setInt("int", 5 );
     pmap.setFloat( "float", 5.5f );
@@ -182,7 +182,7 @@
 }
 
 void PrimitiveMapTest::testCount(){
-    
+
     PrimitiveMap pmap;
     CPPUNIT_ASSERT( pmap.size() == 0 );
     pmap.setInt("int", 5 );
@@ -193,6 +193,8 @@
     CPPUNIT_ASSERT( pmap.size() == 3 );
     pmap.remove("int");
     CPPUNIT_ASSERT( pmap.size() == 2 );
+
+    CPPUNIT_ASSERT( pmap.toString() != "" );
 }
 
 void PrimitiveMapTest::testCopy(){
@@ -211,25 +213,25 @@
 }
 
 void PrimitiveMapTest::testClear(){
-    
+
     PrimitiveMap pmap;
     pmap.setInt("int", 5 );
     pmap.setFloat( "float", 5.5f );
     pmap.setInt("int2", 6 );
-    
+
     pmap.clear();
     CPPUNIT_ASSERT( pmap.size() == 0 );
-    
+
     try{
         pmap.getInt("int");
         CPPUNIT_ASSERT( false );
     } catch( activemq::exceptions::NoSuchElementException& e ){}
-    
+
     try{
         pmap.getFloat("float");
         CPPUNIT_ASSERT( false );
     } catch( activemq::exceptions::NoSuchElementException& e ){}
-    
+
     try{
         pmap.getInt("int2");
         CPPUNIT_ASSERT( false );
@@ -237,33 +239,33 @@
 }
 
 void PrimitiveMapTest::testContains(){
-    
+
     PrimitiveMap pmap;
-    
+
     CPPUNIT_ASSERT( pmap.contains("int") == false );
-    
+
     pmap.setInt("int", 5 );
     CPPUNIT_ASSERT( pmap.contains("int") == true );
-    
+
     pmap.setFloat( "float", 5.5f );
     CPPUNIT_ASSERT( pmap.contains("float") == true );
-    
+
     pmap.setInt("int2", 6 );
     CPPUNIT_ASSERT( pmap.contains("int2") == true );
-    
+
     pmap.remove("int");
     CPPUNIT_ASSERT( pmap.contains("int") == false );
 }
 
 void PrimitiveMapTest::testGetKeys(){
-    
+
     PrimitiveMap pmap;
-    
+
     pmap.setInt("int", 5 );
     pmap.setFloat( "float", 5.5f );
     pmap.setInt("int2", 6 );
     std::vector<std::string> keys = pmap.getKeys();
-    
+
     CPPUNIT_ASSERT( keys.size() == 3 );
     CPPUNIT_ASSERT( keys[0] == "int" || keys[0] == "float" || keys[0] == "int2" );
     CPPUNIT_ASSERT( keys[1] == "int" || keys[1] == "float" || keys[1] == "int2" );



Mime
View raw message