activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r727128 - in /activemq/activemq-cpp/trunk/src/test/decaf/net: URITest.cpp URITest.h
Date Tue, 16 Dec 2008 20:17:30 GMT
Author: tabish
Date: Tue Dec 16 12:17:30 2008
New Revision: 727128

URL: http://svn.apache.org/viewvc?rev=727128&view=rev
Log:
Initial URI class test cases

Modified:
    activemq/activemq-cpp/trunk/src/test/decaf/net/URITest.cpp
    activemq/activemq-cpp/trunk/src/test/decaf/net/URITest.h

Modified: activemq/activemq-cpp/trunk/src/test/decaf/net/URITest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/decaf/net/URITest.cpp?rev=727128&r1=727127&r2=727128&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/decaf/net/URITest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/decaf/net/URITest.cpp Tue Dec 16 12:17:30 2008
@@ -176,3 +176,31 @@
 //        uri.parseServerAuthority(),
 //        URISyntaxException );
 }
+
+////////////////////////////////////////////////////////////////////////////////
+void URITest::test_URI_String() {
+
+    try {
+        URI myUri(":abc@mymail.com");
+        CPPUNIT_FAIL("TestA, URISyntaxException expected, but not received.");
+    } catch( URISyntaxException& e ) {
+        CPPUNIT_ASSERT_MESSAGE(
+            "TestA, Wrong URISyntaxException index, ", 0 == e.getIndex());
+    }
+
+    try {
+        URI uri("path[one");
+        CPPUNIT_FAIL("TestB, URISyntaxException expected, but not received.");
+    } catch( URISyntaxException& e1 ) {
+        CPPUNIT_ASSERT_MESSAGE(
+            "TestB, Wrong URISyntaxException index, ", 4 == e1.getIndex());
+    }
+
+    try {
+        URI uri(" ");
+        CPPUNIT_FAIL("TestC, URISyntaxException expected, but not received.");
+    } catch( URISyntaxException& e2 ) {
+        CPPUNIT_ASSERT_MESSAGE(
+            "TestC, Wrong URISyntaxException index, ", 0 == e2.getIndex());
+    }
+}

Modified: activemq/activemq-cpp/trunk/src/test/decaf/net/URITest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/decaf/net/URITest.h?rev=727128&r1=727127&r2=727128&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/decaf/net/URITest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/decaf/net/URITest.h Tue Dec 16 12:17:30 2008
@@ -28,6 +28,7 @@
 
         CPPUNIT_TEST_SUITE( URITest );
         CPPUNIT_TEST( test_Constructor_String );
+        CPPUNIT_TEST( test_URI_String );
         CPPUNIT_TEST_SUITE_END();
 
     public:
@@ -36,6 +37,7 @@
         virtual ~URITest() {}
 
         void test_Constructor_String();
+        void test_URI_String();
 
     };
 



Mime
View raw message