activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r944371 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/test: Makefile.am decaf/net/ssl/ decaf/net/ssl/SSLSocketFactoryTest.cpp decaf/net/ssl/SSLSocketFactoryTest.h testRegistry.cpp
Date Fri, 14 May 2010 18:18:53 GMT
Author: tabish
Date: Fri May 14 18:18:53 2010
New Revision: 944371

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

Add a new unit test for the SSLSocketFactory

Added:
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/net/ssl/
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/net/ssl/SSLSocketFactoryTest.cpp
  (with props)
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/net/ssl/SSLSocketFactoryTest.h
  (with props)
Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/testRegistry.cpp

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=944371&r1=944370&r2=944371&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/Makefile.am Fri May 14 18:18:53 2010
@@ -121,6 +121,7 @@ cc_sources = \
     decaf/net/URITest.cpp \
     decaf/net/URLDecoderTest.cpp \
     decaf/net/URLEncoderTest.cpp \
+    decaf/net/ssl/SSLSocketFactoryTest.cpp \
     decaf/nio/BufferTest.cpp \
     decaf/util/DateTest.cpp \
     decaf/util/Endian.cpp \
@@ -271,6 +272,7 @@ h_sources = \
     decaf/net/URITest.h \
     decaf/net/URLDecoderTest.h \
     decaf/net/URLEncoderTest.h \
+    decaf/net/ssl/SSLSocketFactoryTest.h \
     decaf/nio/BufferTest.h \
     decaf/util/DateTest.h \
     decaf/util/Endian.h \

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/net/ssl/SSLSocketFactoryTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/net/ssl/SSLSocketFactoryTest.cpp?rev=944371&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/net/ssl/SSLSocketFactoryTest.cpp
(added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/net/ssl/SSLSocketFactoryTest.cpp
Fri May 14 18:18:53 2010
@@ -0,0 +1,56 @@
+/*
+ * 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 "SSLSocketFactoryTest.h"
+
+#include <decaf/net/ssl/SSLSocketFactory.h>
+#include <decaf/io/IOException.h>
+
+using namespace decaf;
+using namespace decaf::io;
+using namespace decaf::net;
+using namespace decaf::net::ssl;
+
+////////////////////////////////////////////////////////////////////////////////
+SSLSocketFactoryTest::SSLSocketFactoryTest() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+SSLSocketFactoryTest::~SSLSocketFactoryTest() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void SSLSocketFactoryTest::testGetDefault() {
+
+    SocketFactory* factory = SSLSocketFactory::getDefault();
+
+    CPPUNIT_ASSERT( factory != NULL );
+
+#ifdef HAVE_OPENSSL
+
+    Socket* sock = factory->createSocket();
+    CPPUNIT_ASSERT( sock != NULL );
+
+#else
+
+    CPUNIT_ASSERT_THROW_MESSAGE(
+        "Should have thrown an IOException",
+        factory->createSocket(),
+        IOException );
+
+#endif
+}

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/net/ssl/SSLSocketFactoryTest.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/net/ssl/SSLSocketFactoryTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/net/ssl/SSLSocketFactoryTest.h?rev=944371&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/net/ssl/SSLSocketFactoryTest.h
(added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/net/ssl/SSLSocketFactoryTest.h
Fri May 14 18:18:53 2010
@@ -0,0 +1,45 @@
+/*
+ * 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_SSL_SSLSOCKETFACTORYTEST_H_
+#define _DECAF_NET_SSL_SSLSOCKETFACTORYTEST_H_
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+namespace decaf {
+namespace net {
+namespace ssl {
+
+    class SSLSocketFactoryTest : public CppUnit::TestFixture {
+
+        CPPUNIT_TEST_SUITE( SSLSocketFactoryTest );
+        CPPUNIT_TEST( testGetDefault );
+        CPPUNIT_TEST_SUITE_END();
+
+    public:
+
+        SSLSocketFactoryTest();
+        virtual ~SSLSocketFactoryTest();
+
+        void testGetDefault();
+
+    };
+
+}}}
+
+#endif /* _DECAF_NET_SSL_SSLSOCKETFACTORYTEST_H_ */

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/net/ssl/SSLSocketFactoryTest.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/testRegistry.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/testRegistry.cpp?rev=944371&r1=944370&r2=944371&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/testRegistry.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/testRegistry.cpp Fri May 14 18:18:53
2010
@@ -249,6 +249,9 @@ CPPUNIT_TEST_SUITE_REGISTRATION( decaf::
 //#include <decaf/net/URLDecoderTest.h>
 //CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::URLDecoderTest );
 //
+#include <decaf/net/ssl/SSLSocketFactoryTest.h>
+CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::ssl::SSLSocketFactoryTest );
+//
 //#include <decaf/util/concurrent/ConcurrentStlMapTest.h>
 //CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::ConcurrentStlMapTest );
 //#include <decaf/util/concurrent/CountDownLatchTest.h>



Mime
View raw message