Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 3646 invoked from network); 7 Jun 2007 20:12:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Jun 2007 20:12:43 -0000 Received: (qmail 92496 invoked by uid 500); 7 Jun 2007 20:12:47 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 92445 invoked by uid 500); 7 Jun 2007 20:12:47 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 92436 invoked by uid 99); 7 Jun 2007 20:12:47 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jun 2007 13:12:47 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jun 2007 13:12:41 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 24B4B1A981A; Thu, 7 Jun 2007 13:12:21 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070607201221.24B4B1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +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 +#include + +#include + +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_*/