activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1075339 - in /activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src: main/activemq/util/URISupport.cpp test/activemq/util/URISupportTest.cpp
Date Mon, 28 Feb 2011 14:16:29 GMT
Author: tabish
Date: Mon Feb 28 14:16:29 2011
New Revision: 1075339

URL: http://svn.apache.org/viewvc?rev=1075339&view=rev
Log:
merge fix for https://issues.apache.org/jira/browse/AMQCPP-352 with new tests to verify.

Modified:
    activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/activemq/util/URISupport.cpp
    activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/test/activemq/util/URISupportTest.cpp

Modified: activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/activemq/util/URISupport.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/activemq/util/URISupport.cpp?rev=1075339&r1=1075338&r2=1075339&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/activemq/util/URISupport.cpp
(original)
+++ activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/main/activemq/util/URISupport.cpp
Mon Feb 28 14:16:29 2011
@@ -347,7 +347,7 @@ StlList<std::string> URISupport::splitCo
             break;
         case ',':
             if( depth == 0 ) {
-                std::string s = str.substr( last, i );
+                std::string s = str.substr( last, i - last );
                 components.add( s );
                 last = i + 1;
             }

Modified: activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/test/activemq/util/URISupportTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/test/activemq/util/URISupportTest.cpp?rev=1075339&r1=1075338&r2=1075339&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/test/activemq/util/URISupportTest.cpp
(original)
+++ activemq/activemq-cpp/branches/activemq-cpp-3.2.x/activemq-cpp/src/test/activemq/util/URISupportTest.cpp
Mon Feb 28 14:16:29 2011
@@ -193,4 +193,20 @@ void URISupportTest::testParseComposite(
     CPPUNIT_ASSERT( data.getComponents().get(0).toString() ==
                     "tcp://localhost:61616" );
 
+    data = URISupport::parseComposite(
+        URI( "test:(part1://host,part2://host,part3://host,part4://host)" ) );
+    CPPUNIT_ASSERT( 4 == data.getComponents().size() );
+    CPPUNIT_ASSERT( data.getComponents().get(0).toString() == "part1://host" );
+    CPPUNIT_ASSERT( data.getComponents().get(1).toString() == "part2://host" );
+    CPPUNIT_ASSERT( data.getComponents().get(2).toString() == "part3://host" );
+    CPPUNIT_ASSERT( data.getComponents().get(3).toString() == "part4://host" );
+
+    data = URISupport::parseComposite(
+        URI( "test:(part1://host,part2://host,part3://host,part4://host?option=value)" )
);
+    CPPUNIT_ASSERT( 4 == data.getComponents().size() );
+    CPPUNIT_ASSERT( data.getComponents().get(0).toString() == "part1://host" );
+    CPPUNIT_ASSERT( data.getComponents().get(1).toString() == "part2://host" );
+    CPPUNIT_ASSERT( data.getComponents().get(2).toString() == "part3://host" );
+    CPPUNIT_ASSERT( data.getComponents().get(3).toString() == "part4://host?option=value"
);
+
 }



Mime
View raw message