activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r545294 - in /activemq/activemq-cpp/trunk/src/test-integration: ./ integration/ integration/connector/openwire/ integration/connector/stomp/
Date Thu, 07 Jun 2007 20:12:20 GMT
Author: tabish
Date: Thu Jun  7 13:12:15 2007
New Revision: 545294

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

Added some integ tests to help with testing

Added:
    activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/StompStressTests.cpp
    activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/StompStressTests.h
Modified:
    activemq/activemq-cpp/trunk/src/test-integration/Makefile.am
    activemq/activemq-cpp/trunk/src/test-integration/integration/TestRegistry.cpp
    activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireSimpleTest.cpp
    activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireSimpleTest.h

Modified: activemq/activemq-cpp/trunk/src/test-integration/Makefile.am
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/Makefile.am?view=diff&rev=545294&r1=545293&r2=545294
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/src/test-integration/Makefile.am Thu Jun  7 13:12:15 2007
@@ -33,6 +33,7 @@
   integration/connector/stomp/SimpleRollbackTest.cpp \
   integration/connector/stomp/SimpleTest.cpp \
   integration/connector/stomp/TransactionTest.cpp \
+  integration/connector/stomp/StompStressTests.cpp \
   main.cpp
 
 ## Compile this as part of make check

Modified: activemq/activemq-cpp/trunk/src/test-integration/integration/TestRegistry.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/integration/TestRegistry.cpp?view=diff&rev=545294&r1=545293&r2=545294
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/integration/TestRegistry.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test-integration/integration/TestRegistry.cpp Thu Jun
 7 13:12:15 2007
@@ -13,6 +13,7 @@
 #include "connector/stomp/SimpleRollbackTest.h"
 #include "connector/stomp/SimpleTest.h"
 #include "connector/stomp/TransactionTest.h"
+#include "connector/stomp/StompStressTests.h"
 
 CPPUNIT_TEST_SUITE_REGISTRATION( integration::connector::openwire::OpenwireAsyncSenderTest
);
 CPPUNIT_TEST_SUITE_REGISTRATION( integration::connector::openwire::OpenwireDurableTest );
@@ -29,3 +30,4 @@
 CPPUNIT_TEST_SUITE_REGISTRATION( integration::connector::stomp::SimpleRollbackTest );
 CPPUNIT_TEST_SUITE_REGISTRATION( integration::connector::stomp::SimpleTest );
 CPPUNIT_TEST_SUITE_REGISTRATION( integration::connector::stomp::TransactionTest );
+CPPUNIT_TEST_SUITE_REGISTRATION( integration::connector::stomp::StompStressTests );

Modified: activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireSimpleTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireSimpleTest.cpp?view=diff&rev=545294&r1=545293&r2=545294
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireSimpleTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireSimpleTest.cpp
Thu Jun  7 13:12:15 2007
@@ -471,3 +471,18 @@
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
 }
+
+void OpenwireSimpleTest::testQuickCreateAndDestroy() {
+    try{
+
+        activemq::core::ActiveMQConnectionFactory connectionFactory(
+            "tcp://localhost:61616?wireFormat=openwire");
+        cms::Connection* connection = connectionFactory.createConnection();
+        cms::Session* session = connection->createSession(cms::Session::AUTO_ACKNOWLEDGE);
+        delete session;
+        delete connection;
+    } catch ( CMSException& e ) {
+        e.printStackTrace();
+        CPPUNIT_ASSERT( false );
+    }
+}

Modified: activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireSimpleTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireSimpleTest.h?view=diff&rev=545294&r1=545293&r2=545294
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireSimpleTest.h
(original)
+++ activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireSimpleTest.h
Thu Jun  7 13:12:15 2007
@@ -26,7 +26,7 @@
 namespace integration{
 namespace connector{
 namespace openwire{
-    
+
     class OpenwireSimpleTest : public CppUnit::TestFixture
     {
         CPPUNIT_TEST_SUITE( OpenwireSimpleTest );
@@ -37,12 +37,13 @@
         CPPUNIT_TEST( testMultipleConnections );
         CPPUNIT_TEST( testMultipleSessions );
         CPPUNIT_TEST( testReceiveAlreadyInQueue );
+        CPPUNIT_TEST( testQuickCreateAndDestroy );
         CPPUNIT_TEST_SUITE_END();
-        
+
     public:
 
-    	OpenwireSimpleTest();
-    	virtual ~OpenwireSimpleTest();
+        OpenwireSimpleTest();
+        virtual ~OpenwireSimpleTest();
 
         virtual void testAutoAck();
         virtual void testClientAck();
@@ -51,6 +52,8 @@
         virtual void testMultipleConnections();
         virtual void testMultipleSessions();
         virtual void testReceiveAlreadyInQueue();
+        virtual void testQuickCreateAndDestroy();
+
     };
 
 }}}

