activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r900528 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core: ActiveMQSessionTest.cpp ActiveMQSessionTest.h
Date Mon, 18 Jan 2010 20:02:42 GMT
Author: tabish
Date: Mon Jan 18 20:02:42 2010
New Revision: 900528

URL: http://svn.apache.org/viewvc?rev=900528&view=rev
Log:
Add tests for use in trying to reproduce https://issues.apache.org/activemq/browse/AMQCPP-277

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core/ActiveMQSessionTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core/ActiveMQSessionTest.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core/ActiveMQSessionTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core/ActiveMQSessionTest.cpp?rev=900528&r1=900527&r2=900528&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core/ActiveMQSessionTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core/ActiveMQSessionTest.cpp
Mon Jan 18 20:02:42 2010
@@ -105,6 +105,37 @@
 }}
 
 ////////////////////////////////////////////////////////////////////////////////
+void ActiveMQSessionTest::testCreateManyConsumersAndSetListeners() {
+
+    MyCMSMessageListener msgListener1;
+
+    CPPUNIT_ASSERT( connection.get() != NULL );
+    CPPUNIT_ASSERT( connection->isStarted() == true );
+
+    // Create an Auto Ack Session
+    std::auto_ptr<cms::Session> session( connection->createSession() );
+
+    // Create a Topic
+    std::auto_ptr<cms::Topic> topic1( session->createTopic( "TestTopic1" ) );
+
+    CPPUNIT_ASSERT( topic1.get() != NULL );
+
+    std::list<cms::MessageConsumer*> consumers;
+    for( int ix = 0; ix < 100; ++ix ) {
+        cms::MessageConsumer* consumer = session->createConsumer( topic1.get() );
+        consumer->setMessageListener( &msgListener1 );
+        consumers.push_back( consumer );
+    }
+
+    std::list<cms::MessageConsumer*>::iterator iter = consumers.begin();
+    for( ; iter != consumers.end(); ++iter ) {
+        (*iter)->close();
+        delete *iter;
+    }
+    consumers.clear();
+}
+
+////////////////////////////////////////////////////////////////////////////////
 void ActiveMQSessionTest::testAutoAcking() {
 
     MyCMSMessageListener msgListener1;

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core/ActiveMQSessionTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core/ActiveMQSessionTest.h?rev=900528&r1=900527&r2=900528&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core/ActiveMQSessionTest.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/core/ActiveMQSessionTest.h
Mon Jan 18 20:02:42 2010
@@ -46,6 +46,7 @@
         CPPUNIT_TEST( testTransactionRollbackTwoConsumer );
         CPPUNIT_TEST( testTransactionCloseWithoutCommit );
         CPPUNIT_TEST( testExpiration );
+        CPPUNIT_TEST( testCreateManyConsumersAndSetListeners );
         CPPUNIT_TEST_SUITE_END();
 
     private:
@@ -86,6 +87,7 @@
 
         void testAutoAcking();
         void testClientAck();
+        void testCreateManyConsumersAndSetListeners();
         void testTransactionCommitOneConsumer();
         void testTransactionCommitTwoConsumer();
         void testTransactionRollbackOneConsumer();



Mime
View raw message