activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r771329 [1/2] - in /activemq/activemq-cpp/trunk/activemq-cpp/src: main/ main/activemq/util/ main/cms/ main/decaf/lang/ test/ test/activemq/util/
Date Mon, 04 May 2009 15:13:47 GMT
Author: tabish
Date: Mon May  4 15:13:46 2009
New Revision: 771329

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

Added support for the JMS property conversion table rules.  Fixed a couple issues in the decaf code.

Added:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueConverter.cpp   (with props)
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueConverter.h   (with props)
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveValueConverterTest.cpp   (with props)
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveValueConverterTest.h   (with props)
Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveMap.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveMap.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueNode.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueNode.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/Message.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Boolean.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Pointer.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveListTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveMapTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveValueNodeTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/testRegistry.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am?rev=771329&r1=771328&r2=771329&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am Mon May  4 15:13:46 2009
@@ -318,6 +318,7 @@
     activemq/cmsutil/CmsDestinationAccessor.cpp \
     activemq/cmsutil/CmsAccessor.cpp \
     activemq/cmsutil/SessionPool.cpp \
+    activemq/util/PrimitiveValueConverter.cpp \
     activemq/util/URISupport.cpp \
     activemq/util/PrimitiveMap.cpp \
     activemq/util/PrimitiveValueNode.cpp \
@@ -866,6 +867,7 @@
     activemq/util/MemoryUsage.h \
     activemq/util/PrimitiveValueNode.h \
     activemq/util/CompositeData.h \