Added: activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/StompStressTests.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/StompStressTests.cpp?view=auto&rev=545294
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/StompStressTests.cpp
(added)
+++ activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/StompStressTests.cpp
Thu Jun  7 13:12:15 2007
@@ -0,0 +1,97 @@
+/*
+ * 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 "StompStressTests.h"
+
+#include <integration/IntegrationCommon.h>
+
+#include <activemq/concurrent/Thread.h>
+#include <activemq/connector/stomp/StompConnector.h>
+#include <activemq/util/Properties.h>
+#include <activemq/transport/TransportFactory.h>
+#include <activemq/util/Guid.h>
+#include <activemq/util/Properties.h>
+#include <activemq/util/StringTokenizer.h>
+#include <activemq/connector/ConnectorFactoryMap.h>
+#include <activemq/network/SocketFactory.h>
+#include <activemq/transport/TransportFactory.h>
+#include <activemq/network/Socket.h>
+#include <activemq/exceptions/NullPointerException.h>
+#include <activemq/core/ActiveMQConnectionFactory.h>
+#include <activemq/core/ActiveMQConnection.h>
+#include <activemq/core/ActiveMQConsumer.h>
+#include <activemq/core/ActiveMQProducer.h>
+#include <activemq/util/StringTokenizer.h>
+#include <activemq/util/Boolean.h>
+
+#include <cms/Connection.h>
+#include <cms/MessageConsumer.h>
+#include <cms/MessageProducer.h>
+#include <cms/MessageListener.h>
+#include <cms/Startable.h>
+#include <cms/Closeable.h>
+#include <cms/MessageListener.h>
+#include <cms/ExceptionListener.h>
+#include <cms/Topic.h>
+#include <cms/Queue.h>
+#include <cms/TemporaryTopic.h>
+#include <cms/TemporaryQueue.h>
+#include <cms/Session.h>
+#include <cms/BytesMessage.h>
+#include <cms/TextMessage.h>
+#include <cms/MapMessage.h>
+
+using namespace activemq::connector::stomp;
+using namespace activemq::transport;
+using namespace activemq::util;
+using namespace std;
+using namespace cms;
+using namespace activemq;
+using namespace activemq::core;
+using namespace activemq::util;
+using namespace activemq::connector;
+using namespace activemq::exceptions;
+using namespace activemq::network;
+using namespace activemq::transport;
+using namespace activemq::concurrent;
+
+using namespace integration;
+using namespace integration::connector::stomp;
+
+void StompStressTests::testRapidCreate()
+{
+    try {
+        int count = 0;
+        activemq::core::ActiveMQConnectionFactory connectionFactory(
+            "tcp://localhost:61613?wireFormat=stomp");
+        while( count < 20 ) {
+
+            cms::Connection* connection = connectionFactory.createConnection();
+            cms::Session* session = connection->createSession(cms::Session::AUTO_ACKNOWLEDGE);
+            cms::Topic* topic = session->createTopic("topic");
+            cms::MessageProducer* producer = session->createProducer(topic);
+            delete producer;
+            delete topic;
+            delete session;
+            delete connection;
+            count++;
+        }
+    } catch ( CMSException& e ) {
+        e.printStackTrace();
+        CPPUNIT_ASSERT( false );
+    }
+}

Added: activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/StompStressTests.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/StompStressTests.h?view=auto&rev=545294
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/StompStressTests.h
(added)
+++ activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/StompStressTests.h
Thu Jun  7 13:12:15 2007
@@ -0,0 +1,47 @@
+/*
+ * 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 _INTEGRATION_CONNECTOR_STOMP_STOMPSTRESSTESTS_H_
+#define _INTEGRATION_CONNECTOR_STOMP_STOMPSTRESSTESTS_H_
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+#include <integration/TestSupport.h>
+
+namespace integration{
+namespace connector{
+namespace stomp{
+
+    class StompStressTests : public CppUnit::TestFixture
+    {
+        CPPUNIT_TEST_SUITE( StompStressTests );
+        CPPUNIT_TEST( testRapidCreate );
+        CPPUNIT_TEST_SUITE_END();
+
+    public:
+
+        StompStressTests() {}
+        virtual ~StompStressTests() {}
+
+        void testRapidCreate();
+
+    };
+
+}}}
+
+#endif /*_INTEGRATION_CONNECTOR_STOMP_STOMPSTRESSTESTS_H_*/



Mime
View raw message