You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2007/08/15 16:40:18 UTC

svn commit: r566197 - in /activemq/activemq-cpp/trunk/src/decaf/src/test: Makefile.am decaf/net/URISyntaxExceptionTest.cpp decaf/net/URISyntaxExceptionTest.h testRegistry.cpp

Author: tabish
Date: Wed Aug 15 07:40:17 2007
New Revision: 566197

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

Adding start of URI class

Added:
    activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/net/URISyntaxExceptionTest.cpp
    activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/net/URISyntaxExceptionTest.h
Modified:
    activemq/activemq-cpp/trunk/src/decaf/src/test/Makefile.am
    activemq/activemq-cpp/trunk/src/decaf/src/test/testRegistry.cpp

Modified: activemq/activemq-cpp/trunk/src/decaf/src/test/Makefile.am
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/test/Makefile.am?view=diff&rev=566197&r1=566196&r2=566197
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/test/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/test/Makefile.am Wed Aug 15 07:40:17 2007
@@ -37,6 +37,7 @@
   decaf/net/SocketFactoryTest.cpp \
   decaf/net/SocketTest.cpp \
   decaf/net/URITest.cpp \
+  decaf/net/URISyntaxExceptionTest.cpp \
   decaf/util/StringTokenizerTest.cpp \
   decaf/util/Endian.cpp \
   decaf/util/DateTest.cpp \
@@ -73,6 +74,7 @@
   decaf/net/SocketFactoryTest.h \
   decaf/net/SocketTest.h \
   decaf/net/URITest.h \
+  decaf/net/URISyntaxExceptionTest.h \
   decaf/util/StringTokenizerTest.h \
   decaf/util/Endian.h \
   decaf/util/DateTest.h \

Added: activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/net/URISyntaxExceptionTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/net/URISyntaxExceptionTest.cpp?view=auto&rev=566197
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/net/URISyntaxExceptionTest.cpp (added)
+++ activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/net/URISyntaxExceptionTest.cpp Wed Aug 15 07:40:17 2007
@@ -0,0 +1,42 @@
+/*
+ * 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 "URISyntaxExceptionTest.h"
+
+#include <decaf/net/URISyntaxException.h>
+
+using namespace decaf;
+using namespace decaf::net;
+
+////////////////////////////////////////////////////////////////////////////////
+URISyntaxExceptionTest::URISyntaxExceptionTest() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void URISyntaxExceptionTest::test() {
+
+    URISyntaxException e1( __FILE__, __LINE__, "str", "problem", 2);
+    CPPUNIT_ASSERT_MESSAGE("returned incorrect reason",
+                           e1.getReason() == "problem" );
+    CPPUNIT_ASSERT_MESSAGE("returned incorrect input", e1.getInput() == "str" );
+    CPPUNIT_ASSERT_MESSAGE("returned incorrect index", 2 == e1.getIndex());
+
+    URISyntaxException e2( __FILE__, __LINE__, "str", "problem");
+    CPPUNIT_ASSERT_MESSAGE("returned incorrect reason", e2.getReason() == "problem" );
+    CPPUNIT_ASSERT_MESSAGE("returned incorrect input", e2.getInput() == "str" );
+    CPPUNIT_ASSERT_MESSAGE("returned incorrect index", -1 == e2.getIndex());
+}

Added: activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/net/URISyntaxExceptionTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/net/URISyntaxExceptionTest.h?view=auto&rev=566197
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/net/URISyntaxExceptionTest.h (added)
+++ activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/net/URISyntaxExceptionTest.h Wed Aug 15 07:40:17 2007
@@ -0,0 +1,43 @@
+/*
+ * 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 _DECAF_NET_URISYNTAXEXCEPTIONTEST_H_
+#define _DECAF_NET_URISYNTAXEXCEPTIONTEST_H_
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+namespace decaf{
+namespace net{
+
+    class URISyntaxExceptionTest : public CppUnit::TestFixture {
+
+        CPPUNIT_TEST_SUITE( URISyntaxExceptionTest );
+        CPPUNIT_TEST( test );
+        CPPUNIT_TEST_SUITE_END();
+
+    public:
+
+        URISyntaxExceptionTest();
+        virtual ~URISyntaxExceptionTest() {}
+
+        void test();
+    };
+
+}}
+
+#endif /*_DECAF_NET_URISYNTAXEXCEPTIONTEST_H_*/

Modified: activemq/activemq-cpp/trunk/src/decaf/src/test/testRegistry.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/test/testRegistry.cpp?view=diff&rev=566197&r1=566196&r2=566197
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/test/testRegistry.cpp (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/test/testRegistry.cpp Wed Aug 15 07:40:17 2007
@@ -62,6 +62,8 @@
 //CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::SocketTest );
 #include <decaf/net/URITest.h>
 CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::URITest );
+#include <decaf/net/URISyntaxExceptionTest.h>
+CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::URISyntaxExceptionTest );
 //
 //#include <decaf/util/concurrent/CountDownLatchTest.h>
 //CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::CountDownLatchTest );