Author: tabish
Date: Wed May 9 14:34:58 2012
New Revision: 1336226
URL: http://svn.apache.org/viewvc?rev=1336226&view=rev
Log:
Add in new tests for Connection start / stop concurrently
Added:
activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/CmsConnectionStartStopTest.cpp
(with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/CmsConnectionStartStopTest.h
(with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireCmsConnectionStartStopTest.cpp
(with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireCmsConnectionStartStopTest.h
(with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/stomp/StompCmsConnectionStartStopTest.cpp
(with props)
activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/stomp/StompCmsConnectionStartStopTest.h
(with props)
Modified:
activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/Makefile.am
activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/TestRegistry.cpp
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/Makefile.am
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/Makefile.am?rev=1336226&r1=1336225&r2=1336226&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/Makefile.am Wed May 9 14:34:58
2012
@@ -18,6 +18,7 @@
cc_sources = \
TestRegistry.cpp \
activemq/test/AsyncSenderTest.cpp \
+ activemq/test/CmsConnectionStartStopTest.cpp \
activemq/test/CmsTemplateTest.cpp \
activemq/test/DurableTest.cpp \
activemq/test/ExpirationTest.cpp \
@@ -34,6 +35,7 @@ cc_sources = \
activemq/test/openwire/OpenwireAdvisorysTest.cpp \
activemq/test/openwire/OpenwireAsyncSenderTest.cpp \
activemq/test/openwire/OpenwireClientAckTest.cpp \
+ activemq/test/openwire/OpenwireCmsConnectionStartStopTest.cpp \
activemq/test/openwire/OpenwireCmsTemplateTest.cpp \
activemq/test/openwire/OpenwireDurableTest.cpp \
activemq/test/openwire/OpenwireExpirationTest.cpp \
@@ -52,6 +54,7 @@ cc_sources = \
activemq/test/openwire/OpenwireVirtualTopicTest.cpp \
activemq/test/openwire/OpenwireXATransactionsTest.cpp \
activemq/test/stomp/StompAsyncSenderTest.cpp \
+ activemq/test/stomp/StompCmsConnectionStartStopTest.cpp \
activemq/test/stomp/StompCmsTemplateTest.cpp \
activemq/test/stomp/StompDurableTest.cpp \
activemq/test/stomp/StompExpirationTest.cpp \
@@ -70,6 +73,7 @@ cc_sources = \
h_sources = \
activemq/test/AsyncSenderTest.h \
activemq/test/CMSTestFixture.h \
+ activemq/test/CmsConnectionStartStopTest.h \
activemq/test/CmsTemplateTest.h \
activemq/test/DurableTest.h \
activemq/test/ExpirationTest.h \
@@ -86,6 +90,7 @@ h_sources = \
activemq/test/openwire/OpenwireAdvisorysTest.h \
activemq/test/openwire/OpenwireAsyncSenderTest.h \
activemq/test/openwire/OpenwireClientAckTest.h \
+ activemq/test/openwire/OpenwireCmsConnectionStartStopTest.h \
activemq/test/openwire/OpenwireCmsTemplateTest.h \
activemq/test/openwire/OpenwireDurableTest.h \
activemq/test/openwire/OpenwireExpirationTest.h \
@@ -104,6 +109,7 @@ h_sources = \
activemq/test/openwire/OpenwireVirtualTopicTest.h \
activemq/test/openwire/OpenwireXATransactionsTest.h \
activemq/test/stomp/StompAsyncSenderTest.h \
+ activemq/test/stomp/StompCmsConnectionStartStopTest.h \
activemq/test/stomp/StompCmsTemplateTest.h \
activemq/test/stomp/StompDurableTest.h \
activemq/test/stomp/StompExpirationTest.h \
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/TestRegistry.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/TestRegistry.cpp?rev=1336226&r1=1336225&r2=1336226&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/TestRegistry.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/TestRegistry.cpp Wed May
9 14:34:58 2012
@@ -19,6 +19,7 @@
#include "activemq/test/openwire/OpenwireAsyncSenderTest.h"
#include "activemq/test/openwire/OpenwireClientAckTest.h"
#include "activemq/test/openwire/OpenwireCmsTemplateTest.h"
+#include "activemq/test/openwire/OpenwireCmsConnectionStartStopTest.h"
#include "activemq/test/openwire/OpenwireDurableTest.h"
#include "activemq/test/openwire/OpenwireExpirationTest.h"
#include "activemq/test/openwire/OpenwireIndividualAckTest.h"
@@ -38,6 +39,7 @@
#include "activemq/test/stomp/StompAsyncSenderTest.h"
#include "activemq/test/stomp/StompCmsTemplateTest.h"
+#include "activemq/test/stomp/StompCmsConnectionStartStopTest.h"
#include "activemq/test/stomp/StompDurableTest.h"
#include "activemq/test/stomp/StompExpirationTest.h"
#include "activemq/test/stomp/StompSimpleRollbackTest.h"
@@ -51,6 +53,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION( activem
CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireAsyncSenderTest );
CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireClientAckTest );
CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireCmsTemplateTest );
+CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireCmsConnectionStartStopTest
);
CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireDurableTest );
CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireExpirationTest );
CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireIndividualAckTest );
@@ -71,6 +74,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION( activem
// Stomp Tests
//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::stomp::StompAsyncSenderTest );
//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::stomp::StompCmsTemplateTest );
+//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::stomp::StompCmsConnectionStartStopTest
);
//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::stomp::StompDurableTest );
//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::stomp::StompExpirationTest );
//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::stomp::StompSimpleTest );
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/CmsConnectionStartStopTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/CmsConnectionStartStopTest.cpp?rev=1336226&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/CmsConnectionStartStopTest.cpp
(added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/CmsConnectionStartStopTest.cpp
Wed May 9 14:34:58 2012
@@ -0,0 +1,190 @@
+/*
+ * 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 "CmsConnectionStartStopTest.h"
+
+#include <activemq/core/ActiveMQConnectionFactory.h>
+#include <activemq/exceptions/ActiveMQException.h>
+
+#include <decaf/lang/Runnable.h>
+#include <decaf/lang/Pointer.h>
+#include <decaf/lang/Integer.h>
+#include <decaf/util/Random.h>
+#include <decaf/util/concurrent/CopyOnWriteArrayList.h>
+#include <decaf/util/concurrent/TimeUnit.h>
+#include <decaf/util/concurrent/ThreadPoolExecutor.h>
+#include <decaf/util/concurrent/LinkedBlockingQueue.h>
+
+using namespace std;
+using namespace cms;
+using namespace activemq;
+using namespace activemq::test;
+using namespace activemq::core;
+using namespace activemq::exceptions;
+
+using namespace decaf;
+using namespace decaf::util;
+using namespace decaf::util::concurrent;
+using namespace decaf::lang;
+
+////////////////////////////////////////////////////////////////////////////////
+CmsConnectionStartStopTest::CmsConnectionStartStopTest() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CmsConnectionStartStopTest::~CmsConnectionStartStopTest() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CmsConnectionStartStopTest::setUp() {
+
+ CMSTestFixture::setUp();
+
+ Pointer<ActiveMQConnectionFactory> factory(new ActiveMQConnectionFactory(cmsProvider->getBrokerURL()));
+
+ startedConnection.reset(factory->createConnection());
+ startedConnection->start();
+ stoppedConnection.reset(factory->createConnection());
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CmsConnectionStartStopTest::tearDown() {
+
+ startedConnection->close();
+ stoppedConnection->close();
+
+ startedConnection.reset(NULL);
+ stoppedConnection.reset(NULL);
+
+ CMSTestFixture::tearDown();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CmsConnectionStartStopTest::testStoppedConsumerHoldsMessagesTillStarted() {
+
+ Pointer<Session> startedSession(startedConnection->createSession());
+ Pointer<Session> stoppedSession(stoppedConnection->createSession());
+
+ // Setup the consumers.
+ Pointer<Topic> topic(startedSession->createTopic("test"));
+ Pointer<MessageConsumer> startedConsumer(startedSession->createConsumer(topic.get()));
+ Pointer<MessageConsumer> stoppedConsumer(stoppedSession->createConsumer(topic.get()));
+
+ // Send the message.
+ Pointer<MessageProducer> producer(startedSession->createProducer(topic.get()));
+ Pointer<TextMessage> message(startedSession->createTextMessage("Hello"));
+ producer->send(message.get());
+
+ // Test the assertions.
+ Pointer<Message> m(startedConsumer->receive(2000));
+ CPPUNIT_ASSERT(m != NULL);
+
+ m.reset(stoppedConsumer->receive(2000));
+ CPPUNIT_ASSERT(m == NULL);
+
+ stoppedConnection->start();
+ m.reset(stoppedConsumer->receive(5000));
+ CPPUNIT_ASSERT(m != NULL);
+
+ startedSession->close();
+ stoppedSession->close();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CmsConnectionStartStopTest::testMultipleConnectionStops() {
+
+ testStoppedConsumerHoldsMessagesTillStarted();
+ stoppedConnection->stop();
+ testStoppedConsumerHoldsMessagesTillStarted();
+ stoppedConnection->stop();
+ testStoppedConsumerHoldsMessagesTillStarted();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+namespace {
+
+ class CreateSessionRunnable : public Runnable {
+ private:
+
+ Connection* connection;
+ Random rand;
+ CopyOnWriteArrayList<std::string>* exceptions;
+
+ public:
+
+ CreateSessionRunnable(Connection* connection, CopyOnWriteArrayList<std::string>*
exceptions) :
+ Runnable(), connection(connection), rand(), exceptions(exceptions) {
+ }
+
+ virtual ~CreateSessionRunnable() {}
+
+ virtual void run() {
+ try {
+ TimeUnit::MILLISECONDS.sleep(rand.nextInt(10));
+ Pointer<Session>(connection->createSession());
+ } catch (CMSException& e) {
+ exceptions->add(e.getMessage());
+ }
+ }
+ };
+
+ class StartStopRunnable : public Runnable {
+ private:
+
+ Connection* connection;
+ Random rand;
+ CopyOnWriteArrayList<std::string>* exceptions;
+
+ public:
+
+ StartStopRunnable(Connection* connection, CopyOnWriteArrayList<std::string>*
exceptions) :
+ Runnable(), connection(connection), rand(), exceptions(exceptions) {
+ }
+
+ virtual ~StartStopRunnable() {}
+
+ virtual void run() {
+ try {
+ TimeUnit::MILLISECONDS.sleep(rand.nextInt(10));
+ connection->start();
+ connection->stop();
+ } catch (CMSException& e) {
+ exceptions->add(e.getMessage());
+ }
+
+ }
+ };
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CmsConnectionStartStopTest::testConcurrentSessionCreateWithStart() {
+
+ ThreadPoolExecutor executor(50, Integer::MAX_VALUE, 60LL, TimeUnit::SECONDS, new LinkedBlockingQueue<Runnable*>());
+
+ CopyOnWriteArrayList<std::string> exceptions;
+ Random rand;
+
+ for (int i=0; i<1000; i++) {
+ executor.execute(new CreateSessionRunnable(stoppedConnection.get(), &exceptions));
+ executor.execute(new StartStopRunnable(stoppedConnection.get(), &exceptions));
+ }
+
+ executor.shutdown();
+ CPPUNIT_ASSERT_MESSAGE("executor terminated", executor.awaitTermination(45, TimeUnit::SECONDS));
+ CPPUNIT_ASSERT_MESSAGE("no exceptions: " + exceptions.toString(), exceptions.isEmpty());
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/CmsConnectionStartStopTest.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/CmsConnectionStartStopTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/CmsConnectionStartStopTest.h?rev=1336226&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/CmsConnectionStartStopTest.h
(added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/CmsConnectionStartStopTest.h
Wed May 9 14:34:58 2012
@@ -0,0 +1,52 @@
+/*
+ * 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 _ACTIVEMQ_TEST_CMSCONNECTIONSTARTSTOPTEST_H_
+#define _ACTIVEMQ_TEST_CMSCONNECTIONSTARTSTOPTEST_H_
+
+#include <activemq/test/CMSTestFixture.h>
+#include <activemq/util/IntegrationCommon.h>
+
+#include <decaf/lang/Pointer.h>
+#include <cms/Connection.h>
+
+namespace activemq{
+namespace test{
+
+ class CmsConnectionStartStopTest : public CMSTestFixture {
+ private:
+
+ decaf::lang::Pointer<cms::Connection> startedConnection;
+ decaf::lang::Pointer<cms::Connection> stoppedConnection;
+
+ public:
+
+ CmsConnectionStartStopTest();
+ virtual ~CmsConnectionStartStopTest();
+
+ virtual void setUp();
+ virtual void tearDown();
+
+ void testStoppedConsumerHoldsMessagesTillStarted();
+ void testMultipleConnectionStops();
+ void testConcurrentSessionCreateWithStart();
+
+ };
+
+}}
+
+#endif /* _ACTIVEMQ_TEST_CMSCONNECTIONSTARTSTOPTEST_H_ */
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/CmsConnectionStartStopTest.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireCmsConnectionStartStopTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireCmsConnectionStartStopTest.cpp?rev=1336226&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireCmsConnectionStartStopTest.cpp
(added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireCmsConnectionStartStopTest.cpp
Wed May 9 14:34:58 2012
@@ -0,0 +1,38 @@
+/*
+ * 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 "OpenwireCmsConnectionStartStopTest.h"
+
+#include <activemq/exceptions/ActiveMQException.h>
+
+using namespace std;
+using namespace cms;
+using namespace activemq;
+using namespace activemq::test;
+using namespace activemq::test::openwire;
+using namespace activemq::exceptions;
+
+using namespace decaf;
+using namespace decaf::lang;
+
+////////////////////////////////////////////////////////////////////////////////
+OpenwireCmsConnectionStartStopTest::OpenwireCmsConnectionStartStopTest() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+OpenwireCmsConnectionStartStopTest::~OpenwireCmsConnectionStartStopTest() {
+}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireCmsConnectionStartStopTest.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireCmsConnectionStartStopTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireCmsConnectionStartStopTest.h?rev=1336226&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireCmsConnectionStartStopTest.h
(added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireCmsConnectionStartStopTest.h
Wed May 9 14:34:58 2012
@@ -0,0 +1,50 @@
+/*
+ * 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 _ACTIVEMQ_TEST_OPENWIRE_OPENWIRECMSCONNECTIONSTARTSTOPTEST_H_
+#define _ACTIVEMQ_TEST_OPENWIRE_OPENWIRECMSCONNECTIONSTARTSTOPTEST_H_
+
+#include <activemq/test/CmsConnectionStartStopTest.h>
+#include <activemq/util/IntegrationCommon.h>
+
+namespace activemq {
+namespace test {
+namespace openwire {
+
+ class OpenwireCmsConnectionStartStopTest : public CmsConnectionStartStopTest {
+ private:
+
+ CPPUNIT_TEST_SUITE( OpenwireCmsConnectionStartStopTest );
+ CPPUNIT_TEST( testStoppedConsumerHoldsMessagesTillStarted );
+ CPPUNIT_TEST( testMultipleConnectionStops );
+ CPPUNIT_TEST( testConcurrentSessionCreateWithStart );
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+
+ OpenwireCmsConnectionStartStopTest();
+ virtual ~OpenwireCmsConnectionStartStopTest();
+
+ virtual std::string getBrokerURL() const {
+ return activemq::util::IntegrationCommon::getInstance().getOpenwireURL();
+ }
+
+ };
+
+}}}
+
+#endif /* _ACTIVEMQ_TEST_OPENWIRE_OPENWIRECMSCONNECTIONSTARTSTOPTEST_H_ */
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireCmsConnectionStartStopTest.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/stomp/StompCmsConnectionStartStopTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/stomp/StompCmsConnectionStartStopTest.cpp?rev=1336226&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/stomp/StompCmsConnectionStartStopTest.cpp
(added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/stomp/StompCmsConnectionStartStopTest.cpp
Wed May 9 14:34:58 2012
@@ -0,0 +1,39 @@
+/*
+ * 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 "StompCmsConnectionStartStopTest.h"
+
+#include <activemq/exceptions/ActiveMQException.h>
+
+using namespace std;
+using namespace cms;
+using namespace activemq;
+using namespace activemq::test;
+using namespace activemq::test::stomp;
+using namespace activemq::exceptions;
+
+using namespace decaf;
+using namespace decaf::lang;
+
+////////////////////////////////////////////////////////////////////////////////
+StompCmsConnectionStartStopTest::StompCmsConnectionStartStopTest() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+StompCmsConnectionStartStopTest::~StompCmsConnectionStartStopTest() {
+}
+
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/stomp/StompCmsConnectionStartStopTest.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/stomp/StompCmsConnectionStartStopTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/stomp/StompCmsConnectionStartStopTest.h?rev=1336226&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/stomp/StompCmsConnectionStartStopTest.h
(added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/stomp/StompCmsConnectionStartStopTest.h
Wed May 9 14:34:58 2012
@@ -0,0 +1,50 @@
+/*
+ * 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 _ACTIVEMQ_TEST_STOMP_STOMPCMSCONNECTIONSTARTSTOPTEST_H_
+#define _ACTIVEMQ_TEST_STOMP_STOMPCMSCONNECTIONSTARTSTOPTEST_H_
+
+#include <activemq/test/CmsConnectionStartStopTest.h>
+#include <activemq/util/IntegrationCommon.h>
+
+namespace activemq {
+namespace test {
+namespace stomp {
+
+ class StompCmsConnectionStartStopTest : public CmsConnectionStartStopTest {
+ private:
+
+ CPPUNIT_TEST_SUITE( StompCmsConnectionStartStopTest );
+ CPPUNIT_TEST( testStoppedConsumerHoldsMessagesTillStarted );
+ CPPUNIT_TEST( testMultipleConnectionStops );
+ CPPUNIT_TEST( testConcurrentSessionCreateWithStart );
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+
+ StompCmsConnectionStartStopTest();
+ virtual ~StompCmsConnectionStartStopTest();
+
+ virtual std::string getBrokerURL() const {
+ return activemq::util::IntegrationCommon::getInstance().getStompURL();
+ }
+
+ };
+
+}}}
+
+#endif /* _ACTIVEMQ_TEST_STOMP_STOMPCMSCONNECTIONSTARTSTOPTEST_H_ */
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/activemq/test/stomp/StompCmsConnectionStartStopTest.h
------------------------------------------------------------------------------
svn:eol-style = native
|