+    activemq/util/PrimitiveValueConverter.h \
     activemq/util/Usage.h \
     activemq/util/LongSequenceGenerator.h \
     activemq/util/Config.h \

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveMap.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveMap.cpp?rev=771329&r1=771328&r2=771329&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveMap.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveMap.cpp Mon May  4 15:13:46 2009
@@ -64,7 +64,7 @@
     throw( NoSuchElementException ){
 
     PrimitiveValueNode node = this->get( key );
-    return node.getBool();
+    return converter.convert<bool>( node );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -81,7 +81,7 @@
     throw( NoSuchElementException ){
 
     PrimitiveValueNode node = this->get( key );
-    return node.getByte();
+    return converter.convert<unsigned char>( node );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -97,7 +97,7 @@
     throw( NoSuchElementException ){
 
     PrimitiveValueNode node = this->get( key );
-    return node.getChar();
+    return converter.convert<char>( node );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -113,7 +113,7 @@
     throw( NoSuchElementException ){
 
     PrimitiveValueNode node = this->get( key );
-    return node.getShort();
+    return converter.convert<short>( node );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -129,7 +129,7 @@
     throw( NoSuchElementException ){
 
     PrimitiveValueNode node = this->get( key );
-    return node.getInt();
+    return converter.convert<int>( node );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -145,7 +145,7 @@
     throw( NoSuchElementException ){
 
     PrimitiveValueNode node = this->get( key );
-    return node.getLong();
+    return converter.convert<long long>( node );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -161,7 +161,7 @@
     throw( NoSuchElementException ){
 
     PrimitiveValueNode node = this->get( key );
-    return node.getDouble();
+    return converter.convert<double>( node );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -177,7 +177,7 @@
     throw( NoSuchElementException ){
 
     PrimitiveValueNode node = this->get( key );
-    return node.getFloat();
+    return converter.convert<float>( node );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -193,7 +193,7 @@
     throw( NoSuchElementException ){
 
     PrimitiveValueNode node = this->get( key );
-    return node.getString();
+    return converter.convert<std::string>( node );
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveMap.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveMap.h?rev=771329&r1=771328&r2=771329&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveMap.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveMap.h Mon May  4 15:13:46 2009
@@ -25,6 +25,7 @@
 #include <decaf/util/StlMap.h>
 #include <decaf/lang/exceptions/NoSuchElementException.h>
 #include <activemq/util/PrimitiveValueNode.h>
+#include <activemq/util/PrimitiveValueConverter.h>
 
 namespace activemq{
 namespace util{
@@ -33,6 +34,10 @@
      * Map of named primitives.
      */
     class AMQCPP_API PrimitiveMap : public decaf::util::StlMap<std::string, PrimitiveValueNode> {
+    private:
+
+        PrimitiveValueConverter converter;
+
     public:
 
         /**

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueConverter.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueConverter.cpp?rev=771329&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueConverter.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueConverter.cpp Mon May  4 15:13:46 2009
@@ -0,0 +1,245 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "PrimitiveValueConverter.h"
+
+#include <decaf/lang/Boolean.h>
+#include <decaf/lang/Byte.h>
+#include <decaf/lang/Character.h>
+#include <decaf/lang/Short.h>
+#include <decaf/lang/Integer.h>
+#include <decaf/lang/Long.h>
+#include <decaf/lang/Float.h>
+#include <decaf/lang/Double.h>
+
+namespace activemq{
+namespace util{
+
+////////////////////////////////////////////////////////////////////////////////
+template<>
+bool PrimitiveValueConverter::convert( const PrimitiveValueNode& value ) const
+    throw( decaf::lang::exceptions::UnsupportedOperationException ) {
+
+    switch( value.getType() ) {
+        case PrimitiveValueNode::BOOLEAN_TYPE:
+            return value.getBool();
+        case PrimitiveValueNode::STRING_TYPE:
+        case PrimitiveValueNode::BIG_STRING_TYPE:
+        {
+            try{
+                return decaf::lang::Boolean::parseBoolean( value.getString() );
+            } catch( decaf::lang::Exception& ex ) {}
+        }
+        default:
+            throw decaf::lang::exceptions::UnsupportedOperationException(
+                 __FILE__, __LINE__, "Unsupported Type Conversion" );
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+template<>
+unsigned char PrimitiveValueConverter::convert( const PrimitiveValueNode& value ) const
+    throw( decaf::lang::exceptions::UnsupportedOperationException ) {
+
+    switch( value.getType() ) {
+        case PrimitiveValueNode::BYTE_TYPE:
+            return value.getByte();
+        case PrimitiveValueNode::STRING_TYPE:
+        case PrimitiveValueNode::BIG_STRING_TYPE:
+        {
+            try{
+                return decaf::lang::Byte::parseByte( value.getString() );
+            } catch( decaf::lang::Exception& ex ) {}
+        }
+        default:
+            throw decaf::lang::exceptions::UnsupportedOperationException(
+                 __FILE__, __LINE__, "Unsupported Type Conversion" );
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+template<>
+char PrimitiveValueConverter::convert( const PrimitiveValueNode& value ) const
+    throw( decaf::lang::exceptions::UnsupportedOperationException ) {
+
+    switch( value.getType() ) {
+        case PrimitiveValueNode::CHAR_TYPE:
+            return value.getChar();
+        case PrimitiveValueNode::STRING_TYPE:
+        case PrimitiveValueNode::BIG_STRING_TYPE:
+        {
+            try{
+                return (char)decaf::lang::Byte::parseByte( value.getString() );
+            } catch( decaf::lang::Exception& ex ) {}
+        }
+        default:
+            throw decaf::lang::exceptions::UnsupportedOperationException(
+                 __FILE__, __LINE__, "Unsupported Type Conversion" );
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+template<>
+short PrimitiveValueConverter::convert( const PrimitiveValueNode& value ) const
+    throw( decaf::lang::exceptions::UnsupportedOperationException ) {
+
+    switch( value.getType() ) {
+        case PrimitiveValueNode::BYTE_TYPE:
+            return (short)value.getByte();
+        case PrimitiveValueNode::SHORT_TYPE:
+            return value.getShort();
+        case PrimitiveValueNode::STRING_TYPE:
+        case PrimitiveValueNode::BIG_STRING_TYPE:
+        {
+            try{
+                return decaf::lang::Short::parseShort( value.getString() );
+            } catch( decaf::lang::Exception& ex ) {}
+        }
+        default:
+            throw decaf::lang::exceptions::UnsupportedOperationException(
+                 __FILE__, __LINE__, "Unsupported Type Conversion" );
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+template<>
+int PrimitiveValueConverter::convert( const PrimitiveValueNode& value ) const
+    throw( decaf::lang::exceptions::UnsupportedOperationException ) {
+
+    switch( value.getType() ) {
+        case PrimitiveValueNode::BYTE_TYPE:
+            return (int)value.getByte();
+        case PrimitiveValueNode::SHORT_TYPE:
+            return (int)value.getShort();
+        case PrimitiveValueNode::INTEGER_TYPE:
+            return value.getInt();
+        case PrimitiveValueNode::STRING_TYPE:
+        case PrimitiveValueNode::BIG_STRING_TYPE:
+        {
+            try{
+                return decaf::lang::Integer::parseInt( value.getString() );
+            } catch( decaf::lang::Exception& ex ) {}
+        }
+        default:
+            throw decaf::lang::exceptions::UnsupportedOperationException(
+                __FILE__, __LINE__, "Unsupported Type Conversion" );
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+template<>
+long long PrimitiveValueConverter::convert( const PrimitiveValueNode& value ) const
+    throw( decaf::lang::exceptions::UnsupportedOperationException ) {
+
+    switch( value.getType() ) {
+        case PrimitiveValueNode::BYTE_TYPE:
+            return (long long)value.getByte();
+        case PrimitiveValueNode::SHORT_TYPE:
+            return (long long)value.getShort();
+        case PrimitiveValueNode::INTEGER_TYPE:
+            return (long long)value.getInt();
+        case PrimitiveValueNode::LONG_TYPE:
+            return (long long)value.getLong();
+        case PrimitiveValueNode::STRING_TYPE:
+        case PrimitiveValueNode::BIG_STRING_TYPE:
+        {
+            try{
+                return decaf::lang::Long::parseLong( value.getString() );
+            } catch( decaf::lang::Exception& ex ) {}
+        }
+        default:
+            throw decaf::lang::exceptions::UnsupportedOperationException(
+                __FILE__, __LINE__, "Unsupported Type Conversion" );
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+template<>
+float PrimitiveValueConverter::convert( const PrimitiveValueNode& value ) const
+    throw( decaf::lang::exceptions::UnsupportedOperationException ) {
+
+    switch( value.getType() ) {
+        case PrimitiveValueNode::FLOAT_TYPE:
+            return value.getFloat();
+        case PrimitiveValueNode::STRING_TYPE:
+        case PrimitiveValueNode::BIG_STRING_TYPE:
+        {
+            try{
+                return decaf::lang::Float::parseFloat( value.getString() );
+            } catch( decaf::lang::Exception& ex ) {}
+        }
+        default:
+            throw decaf::lang::exceptions::UnsupportedOperationException(
+                 __FILE__, __LINE__, "Unsupported Type Conversion" );
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+template<>
+double PrimitiveValueConverter::convert( const PrimitiveValueNode& value ) const
+    throw( decaf::lang::exceptions::UnsupportedOperationException ) {
+
+    switch( value.getType() ) {
+        case PrimitiveValueNode::FLOAT_TYPE:
+            return (double)value.getFloat();
+        case PrimitiveValueNode::DOUBLE_TYPE:
+            return value.getDouble();
+        case PrimitiveValueNode::STRING_TYPE:
+        case PrimitiveValueNode::BIG_STRING_TYPE:
+        {
+            try{
+                return decaf::lang::Double::parseDouble( value.getString() );
+            } catch( decaf::lang::Exception& ex ) {}
+        }
+        default:
+            throw decaf::lang::exceptions::UnsupportedOperationException(
+                 __FILE__, __LINE__, "Unsupported Type Conversion" );
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+template<>
+std::string PrimitiveValueConverter::convert( const PrimitiveValueNode& value ) const
+    throw( decaf::lang::exceptions::UnsupportedOperationException ) {
+
+    switch( value.getType() ) {
+        case PrimitiveValueNode::BOOLEAN_TYPE:
+            return decaf::lang::Boolean::toString( value.getBool() );
+        case PrimitiveValueNode::BYTE_TYPE:
+            return decaf::lang::Byte::toString( value.getByte() );
+        case PrimitiveValueNode::CHAR_TYPE:
+            return decaf::lang::Character::valueOf( value.getChar() ).toString();
+        case PrimitiveValueNode::SHORT_TYPE:
+            return decaf::lang::Short::toString( value.getShort() );
+        case PrimitiveValueNode::INTEGER_TYPE:
+            return decaf::lang::Integer::toString( value.getInt() );
+        case PrimitiveValueNode::LONG_TYPE:
+            return decaf::lang::Long::toString( value.getLong() );
+        case PrimitiveValueNode::FLOAT_TYPE:
+            return decaf::lang::Float::toString( value.getFloat() );
+        case PrimitiveValueNode::DOUBLE_TYPE:
+            return decaf::lang::Double::toString( value.getDouble() );
+        case PrimitiveValueNode::STRING_TYPE:
+        case PrimitiveValueNode::BIG_STRING_TYPE:
+            return value.getString();
+        default:
+            throw decaf::lang::exceptions::UnsupportedOperationException(
+                __FILE__, __LINE__, "Unsupported Type Conversion" );
+    }
+}
+
+}}

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueConverter.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueConverter.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueConverter.h?rev=771329&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueConverter.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueConverter.h Mon May  4 15:13:46 2009
@@ -0,0 +1,101 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _ACTIVEMQ_UTIL_PRIMITIVEVALUECONVERTER_H_
+#define _ACTIVEMQ_UTIL_PRIMITIVEVALUECONVERTER_H_
+
+#include <activemq/util/Config.h>
+
+#include <activemq/util/PrimitiveValueNode.h>
+#include <decaf/lang/exceptions/UnsupportedOperationException.h>
+#include <string>
+
+namespace activemq {
+namespace util {
+
+    /**
+     * Class controls the conversion of data contained in a PrimitiveValueNode
+     * from one type to another.  If the conversion is supported then calling
+     * the convert method will throw an UnsupportedOperationException to indicate
+     * that its not possible to perform the conversion.
+     *
+     * This class is used to implement the rules of conversion on CMS Message
+     * properties, the following conversion table must be implemented.  A value
+     * written as the row type can be read in the column type.
+     *
+     *    |        | boolean byte short int long float double String
+     *    |----------------------------------------------------------
+     *    |boolean |    X                                       X
+     *    |byte    |          X     X    X   X                  X
+     *    |short   |                X    X   X                  X
+     *    |int     |                     X   X                  X
+     *    |long    |                         X                  X
+     *    |float   |                               X     X      X
+     *    |double  |                                     X      X
+     *    |String  |    X     X     X    X   X     X     X      X
+     *    |----------------------------------------------------------
+     *
+     * @since 3.0
+     */
+    class AMQCPP_API PrimitiveValueConverter {
+    public:
+
+        PrimitiveValueConverter() {}
+        virtual ~PrimitiveValueConverter() {}
+
+        template< typename TO>
+        TO convert( const PrimitiveValueNode& value ) const
+            throw ( decaf::lang::exceptions::UnsupportedOperationException ) {
+
+            throw decaf::lang::exceptions::UnsupportedOperationException(
+                __FILE__, __LINE__, "Invalid Conversion" );
+        }
+
+
+    };
+
+    template<>
+    bool PrimitiveValueConverter::convert( const PrimitiveValueNode& value ) const
+        throw( decaf::lang::exceptions::UnsupportedOperationException );
+    template<>
+    unsigned char PrimitiveValueConverter::convert( const PrimitiveValueNode& value ) const
+        throw( decaf::lang::exceptions::UnsupportedOperationException );
+    template<>
+    char PrimitiveValueConverter::convert( const PrimitiveValueNode& value ) const
+        throw( decaf::lang::exceptions::UnsupportedOperationException );
+    template<>
+    short PrimitiveValueConverter::convert( const PrimitiveValueNode& value ) const
+        throw( decaf::lang::exceptions::UnsupportedOperationException );
+    template<>
+    int PrimitiveValueConverter::convert( const PrimitiveValueNode& value ) const
+        throw( decaf::lang::exceptions::UnsupportedOperationException );
+    template<>
+    long long PrimitiveValueConverter::convert( const PrimitiveValueNode& value ) const
+        throw( decaf::lang::exceptions::UnsupportedOperationException );
+    template<>
+    float PrimitiveValueConverter::convert( const PrimitiveValueNode& value ) const
+        throw( decaf::lang::exceptions::UnsupportedOperationException );
+    template<>
+    double PrimitiveValueConverter::convert( const PrimitiveValueNode& value ) const
+        throw( decaf::lang::exceptions::UnsupportedOperationException );
+    template<>
+    std::string PrimitiveValueConverter::convert( const PrimitiveValueNode& value ) const
+        throw( decaf::lang::exceptions::UnsupportedOperationException );
+
+}}
+
+#endif /* _ACTIVEMQ_UTIL_PRIMITIVEVALUECONVERTER_H_ */

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueConverter.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueNode.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueNode.cpp?rev=771329&r1=771328&r2=771329&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueNode.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueNode.cpp Mon May  4 15:13:46 2009
@@ -118,20 +118,20 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-PrimitiveValueNode::PrimitiveValueNode( const PrimitiveValueNode& node ){
+PrimitiveValueNode::PrimitiveValueNode( const PrimitiveValueNode& node ) {
     valueType = NULL_TYPE;
     (*this) = node;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-PrimitiveValueNode& PrimitiveValueNode::operator =( const PrimitiveValueNode& node ){
+PrimitiveValueNode& PrimitiveValueNode::operator =( const PrimitiveValueNode& node ) {
     clear();
-    this->setValue( node.getValue(), node.getValueType() );
+    this->setValue( node.getValue(), node.getType() );
     return *this;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-bool PrimitiveValueNode::operator==( const PrimitiveValueNode& node ) const{
+bool PrimitiveValueNode::operator==( const PrimitiveValueNode& node ) const {
 
     if( valueType != node.valueType ) {
          return false;
@@ -179,15 +179,15 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void PrimitiveValueNode::clear(){
+void PrimitiveValueNode::clear() {
 
-    if( valueType == STRING_TYPE && value.stringValue != NULL ){
+    if( valueType == STRING_TYPE && value.stringValue != NULL ) {
         delete value.stringValue;
-    } else if( valueType == BYTE_ARRAY_TYPE && value.byteArrayValue != NULL ){
+    } else if( valueType == BYTE_ARRAY_TYPE && value.byteArrayValue != NULL ) {
         delete value.byteArrayValue;
-    } else if( valueType == LIST_TYPE && value.listValue != NULL ){
+    } else if( valueType == LIST_TYPE && value.listValue != NULL ) {
         delete value.listValue;
-    } else if( valueType == MAP_TYPE && value.mapValue != NULL ){
+    } else if( valueType == MAP_TYPE && value.mapValue != NULL ) {
         delete value.mapValue;
     }
 
@@ -197,7 +197,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 void PrimitiveValueNode::setValue(
-    const PrimitiveValue& value, PrimitiveValueTypeEnum valueType ) {
+    const PrimitiveValue& value, PrimitiveType valueType ) {
 
     if( valueType == BOOLEAN_TYPE ) {
         this->setBool( value.boolValue );
@@ -229,7 +229,7 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void PrimitiveValueNode::setBool( bool lvalue ){
+void PrimitiveValueNode::setBool( bool lvalue ) {
     clear();
     valueType = BOOLEAN_TYPE;
     value.boolValue = lvalue;
@@ -237,147 +237,163 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 bool PrimitiveValueNode::getBool() const
-    throw( decaf::lang::exceptions::NoSuchElementException ){
+    throw( decaf::lang::exceptions::NoSuchElementException ) {
 
     if( valueType != BOOLEAN_TYPE ){
-        throw decaf::lang::exceptions::NoSuchElementException( __FILE__,
-            __LINE__, "PrimitiveValue is not BOOLEAN_TYPE" );
+        throw decaf::lang::exceptions::NoSuchElementException(
+            __FILE__, __LINE__, "PrimitiveValue is not BOOLEAN_TYPE" );
     }
 
     return value.boolValue;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void PrimitiveValueNode::setByte( unsigned char lvalue ){
+void PrimitiveValueNode::setByte( unsigned char lvalue ) {
     clear();
     valueType = BYTE_TYPE;
     value.byteValue = lvalue;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-unsigned char PrimitiveValueNode::getByte() const throw( decaf::lang::exceptions::NoSuchElementException){
+unsigned char PrimitiveValueNode::getByte() const
+    throw( decaf::lang::exceptions::NoSuchElementException ) {
+
     if( valueType != BYTE_TYPE ){
-        throw decaf::lang::exceptions::NoSuchElementException( __FILE__,
-            __LINE__, "PrimitiveValue is not BYTE_TYPE" );
+        throw decaf::lang::exceptions::NoSuchElementException(
+            __FILE__, __LINE__, "PrimitiveValue is not BYTE_TYPE" );
     }
 
     return value.byteValue;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void PrimitiveValueNode::setChar( char lvalue ){
+void PrimitiveValueNode::setChar( char lvalue ) {
     clear();
     valueType = CHAR_TYPE;
     value.charValue = lvalue;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-char PrimitiveValueNode::getChar() const throw(decaf::lang::exceptions::NoSuchElementException){
+char PrimitiveValueNode::getChar() const
+    throw( decaf::lang::exceptions::NoSuchElementException ) {
+
     if( valueType != CHAR_TYPE ){
-        throw decaf::lang::exceptions::NoSuchElementException( __FILE__,
-            __LINE__, "PrimitiveValue is not CHAR_TYPE" );
+        throw decaf::lang::exceptions::NoSuchElementException(
+            __FILE__, __LINE__, "PrimitiveValue is not CHAR_TYPE" );
     }
 
     return value.charValue;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void PrimitiveValueNode::setShort( short lvalue ){
+void PrimitiveValueNode::setShort( short lvalue ) {
     clear();
     valueType = SHORT_TYPE;
     value.shortValue = lvalue;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-short PrimitiveValueNode::getShort() const throw(decaf::lang::exceptions::NoSuchElementException){
+short PrimitiveValueNode::getShort()
+    const throw( decaf::lang::exceptions::NoSuchElementException ) {
+
     if( valueType != SHORT_TYPE ){
-        throw decaf::lang::exceptions::NoSuchElementException( __FILE__,
-            __LINE__, "PrimitiveValue is not SHORT_TYPE" );
+        throw decaf::lang::exceptions::NoSuchElementException(
+            __FILE__, __LINE__, "PrimitiveValue is not SHORT_TYPE" );
     }
 
     return value.shortValue;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void PrimitiveValueNode::setInt( int lvalue ){
+void PrimitiveValueNode::setInt( int lvalue ) {
     clear();
     valueType = INTEGER_TYPE;
     value.intValue = lvalue;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-int PrimitiveValueNode::getInt() const throw(decaf::lang::exceptions::NoSuchElementException){
+int PrimitiveValueNode::getInt() const
+    throw( decaf::lang::exceptions::NoSuchElementException ) {
+
     if( valueType != INTEGER_TYPE ){
-        throw decaf::lang::exceptions::NoSuchElementException( __FILE__,
-            __LINE__, "PrimitiveValue is not INTEGER_TYPE" );
+        throw decaf::lang::exceptions::NoSuchElementException(
+            __FILE__, __LINE__, "PrimitiveValue is not INTEGER_TYPE" );
     }
 
     return value.intValue;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void PrimitiveValueNode::setLong( long long lvalue ){
+void PrimitiveValueNode::setLong( long long lvalue ) {
     clear();
     valueType = LONG_TYPE;
     value.longValue = lvalue;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-long long PrimitiveValueNode::getLong() const throw(decaf::lang::exceptions::NoSuchElementException){
+long long PrimitiveValueNode::getLong() const
+    throw( decaf::lang::exceptions::NoSuchElementException ) {
+
     if( valueType != LONG_TYPE ){
-        throw decaf::lang::exceptions::NoSuchElementException( __FILE__,
-            __LINE__, "PrimitiveValue is not LONG_TYPE" );
+        throw decaf::lang::exceptions::NoSuchElementException(
+            __FILE__, __LINE__, "PrimitiveValue is not LONG_TYPE" );
     }
 
     return value.longValue;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void PrimitiveValueNode::setDouble( double lvalue ){
+void PrimitiveValueNode::setDouble( double lvalue ) {
     clear();
     valueType = DOUBLE_TYPE;
     value.doubleValue = lvalue;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-double PrimitiveValueNode::getDouble() const throw(decaf::lang::exceptions::NoSuchElementException){
+double PrimitiveValueNode::getDouble() const
+    throw( decaf::lang::exceptions::NoSuchElementException ) {
+
     if( valueType != DOUBLE_TYPE ){
-        throw decaf::lang::exceptions::NoSuchElementException( __FILE__,
-            __LINE__, "PrimitiveValue is not DOUBLE_TYPE" );
+        throw decaf::lang::exceptions::NoSuchElementException(
+            __FILE__, __LINE__, "PrimitiveValue is not DOUBLE_TYPE" );
     }
 
     return value.doubleValue;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void PrimitiveValueNode::setFloat( float lvalue ){
+void PrimitiveValueNode::setFloat( float lvalue ) {
     clear();
     valueType = FLOAT_TYPE;
     value.floatValue = lvalue;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-float PrimitiveValueNode::getFloat() const throw(decaf::lang::exceptions::NoSuchElementException){
+float PrimitiveValueNode::getFloat() const
+    throw( decaf::lang::exceptions::NoSuchElementException ) {
+
     if( valueType != FLOAT_TYPE ){
-        throw decaf::lang::exceptions::NoSuchElementException( __FILE__,
-            __LINE__, "PrimitiveValue is not FLOAT_TYPE" );
+        throw decaf::lang::exceptions::NoSuchElementException(
+            __FILE__, __LINE__, "PrimitiveValue is not FLOAT_TYPE" );
     }
 
     return value.floatValue;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void PrimitiveValueNode::setString( const std::string& lvalue ){
+void PrimitiveValueNode::setString( const std::string& lvalue ) {
     clear();
     valueType = STRING_TYPE;
     value.stringValue = new std::string( lvalue );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-std::string PrimitiveValueNode::getString() const throw(decaf::lang::exceptions::NoSuchElementException){
+std::string PrimitiveValueNode::getString() const
+    throw( decaf::lang::exceptions::NoSuchElementException ) {
+
     if( valueType != STRING_TYPE ){
-        throw decaf::lang::exceptions::NoSuchElementException( __FILE__,
-            __LINE__, "PrimitiveValue is not STRING_TYPE" );
+        throw decaf::lang::exceptions::NoSuchElementException(
+            __FILE__, __LINE__, "PrimitiveValue is not STRING_TYPE" );
     }
 
     if( value.stringValue == NULL ){
@@ -388,20 +404,19 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void PrimitiveValueNode::setByteArray( const std::vector<unsigned char>& lvalue ){
+void PrimitiveValueNode::setByteArray( const std::vector<unsigned char>& lvalue ) {
     clear();
     valueType = BYTE_ARRAY_TYPE;
     value.byteArrayValue = new std::vector<unsigned char>( lvalue );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-std::vector<unsigned char> PrimitiveValueNode::getByteArray() const throw( decaf::lang::exceptions::NoSuchElementException ) {
+std::vector<unsigned char> PrimitiveValueNode::getByteArray() const
+    throw( decaf::lang::exceptions::NoSuchElementException ) {
 
     if( valueType != BYTE_ARRAY_TYPE ){
         throw decaf::lang::exceptions::NoSuchElementException(
-            __FILE__,
-            __LINE__,
-            "PrimitiveValue is not BYTE_ARRAY_TYPE" );
+            __FILE__, __LINE__, "PrimitiveValue is not BYTE_ARRAY_TYPE" );
     }
 
     if( value.byteArrayValue == NULL ){
@@ -412,7 +427,7 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void PrimitiveValueNode::setList( const decaf::util::List<PrimitiveValueNode>& lvalue ){
+void PrimitiveValueNode::setList( const decaf::util::List<PrimitiveValueNode>& lvalue ) {
     clear();
     valueType = LIST_TYPE;
     value.listValue = new decaf::util::StlList<PrimitiveValueNode>();
@@ -425,15 +440,13 @@
 
     if( valueType != LIST_TYPE ){
         throw decaf::lang::exceptions::NoSuchElementException(
-            __FILE__,
-            __LINE__,
+            __FILE__, __LINE__,
             "PrimitiveValue is not LIST_TYPE" );
     }
 
     if( value.listValue == NULL ){
         throw decaf::lang::exceptions::NullPointerException(
-            __FILE__,
-            __LINE__,
+            __FILE__, __LINE__,
             "PrimitiveValue is not set but an element was placed in the Map" );
     }
 
@@ -442,7 +455,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 void PrimitiveValueNode::setMap(
-    const decaf::util::Map<std::string, PrimitiveValueNode>& lvalue ){
+    const decaf::util::Map<std::string, PrimitiveValueNode>& lvalue ) {
 
     clear();
     valueType = MAP_TYPE;
@@ -455,15 +468,13 @@
 
     if( valueType != MAP_TYPE ){
         throw decaf::lang::exceptions::NoSuchElementException(
-            __FILE__,
-            __LINE__,
+            __FILE__, __LINE__,
             "PrimitiveValue is not MAP_TYPE" );
     }
 
     if( value.mapValue == NULL ){
         throw decaf::lang::exceptions::NullPointerException(
-            __FILE__,
-            __LINE__,
+            __FILE__, __LINE__,
             "PrimitiveValue is not set but an element was placed in the Map" );
     }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueNode.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueNode.h?rev=771329&r1=771328&r2=771329&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueNode.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueNode.h Mon May  4 15:13:46 2009
@@ -30,7 +30,7 @@
      * Class that wraps around a single value of one of the
      * many types.  Manages memory for complex types, such
      * as strings.  Note: the destructor was left non-virtual
-     * so no virtual table will be created.  This probaly isn't
+     * so no virtual table will be created.  This probably isn't
      * necessary, but will avoid needless memory allocation. Since
      * we'll never extend this class, not having a virtual
      * destructor isn't a concern.
@@ -41,7 +41,7 @@
         /**
          * Enumeration for the various primitive types.
          */
-        enum PrimitiveValueTypeEnum{
+        enum PrimitiveType{
             NULL_TYPE          = 0,
             BOOLEAN_TYPE       = 1,
             BYTE_TYPE          = 2,
@@ -80,7 +80,7 @@
 
     private:
 
-        PrimitiveValueTypeEnum valueType;
+        PrimitiveType valueType;
         PrimitiveValue value;
 
     public:
@@ -196,9 +196,9 @@
 
         /**
          * Gets the Value Type of this type wrapper.
-         * @return the PrimtiveValueTypeEnum value for this wrapper.
+         * @return the PrimitiveType value for this wrapper.
          */
-        PrimitiveValueTypeEnum getValueType() const { return valueType; }
+        PrimitiveType getType() const { return valueType; }
 
         /**
          * Gets the internal Primitive Value object from this wrapper.
@@ -212,7 +212,7 @@
          * Sets the internal PrimitiveVale object to the new value
          * along with the tag for the type that it consists of.
          */
-        void setValue( const PrimitiveValue& value, PrimitiveValueTypeEnum valueType );
+        void setValue( const PrimitiveValue& value, PrimitiveType valueType );
 
         /**
          * Clears the value from this wrapper converting it back to a blank
@@ -399,7 +399,7 @@
         void setList( const decaf::util::List<PrimitiveValueNode>& lvalue );
 
         /**
-         * Gets the Primtive List value of this Node.
+         * Gets the Primitive List value of this Node.
          * @return value contained at the given index
          * @throw NoSuchElementException this node cannot be returned as the
          * requested type.

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/Message.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/Message.h?rev=771329&r1=771328&r2=771329&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/Message.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/Message.h Mon May  4 15:13:46 2009
@@ -24,309 +24,334 @@
 #include <cms/DeliveryMode.h>
 
 namespace cms{
-   
+
     /**
-     * Root of all messages.  As in JMS, a message is comprised of
-     * 3 parts: CMS-specific headers, user-defined properties, and
-     * the body.
-     * 
+     * Root of all messages.  As in JMS, a message is comprised of 3 parts:
+     * CMS-specific headers, user-defined properties, and the body.
+     *
+     * <B>Message Properties<B>
+     *
+     * Message properties support the following conversion table. The marked cases
+     * must be supported. The unmarked cases must throw a CMSException. The
+     * String-to-primitive conversions may throw a runtime exception if the primitive's
+     * valueOf method does not accept the String as a valid representation of the
+     * primitive.
+     *
+     * A value written as the row type can be read as the column type.
+     *
+     *    |        | boolean byte short int long float double String
+     *    |----------------------------------------------------------
+     *    |boolean |    X                                       X
+     *    |byte    |          X     X    X   X                  X
+     *    |short   |                X    X   X                  X
+     *    |int     |                     X   X                  X
+     *    |long    |                         X                  X
+     *    |float   |                               X     X      X
+     *    |double  |                                     X      X
+     *    |String  |    X     X     X    X   X     X     X      X
+     *    |----------------------------------------------------------
+     *
+     * When a Message is delivered its properties are considered to be in a read-only
+     * mode and cannot be changed.  Attempting to change the value of a delivered
+     * Message's properties will result in a CMSException being thrown.
+     *
      * @see JMS API
+     * @since 1.0
      */
-    class CMS_API Message
-    {         
+    class CMS_API Message {
     public:
-   
+
         virtual ~Message(){}
-      
+
         /**
          * Clone this message exactly, returns a new instance that the
          * caller is required to delete.
-         * 
+         *
          * @return new copy of this message
          */
-        virtual Message* clone() const = 0;                
-        
+        virtual Message* clone() const = 0;
+
         /**
-         * Acknowledges all consumed messages of the session of this consumed 
+         * Acknowledges all consumed messages of the session of this consumed
          * message.
-         * 
-         * All consumed CMS messages support the acknowledge method for use 
-         * when a client has specified that its CMS session's consumed messages 
-         * are to be explicitly acknowledged. By invoking acknowledge on a 
-         * consumed message, a client acknowledges all messages consumed by the 
+         *
+         * All consumed CMS messages support the acknowledge method for use
+         * when a client has specified that its CMS session's consumed messages
+         * are to be explicitly acknowledged. By invoking acknowledge on a
+         * consumed message, a client acknowledges all messages consumed by the
          * session that the message was delivered to.
-         * 
-         * Calls to acknowledge are ignored for both transacted sessions and 
+         *
+         * Calls to acknowledge are ignored for both transacted sessions and
          * sessions specified to use implicit acknowledgement modes.
-         * 
-         * A client may individually acknowledge each message as it is consumed, 
-         * or it may choose to acknowledge messages as an application-defined 
-         * group (which is done by calling acknowledge on the last received 
-         * message of the group, thereby acknowledging all messages consumed by 
+         *
+         * A client may individually acknowledge each message as it is consumed,
+         * or it may choose to acknowledge messages as an application-defined
+         * group (which is done by calling acknowledge on the last received
+         * message of the group, thereby acknowledging all messages consumed by
          * the session.)
-         * 
-         * Messages that have been received but not acknowledged may be 
+         *
+         * Messages that have been received but not acknowledged may be
          * redelivered.
          */
         virtual void acknowledge() const throw( CMSException ) = 0;
-      
+
         /**
          * Clears out the body of the message.  This does not clear the
          * headers or properties.
          */
         virtual void clearBody() = 0;
-        
+
         /**
-         * Clears out the message body. Clearing a message's body does not clear 
+         * Clears out the message body. Clearing a message's body does not clear
          * its header values or property entries.
-         * 
-         * If this message body was read-only, calling this method leaves the 
-         * message body in the same state as an empty body in a newly created 
+         *
+         * If this message body was read-only, calling this method leaves the
+         * message body in the same state as an empty body in a newly created
          * message.
          */
         virtual void clearProperties() = 0;
-        
+
         /**
          * Retrieves the propery names.
-         * 
+         *
          * @return The complete set of property names currently in this
          * message.
          */
         virtual std::vector<std::string> getPropertyNames() const = 0;
-        
+
         /**
          * Indicates whether or not a given property exists.
-         * 
-         * @param name 
+         *
+         * @param name
          *      The name of the property to look up.
          * @return True if the property exists in this message.
          */
         virtual bool propertyExists( const std::string& name ) const = 0;
-        
+
         /**
          * Gets a boolean property.
-         * 
-         * @param name 
+         *
+         * @param name
          *      The name of the property to retrieve.
          * @return The value for the named property.
          * @throws CMSException if the property does not exist.
          */
-        virtual bool getBooleanProperty( const std::string& name ) const 
+        virtual bool getBooleanProperty( const std::string& name ) const
             throw( CMSException ) = 0;
-            
+
         /**
          * Gets a byte property.
-         * 
-         * @param name 
+         *
+         * @param name
          *      The name of the property to retrieve.
          * @return The value for the named property.
          * @throws CMSException if the property does not exist.
          */
-        virtual unsigned char getByteProperty( const std::string& name ) const 
+        virtual unsigned char getByteProperty( const std::string& name ) const
             throw( CMSException ) = 0;
-            
+
         /**
          * Gets a double property.
-         * 
-         * @param name 
+         *
+         * @param name
          *      The name of the property to retrieve.
          * @return The value for the named property.
          * @throws CMSException if the property does not exist.
          */
-        virtual double getDoubleProperty( const std::string& name ) const 
+        virtual double getDoubleProperty( const std::string& name ) const
             throw( CMSException ) = 0;
-            
+
         /**
          * Gets a float property.
-         * 
-         * @param name 
+         *
+         * @param name
          *      The name of the property to retrieve.
          * @return The value for the named property.
          * @throws CMSException if the property does not exist.
          */
-        virtual float getFloatProperty( const std::string& name ) const 
+        virtual float getFloatProperty( const std::string& name ) const
             throw( CMSException ) = 0;
-            
+
         /**
          * Gets a int property.
-         * 
-         * @param name 
+         *
+         * @param name
          *      The name of the property to retrieve.
          * @return The value for the named property.
          * @throws CMSException if the property does not exist.
          */
-        virtual int getIntProperty( const std::string& name ) const 
+        virtual int getIntProperty( const std::string& name ) const
             throw( CMSException ) = 0;
-            
+
         /**
          * Gets a long property.
-         * 
-         * @param name 
+         *
+         * @param name
          *      The name of the property to retrieve.
          * @return The value for the named property.
          * @throws CMSException if the property does not exist.
          */
-        virtual long long getLongProperty( const std::string& name ) const 
+        virtual long long getLongProperty( const std::string& name ) const
             throw( CMSException ) = 0;
-            
+
         /**
          * Gets a short property.
-         * 
-         * @param name 
+         *
+         * @param name
          *      The name of the property to retrieve.
          * @return The value for the named property.
          * @throws CMSException if the property does not exist.
          */
-        virtual short getShortProperty( const std::string& name ) const 
+        virtual short getShortProperty( const std::string& name ) const
             throw( CMSException ) = 0;
-            
+
         /**
          * Gets a string property.
-         * 
-         * @param name 
+         *
+         * @param name
          *      The name of the property to retrieve.
          * @return The value for the named property.
          * @throws CMSException if the property does not exist.
          */
-        virtual std::string getStringProperty( const std::string& name ) const 
+        virtual std::string getStringProperty( const std::string& name ) const
             throw( CMSException ) = 0;
-        
+
         /**
          * Sets a boolean property.
-         * 
-         * @param name 
+         *
+         * @param name
          *      The name of the property to retrieve.
-         * @param value 
+         * @param value
          *      The value for the named property.
          * @throws CMSException
          */
         virtual void setBooleanProperty( const std::string& name,
             bool value ) throw( CMSException ) = 0;
-            
+
         /**
          * Sets a byte property.
-         * 
-         * @param name 
+         *
+         * @param name
          *      The name of the property to retrieve.
-         * @param value 
+         * @param value
          *      The value for the named property.
          * @throws CMSException
          */
         virtual void setByteProperty( const std::string& name,
             unsigned char value ) throw( CMSException ) = 0;
-            
+
         /**
          * Sets a double property.
-         * 
-         * @param name 
+         *
+         * @param name
          *      The name of the property to retrieve.
-         * @param value 
+         * @param value
          *      The value for the named property.
          * @throws CMSException
          */
         virtual void setDoubleProperty( const std::string& name,
             double value ) throw( CMSException ) = 0;
-            
+
         /**
          * Sets a float property.
-         * @param name 
+         * @param name
          *      The name of the property to retrieve.
-         * @param value 
+         * @param value
          *      The value for the named property.
          * @throws CMSException
          */
         virtual void setFloatProperty( const std::string& name,
             float value ) throw( CMSException ) = 0;
-            
+
         /**
          * Sets a int property.
-         * 
-         * @param name 
+         *
+         * @param name
          *      The name of the property to retrieve.
-         * @param value 
+         * @param value
          *      The value for the named property.
          * @throws CMSException
          */
         virtual void setIntProperty( const std::string& name,
             int value ) throw( CMSException ) = 0;
-            
+
         /**
          * Sets a long property.
-         * 
-         * @param name 
+         *
+         * @param name
          *      The name of the property to retrieve.
-         * @param value 
+         * @param value
          *      The value for the named property.
          * @throws CMSException
          */
         virtual void setLongProperty( const std::string& name,
             long long value ) throw( CMSException ) = 0;
-            
+
         /**
          * Sets a short property.
-         * 
-         * @param name 
+         *
+         * @param name
          *      The name of the property to retrieve.
-         * @param value 
+         * @param value
          *      The value for the named property.
          * @throws CMSException
          */
         virtual void setShortProperty( const std::string& name,
             short value ) throw( CMSException ) = 0;
-            
+
         /**
          * Sets a string property.
-         * 
-         * @param name 
+         *
+         * @param name
          *      The name of the property to retrieve.
-         * @param value 
+         * @param value
          *      The value for the named property.
          * @throws CMSException
          */
         virtual void setStringProperty( const std::string& name,
             const std::string& value ) throw( CMSException ) = 0;
-      
+
         /**
          * Gets the correlation ID for the message.
-         * 
-         * This method is used to return correlation ID values that are either 
+         *
+         * This method is used to return correlation ID values that are either
          * provider-specific message IDs or application-specific String values.
-         * 
+         *
          * @return string representation of the correlation Id
          */
         virtual std::string getCMSCorrelationID() const = 0;
 
         /**
          * Sets the correlation ID for the message.
-         * 
-         * A client can use the CMSCorrelationID header field to link one 
-         * message with another. A typical use is to link a response message 
+         *
+         * A client can use the CMSCorrelationID header field to link one
+         * message with another. A typical use is to link a response message
          * with its request message.
-         * 
+         *
          * CMSCorrelationID can hold one of the following:
-         * 
+         *
          *  - A provider-specific message ID
          *  - An application-specific String
-         *  - A provider-native byte[] value 
-         * 
-         * Since each message sent by a CMS provider is assigned a message ID 
-         * value, it is convenient to link messages via message ID. All message 
+         *  - A provider-native byte[] value
+         *
+         * Since each message sent by a CMS provider is assigned a message ID
+         * value, it is convenient to link messages via message ID. All message
          * ID values must start with the 'ID:' prefix.
-         * 
-         * In some cases, an application (made up of several clients) needs to 
-         * use an application-specific value for linking messages. For instance, 
-         * an application may use CMSCorrelationID to hold a value referencing 
-         * some external information. Application-specified values must not 
-         * start with the 'ID:' prefix; this is reserved for provider-generated 
+         *
+         * In some cases, an application (made up of several clients) needs to
+         * use an application-specific value for linking messages. For instance,
+         * an application may use CMSCorrelationID to hold a value referencing
+         * some external information. Application-specified values must not
+         * start with the 'ID:' prefix; this is reserved for provider-generated
          * message ID values.
-         * 
-         * If a provider supports the native concept of correlation ID, a CMS 
-         * client may need to assign specific CMSCorrelationID values to match 
-         * those expected by clients that do not use the CMS API. A byte[] value 
-         * is used for this purpose. CMS providers without native correlation ID 
-         * values are not required to support byte[] values. The use of a byte[] 
+         *
+         * If a provider supports the native concept of correlation ID, a CMS
+         * client may need to assign specific CMSCorrelationID values to match
+         * those expected by clients that do not use the CMS API. A byte[] value
+         * is used for this purpose. CMS providers without native correlation ID
+         * values are not required to support byte[] values. The use of a byte[]
          * value for CMSCorrelationID is non-portable.
-         * 
+         *
          * @param correlationId
          *      The message ID of a message being referred to.
          */
@@ -334,150 +359,150 @@
 
         /**
          * Gets the DeliveryMode for this message
-         * 
+         *
          * @return DeliveryMode enumerated value.
          */
         virtual int getCMSDeliveryMode() const = 0;
 
         /**
          * Sets the DeliveryMode for this message
-         * 
-         * CMS providers set this field when a message is sent. This method can 
+         *
+         * CMS providers set this field when a message is sent. This method can
          * be used to change the value for a message that has been received.
-         * 
+         *
          * @param mode
          *      DeliveryMode enumerated value.
          */
         virtual void setCMSDeliveryMode( int mode ) = 0;
-      
+
         /**
          * Gets the Destination object for this message.
-         * 
-         * The CMSDestination header field contains the destination to which the 
+         *
+         * The CMSDestination header field contains the destination to which the
          * message is being sent.
-         * 
-         * When a message is sent, this field is ignored. After completion of 
-         * the send or publish method, the field holds the destination specified 
+         *
+         * When a message is sent, this field is ignored. After completion of
+         * the send or publish method, the field holds the destination specified
          * by the method.
-         * 
-         * When a message is received, its CMSDestination value must be 
+         *
+         * When a message is received, its CMSDestination value must be
          * equivalent to the value assigned when it was sent.
-         * 
+         *
          * @return Destination object
          */
         virtual const Destination* getCMSDestination() const = 0;
-      
+
         /**
          * Sets the Destination object for this message.
-         * 
-         * CMS providers set this field when a message is sent. This method can 
+         *
+         * CMS providers set this field when a message is sent. This method can
          * be used to change the value for a message that has been received.
-         * 
+         *
          * @param destination
          *      Destination Object
          */
         virtual void setCMSDestination( const Destination* destination ) = 0;
-      
+
         /**
          * Gets the message's expiration value.
-         * 
-         * When a message is sent, the CMSExpiration header field is left 
-         * unassigned. After completion of the send or publish method, it holds 
-         * the expiration time of the message. This is the sum of the 
-         * time-to-live value specified by the client and the GMT at the time 
+         *
+         * When a message is sent, the CMSExpiration header field is left
+         * unassigned. After completion of the send or publish method, it holds
+         * the expiration time of the message. This is the sum of the
+         * time-to-live value specified by the client and the GMT at the time
          * of the send or publish.
-         * 
-         * If the time-to-live is specified as zero, CMSExpiration is set to 
+         *
+         * If the time-to-live is specified as zero, CMSExpiration is set to
          * zero to indicate that the message does not expire.
-         * 
-         * When a message's expiration time is reached, a provider should 
-         * discard it. The CMS API does not define any form of notification of 
+         *
+         * When a message's expiration time is reached, a provider should
+         * discard it. The CMS API does not define any form of notification of
          * message expiration.
-         * 
-         * Clients should not receive messages that have expired; however, the 
+         *
+         * Clients should not receive messages that have expired; however, the
          * CMS API does not guarantee that this will not happen.
-         * 
-         * @return the time the message expires, which is the sum of the 
-         * time-to-live value specified by the client and the GMT at the time 
+         *
+         * @return the time the message expires, which is the sum of the
+         * time-to-live value specified by the client and the GMT at the time
          * of the send
          */
         virtual long long getCMSExpiration() const = 0;
-      
+
         /**
          * Sets the message's expiration value.
-         * 
-         * CMS providers set this field when a message is sent. This method can 
+         *
+         * CMS providers set this field when a message is sent. This method can
          * be used to change the value for a message that has been received.
-         * 
-         * @param expireTime 
+         *
+         * @param expireTime
          *      the message's expiration time
          */
         virtual void setCMSExpiration( long long expireTime ) = 0;
-      
+
         /**
-         * The CMSMessageID header field contains a value that uniquely 
-         * identifies each message sent by a provider. 
-         * 
-         * When a message is sent, CMSMessageID can be ignored. When the 
-         * send or publish method returns, it contains a provider-assigned 
+         * The CMSMessageID header field contains a value that uniquely
+         * identifies each message sent by a provider.
+         *
+         * When a message is sent, CMSMessageID can be ignored. When the
+         * send or publish method returns, it contains a provider-assigned
          * value.
-         * 
-         * A CMSMessageID is a String value that should function as a unique 
-         * key for identifying messages in a historical repository. The exact 
-         * scope of uniqueness is provider-defined. It should at least cover 
-         * all messages for a specific installation of a provider, where an 
+         *
+         * A CMSMessageID is a String value that should function as a unique
+         * key for identifying messages in a historical repository. The exact
+         * scope of uniqueness is provider-defined. It should at least cover
+         * all messages for a specific installation of a provider, where an
          * installation is some connected set of message routers.
-         * 
-         * All CMSMessageID values must start with the prefix 'ID:'. Uniqueness 
+         *
+         * All CMSMessageID values must start with the prefix 'ID:'. Uniqueness
          * of message ID values across different providers is not required.
-         * 
-         * Since message IDs take some effort to create and increase a 
-         * message's size, some CMS providers may be able to optimize message 
-         * overhead if they are given a hint that the message ID is not used by 
-         * an application. By calling the MessageProducer.setDisableMessageID 
-         * method, a CMS client enables this potential optimization for all 
-         * messages sent by that message producer. If the CMS provider accepts 
-         * this hint, these messages must have the message ID set to null; if 
-         * the provider ignores the hint, the message ID must be set to its 
+         *
+         * Since message IDs take some effort to create and increase a
+         * message's size, some CMS providers may be able to optimize message
+         * overhead if they are given a hint that the message ID is not used by
+         * an application. By calling the MessageProducer.setDisableMessageID
+         * method, a CMS client enables this potential optimization for all
+         * messages sent by that message producer. If the CMS provider accepts
+         * this hint, these messages must have the message ID set to null; if
+         * the provider ignores the hint, the message ID must be set to its
          * normal unique value.
-         * 
+         *
          * @return provider-assigned message id
          */
         virtual std::string getCMSMessageID() const = 0;
-        
+
         /**
          * Sets the message ID.
-         * 
-         * CMS providers set this field when a message is sent. This method can 
-         * be used to change the vaue for a message that has been received.
-         * 
+         *
+         * CMS providers set this field when a message is sent. This method can
+         * be used to change the value for a message that has been received.
+         *
          * @param id
          *      the ID of the message
          */
         virtual void setCMSMessageID( const std::string& id ) = 0;
-      
+
         /**
          * Gets the message priority level.
-         * 
-         * The CMS API defines ten levels of priority value, with 0 as the 
-         * lowest priority and 9 as the highest. In addition, clients should 
-         * consider priorities 0-4 as gradations of normal priority and 
+         *
+         * The CMS API defines ten levels of priority value, with 0 as the
+         * lowest priority and 9 as the highest. In addition, clients should
+         * consider priorities 0-4 as gradations of normal priority and
          * priorities 5-9 as gradations of expedited priority.
-         * 
-         * The CMS API does not require that a provider strictly implement 
-         * priority ordering of messages; however, it should do its best to 
+         *
+         * The CMS API does not require that a provider strictly implement
+         * priority ordering of messages; however, it should do its best to
          * deliver expedited messages ahead of normal messages.
-         * 
+         *
          * @return priority value
          */
         virtual int getCMSPriority() const = 0;
-      
+
         /**
          * Sets the Priority Value for this message
-         * 
-         * CMS providers set this field when a message is sent. This method can 
+         *
+         * CMS providers set this field when a message is sent. This method can
          * be used to change the value for a message that has been received.
-         * 
+         *
          * @param priority
          *      priority value for this message
          */
@@ -485,56 +510,56 @@
 
         /**
          * Gets an indication of whether this message is being redelivered.
-         * 
-         * If a client receives a message with the CMSRedelivered field set, it 
-         * is likely, but not guaranteed, that this message was delivered 
+         *
+         * If a client receives a message with the CMSRedelivered field set, it
+         * is likely, but not guaranteed, that this message was delivered
          * earlier but that its receipt was not acknowledged at that time.
-         * 
+         *
          * @return true if this message is being redelivered
          */
         virtual bool getCMSRedelivered() const = 0;
-      
+
         /**
          * Specifies whether this message is being redelivered.
-         * 
-         * This field is set at the time the message is delivered. This method 
+         *
+         * This field is set at the time the message is delivered. This method
          * can be used to change the value for a message that has been received.
-         * 
+         *
          * @param redelivered
          *      boolean redelivered value
          */
         virtual void setCMSRedelivered( bool redelivered ) = 0;
 
         /**
-         * Gets the Destination object to which a reply to this message should 
+         * Gets the Destination object to which a reply to this message should
          * be sent.
-         * 
+         *
          * @return Destination to which to send a response to this message
          */
         virtual const cms::Destination* getCMSReplyTo() const = 0;
-      
+
         /**
-         * Sets the Destination object to which a reply to this message should 
+         * Sets the Destination object to which a reply to this message should
          * be sent.
-         * 
-         * The CMSReplyTo header field contains the destination where a reply 
-         * to the current message should be sent. If it is null, no reply is 
-         * expected. The destination may be either a Queue object or a Topic 
+         *
+         * The CMSReplyTo header field contains the destination where a reply
+         * to the current message should be sent. If it is null, no reply is
+         * expected. The destination may be either a Queue object or a Topic
          * object.
-         * 
-         * Messages sent with a null CMSReplyTo value may be a notification of 
-         * some event, or they may just be some data the sender thinks is of 
+         *
+         * Messages sent with a null CMSReplyTo value may be a notification of
+         * some event, or they may just be some data the sender thinks is of
          * interest.
-         * 
-         * Messages with a CMSReplyTo value typically expect a response. A 
-         * response is optional; it is up to the client to decide. These 
-         * messages are called requests. A message sent in response to a 
+         *
+         * Messages with a CMSReplyTo value typically expect a response. A
+         * response is optional; it is up to the client to decide. These
+         * messages are called requests. A message sent in response to a
          * request is called a reply.
-         * 
-         * In some cases a client may wish to match a request it sent earlier 
-         * with a reply it has just received. The client can use the 
+         *
+         * In some cases a client may wish to match a request it sent earlier
+         * with a reply it has just received. The client can use the
          * CMSCorrelationID header field for this purpose.
-         * 
+         *
          * @param destination
          *      Destination to which to send a response to this message
          */
@@ -542,81 +567,81 @@
 
         /**
          * Gets the message timestamp.
-         * 
-         * The CMSTimestamp header field contains the time a message was handed 
-         * off to a provider to be sent. It is not the time the message was 
-         * actually transmitted, because the actual send may occur later due to 
-         * transactions or other client-side queueing of messages.
-         * 
-         * When a message is sent, CMSTimestamp is ignored. When the send or 
-         * publish method returns, it contains a time value somewhere in the 
-         * interval between the call and the return. The value is in the format 
+         *
+         * The CMSTimestamp header field contains the time a message was handed
+         * off to a provider to be sent. It is not the time the message was
+         * actually transmitted, because the actual send may occur later due to
+         * transactions or other client-side queuing of messages.
+         *
+         * When a message is sent, CMSTimestamp is ignored. When the send or
+         * publish method returns, it contains a time value somewhere in the
+         * interval between the call and the return. The value is in the format
          * of a normal millis time value in the Java programming language.
-         * 
-         * Since timestamps take some effort to create and increase a message's 
-         * size, some CMS providers may be able to optimize message overhead if 
-         * they are given a hint that the timestamp is not used by an 
-         * application. By calling the MessageProducer.setDisableMessageTimestamp 
-         * method, a CMS client enables this potential optimization for all 
-         * messages sent by that message producer. If the CMS provider accepts 
-         * this hint, these messages must have the timestamp set to zero; if the 
-         * provider ignores the hint, the timestamp must be set to its normal 
+         *
+         * Since timestamps take some effort to create and increase a message's
+         * size, some CMS providers may be able to optimize message overhead if
+         * they are given a hint that the timestamp is not used by an
+         * application. By calling the MessageProducer.setDisableMessageTimestamp
+         * method, a CMS client enables this potential optimization for all
+         * messages sent by that message producer. If the CMS provider accepts
+         * this hint, these messages must have the timestamp set to zero; if the
+         * provider ignores the hint, the timestamp must be set to its normal
          * value.
-         * 
+         *
          * @return the message timestamp
          */
         virtual long long getCMSTimestamp() const = 0;
-      
+
         /**
          * Sets the message timestamp.
-         * 
-         * CMS providers set this field when a message is sent. This method can 
+         *
+         * CMS providers set this field when a message is sent. This method can
          * be used to change the value for a message that has been received.
-         * 
+         *
          * @param timeStamp
          *      integer time stamp value
          */
         virtual void setCMSTimestamp( long long timeStamp ) = 0;
 
         /**
-         * Gets the message type identifier supplied by the client when the 
+         * Gets the message type identifier supplied by the client when the
          * message was sent.
-         * 
+         *
          * @return the message type
          * @see setCMSType
          */
         virtual std::string getCMSType() const = 0;
-      
+
         /**
          * Sets the message type.
-         * 
-         * Some CMS providers use a message repository that contains the 
-         * definitions of messages sent by applications. The CMSType header 
-         * field may reference a message's definition in the provider's 
+         *
+         * Some CMS providers use a message repository that contains the
+         * definitions of messages sent by applications. The CMSType header
+         * field may reference a message's definition in the provider's
          * repository.
-         * 
-         * The CMS API does not define a standard message definition repository, 
+         *
+         * The CMS API does not define a standard message definition repository,
          * nor does it define a naming policy for the definitions it contains.
-         * 
-         * Some messaging systems require that a message type definition for 
-         * each application message be created and that each message specify its 
-         * type. In order to work with such CMS providers, CMS clients should 
-         * assign a value to CMSType, whether the application makes use of it or 
-         * not. This ensures that the field is properly set for those providers 
+         *
+         * Some messaging systems require that a message type definition for
+         * each application message be created and that each message specify its
+         * type. In order to work with such CMS providers, CMS clients should
+         * assign a value to CMSType, whether the application makes use of it or
+         * not. This ensures that the field is properly set for those providers
          * that require it.
-         * 
-         * To ensure portability, CMS clients should use symbolic values for 
-         * CMSType that can be configured at installation time to the values 
-         * defined in the current provider's message repository. If string 
-         * literals are used, they may not be valid type names for some CMS 
+         *
+         * To ensure portability, CMS clients should use symbolic values for
+         * CMSType that can be configured at installation time to the values
+         * defined in the current provider's message repository. If string
+         * literals are used, they may not be valid type names for some CMS
          * providers.
-         * 
-         * @param type 
+         *
+         * @param type
          *      the message type
          * @see getCMSType
          */
         virtual void setCMSType( const std::string& type ) = 0;
-        
+
     };
 }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Boolean.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Boolean.cpp?rev=771329&r1=771328&r2=771329&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Boolean.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Boolean.cpp Mon May  4 15:13:46 2009
@@ -17,6 +17,8 @@
 
 #include "Boolean.h"
 #include <sstream>
+#include <apr.h>
+#include <apr_strings.h>
 
 using namespace decaf;
 using namespace decaf::lang;
@@ -94,11 +96,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 bool Boolean::parseBoolean( const std::string& value ) {
-    bool ret = 0;
-    std::istringstream istream( value );
-    istream.clear();
-    istream >> std::boolalpha >> ret;
-    return ret;
+    return apr_strnatcasecmp( value.c_str(), "true" ) == 0;
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Pointer.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Pointer.h?rev=771329&r1=771328&r2=771329&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Pointer.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Pointer.h Mon May  4 15:13:46 2009
@@ -213,7 +213,7 @@
          * @param right - Pointer on the right hand side of an operator= call to this.
          */
         Pointer& operator= ( const Pointer& right ) throw() {
-            if( this == &right ) {
+            if( this == (void*)&right ) {
                 return *this;
             }
 
@@ -223,7 +223,7 @@
         }
         template< typename T1, typename R1>
         Pointer& operator= ( const Pointer<T1, R1>& right ) throw() {
-            if( this == &right ) {
+            if( this == (void*)&right ) {
                 return *this;
             }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am?rev=771329&r1=771328&r2=771329&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am Mon May  4 15:13:46 2009
@@ -96,6 +96,7 @@
     activemq/cmsutil/CmsTemplateTest.cpp \
     activemq/util/PrimitiveValueNodeTest.cpp \
     activemq/util/LongSequenceGeneratorTest.cpp \
+    activemq/util/PrimitiveValueConverterTest.cpp \
     activemq/util/PrimitiveMapTest.cpp \
     activemq/util/MemoryUsageTest.cpp \
     activemq/util/URISupportTest.cpp \
@@ -214,6 +215,7 @@
     activemq/util/PrimitiveValueNodeTest.h \
     activemq/util/PrimitiveMapTest.h \
     activemq/util/PrimitiveListTest.h \
+    activemq/util/PrimitiveValueConverterTest.h \
     activemq/util/URISupportTest.h \
     activemq/util/LongSequenceGeneratorTest.h \
     activemq/util/MemoryUsageTest.h \

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveListTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveListTest.cpp?rev=771329&r1=771328&r2=771329&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveListTest.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/util/PrimitiveListTest.cpp Mon May  4 15:13:46 2009
@@ -155,16 +155,16 @@
         plist.getInt( plist.size() ),
         decaf::lang::exceptions::IndexOutOfBoundsException );
 
-    CPPUNIT_ASSERT( plist.get(0).getValueType() == PrimitiveValueNode::BOOLEAN_TYPE );
-    CPPUNIT_ASSERT( plist.get(1).getValueType() == PrimitiveValueNode::BYTE_TYPE );
-    CPPUNIT_ASSERT( plist.get(2).getValueType() == PrimitiveValueNode::CHAR_TYPE );
-    CPPUNIT_ASSERT( plist.get(3).getValueType() == PrimitiveValueNode::SHORT_TYPE );
-    CPPUNIT_ASSERT( plist.get(4).getValueType() == PrimitiveValueNode::INTEGER_TYPE );
-    CPPUNIT_ASSERT( plist.get(5).getValueType() == PrimitiveValueNode::LONG_TYPE );
-    CPPUNIT_ASSERT( plist.get(6).getValueType() == PrimitiveValueNode::FLOAT_TYPE );
-    CPPUNIT_ASSERT( plist.get(7).getValueType() == PrimitiveValueNode::DOUBLE_TYPE );
-    CPPUNIT_ASSERT( plist.get(8).getValueType() == PrimitiveValueNode::STRING_TYPE );
-    CPPUNIT_ASSERT( plist.get(9).getValueType() == PrimitiveValueNode::BYTE_ARRAY_TYPE );
+    CPPUNIT_ASSERT( plist.get(0).getType() == PrimitiveValueNode::BOOLEAN_TYPE );
+    CPPUNIT_ASSERT( plist.get(1).getType() == PrimitiveValueNode::BYTE_TYPE );
+    CPPUNIT_ASSERT( plist.get(2).getType() == PrimitiveValueNode::CHAR_TYPE );
+    CPPUNIT_ASSERT( plist.get(3).getType() == PrimitiveValueNode::SHORT_TYPE );
+    CPPUNIT_ASSERT( plist.get(4).getType() == PrimitiveValueNode::INTEGER_TYPE );
+    CPPUNIT_ASSERT( plist.get(5).getType() == PrimitiveValueNode::LONG_TYPE );
+    CPPUNIT_ASSERT( plist.get(6).getType() == PrimitiveValueNode::FLOAT_TYPE );
+    CPPUNIT_ASSERT( plist.get(7).getType() == PrimitiveValueNode::DOUBLE_TYPE );
+    CPPUNIT_ASSERT( plist.get(8).getType() == PrimitiveValueNode::STRING_TYPE );
+    CPPUNIT_ASSERT( plist.get(9).getType() == PrimitiveValueNode::BYTE_ARRAY_TYPE );
 }
 
 void PrimitiveListTest::testRemove(){

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?rev=771329&r1=771328&r2=771329&view=diff
==============================================================================
--- 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 Mon May  4 15:13:46 2009
@@ -27,42 +27,42 @@
     PrimitiveValueNode node;
 
     node.setBool( true );
-    CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::BOOLEAN_TYPE );
+    CPPUNIT_ASSERT( node.getType() == PrimitiveValueNode::BOOLEAN_TYPE );
     CPPUNIT_ASSERT( node.getBool() == true );
     node.setBool( false );
-    CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::BOOLEAN_TYPE );
+    CPPUNIT_ASSERT( node.getType() == PrimitiveValueNode::BOOLEAN_TYPE );
     CPPUNIT_ASSERT( node.getBool() == false );
 
     node.setByte( 5 );
-    CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::BYTE_TYPE );
+    CPPUNIT_ASSERT( node.getType() == PrimitiveValueNode::BYTE_TYPE );
     CPPUNIT_ASSERT( node.getByte() == 5 );
 
     node.setChar( 'a' );
-    CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::CHAR_TYPE );
+    CPPUNIT_ASSERT( node.getType() == PrimitiveValueNode::CHAR_TYPE );
     CPPUNIT_ASSERT( node.getChar() == 'a' );
 
     node.setShort( 10 );
-    CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::SHORT_TYPE );
+    CPPUNIT_ASSERT( node.getType() == PrimitiveValueNode::SHORT_TYPE );
     CPPUNIT_ASSERT( node.getShort() == 10 );
 
     node.setInt( 10000 );
-    CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::INTEGER_TYPE );
+    CPPUNIT_ASSERT( node.getType() == PrimitiveValueNode::INTEGER_TYPE );
     CPPUNIT_ASSERT( node.getInt() == 10000 );
 
     node.setLong( 100000L );
-    CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::LONG_TYPE );
+    CPPUNIT_ASSERT( node.getType() == PrimitiveValueNode::LONG_TYPE );
     CPPUNIT_ASSERT( node.getLong() == 100000L );
 
     node.setDouble( 2.3 );
-    CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::DOUBLE_TYPE );
+    CPPUNIT_ASSERT( node.getType() == PrimitiveValueNode::DOUBLE_TYPE );
     CPPUNIT_ASSERT( node.getDouble() == 2.3 );
 
     node.setFloat( 3.2f );
-    CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::FLOAT_TYPE );
+    CPPUNIT_ASSERT( node.getType() == PrimitiveValueNode::FLOAT_TYPE );
     CPPUNIT_ASSERT( node.getFloat() == 3.2f );
 
     node.setString( "hello" );
-    CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::STRING_TYPE );
+    CPPUNIT_ASSERT( node.getType() == PrimitiveValueNode::STRING_TYPE );
     CPPUNIT_ASSERT( node.getString() == "hello" );
 
     std::vector<unsigned char> byteArray;
@@ -72,7 +72,7 @@
     byteArray.push_back( 'd' );
 
     node.setByteArray( byteArray );
-    CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::BYTE_ARRAY_TYPE );
+    CPPUNIT_ASSERT( node.getType() == PrimitiveValueNode::BYTE_ARRAY_TYPE );
     CPPUNIT_ASSERT( node.getByteArray() == byteArray );
 
     try{
@@ -82,7 +82,7 @@
     }
 
     node.clear();
-    CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::NULL_TYPE );
+    CPPUNIT_ASSERT( node.getType() == PrimitiveValueNode::NULL_TYPE );
 }
 
 void PrimitiveMapTest::testSetGet(){
@@ -104,6 +104,7 @@
     } catch( decaf::lang::exceptions::NoSuchElementException& e ){}
     pmap.setByte( "byte", 1 );
     CPPUNIT_ASSERT( pmap.getByte("byte") == 1 );
+    CPPUNIT_ASSERT( pmap.getString("byte") == "1" );
 
     try{
         pmap.getChar( "char" );
@@ -111,6 +112,7 @@
     } catch( decaf::lang::exceptions::NoSuchElementException& e ){}
     pmap.setChar( "char", 'a' );
     CPPUNIT_ASSERT( pmap.getChar("char") == 'a' );
+    CPPUNIT_ASSERT( pmap.getString("char") == "a" );
 
     try{
         pmap.getShort( "short" );
@@ -118,6 +120,7 @@
     } catch( decaf::lang::exceptions::NoSuchElementException& e ){}
     pmap.setShort( "short", 2 );
     CPPUNIT_ASSERT( pmap.getShort("short") == 2 );
+    CPPUNIT_ASSERT( pmap.getString("short") == "2" );
 
     try{
         pmap.getInt( "int" );
@@ -125,6 +128,7 @@
     } catch( decaf::lang::exceptions::NoSuchElementException& e ){}
     pmap.setInt( "int", 3 );
     CPPUNIT_ASSERT( pmap.getInt("int") == 3 );
+    CPPUNIT_ASSERT( pmap.getString("int") == "3" );
 
     try{
         pmap.getLong( "long" );
@@ -132,6 +136,7 @@
     } catch( decaf::lang::exceptions::NoSuchElementException& e ){}
     pmap.setLong( "long", 4L );
     CPPUNIT_ASSERT( pmap.getLong("long") == 4L );
+    CPPUNIT_ASSERT( pmap.getString("long") == "4" );
 
     try{
         pmap.getDouble( "double" );
@@ -139,6 +144,7 @@
     } catch( decaf::lang::exceptions::NoSuchElementException& e ){}
     pmap.setDouble( "double", 2.3 );
     CPPUNIT_ASSERT( pmap.getDouble("double") == 2.3 );
+    CPPUNIT_ASSERT( pmap.getString("double") == "2.3" );
 
     try{
         pmap.getFloat( "float" );
@@ -146,6 +152,7 @@
     } catch( decaf::lang::exceptions::NoSuchElementException& e ){}
     pmap.setFloat( "float", 3.2f );
     CPPUNIT_ASSERT( pmap.getFloat("float") == 3.2f );
+    CPPUNIT_ASSERT( pmap.getString("float") == "3.2" );
 
     try{
         pmap.getString( "string" );



Mime
View raw message