activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r533120 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration: ./ connector/openwire/ connector/stomp/
Date Fri, 27 Apr 2007 14:37:20 GMT
Author: tabish
Date: Fri Apr 27 07:37:18 2007
New Revision: 533120

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

Adding more configurability to tests

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/IntegrationCommon.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireAsyncSenderTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireDurableTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireExpirationTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireSimpleRollbackTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireSimpleTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireSlowListenerTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireTempDestinationTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireTransactionTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/AsyncSenderTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/DurableTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/ExpirationTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/SimpleRollbackTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/SimpleTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/TransactionTest.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/IntegrationCommon.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/IntegrationCommon.cpp?view=diff&rev=533120&r1=533119&r2=533120
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/IntegrationCommon.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/IntegrationCommon.cpp
Fri Apr 27 07:37:18 2007
@@ -28,8 +28,8 @@
 IntegrationCommon::IntegrationCommon() {
 
     this->urlCommon = "tcp://localhost:";
-    this->stompURL = this->urlCommon + "61613?wireformat=stomp";
-    this->openwireURL = this->urlCommon + "61616?wireformat=openwire";
+    this->stompURL = this->urlCommon + "61613?wireFormat=stomp";
+    this->openwireURL = this->urlCommon + "61616?wireFormat=openwire";
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireAsyncSenderTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireAsyncSenderTest.cpp?view=diff&rev=533120&r1=533119&r2=533120
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireAsyncSenderTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireAsyncSenderTest.cpp
Fri Apr 27 07:37:18 2007
@@ -75,7 +75,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 OpenwireAsyncSenderTest::OpenwireAsyncSenderTest()
 :
-    testSupport("tcp://localhost:61616?wireFormat=openwire&transport.useAsyncSend=true")
+    testSupport( IntegrationCommon::getInstance().getOpenwireURL() + "&transport.useAsyncSend=true")
 {
     testSupport.initialize();
 }
@@ -90,10 +90,9 @@
 {
     try{
         std::string brokerURI =
-            "tcp://127.0.0.1:61616"
-            "?wireFormat=openwire"
+            IntegrationCommon::getInstance().getOpenwireURL() +
             "&transport.useAsyncSend=true";
-        ActiveMQConnectionFactory* connectionFactory = 
+        ActiveMQConnectionFactory* connectionFactory =
             new ActiveMQConnectionFactory(brokerURI);
         cms::Connection* connection = connectionFactory->createConnection();
         delete connectionFactory;

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireDurableTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireDurableTest.cpp?view=diff&rev=533120&r1=533119&r2=533120
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireDurableTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireDurableTest.cpp
Fri Apr 27 07:37:18 2007
@@ -73,7 +73,7 @@
 
 OpenwireDurableTest::OpenwireDurableTest()
 :
-    testSupport("tcp://localhost:61616?wireFormat=openwire")
+    testSupport( IntegrationCommon::getInstance().getOpenwireURL() )
 {
     testSupport.initialize();
 }
@@ -89,36 +89,36 @@
             cout << "Starting activemqcms durable test (sending "
                  << IntegrationCommon::defaultMsgCount
                  << " messages per type and sleeping "
-                 << IntegrationCommon::defaultDelay 
+                 << IntegrationCommon::defaultDelay
                  << " milli-seconds) ...\n"
                  << endl;
         }
-        
+
         std::string subName = Guid().createGUID();
 
         // Create CMS Object for Comms
         cms::Session* session = testSupport.getSession();
         cms::Topic* topic = session->createTopic(Guid::createGUIDString());
-        cms::MessageConsumer* consumer = 
-            session->createDurableConsumer( topic, subName, "" );            
+        cms::MessageConsumer* consumer =
+            session->createDurableConsumer( topic, subName, "" );
         consumer->setMessageListener( &testSupport );
-        cms::MessageProducer* producer = 
+        cms::MessageProducer* producer =
             session->createProducer( topic );
 
         unsigned int sent;
 
         // Send some text messages
         sent = testSupport.produceTextMessages( *producer, 3 );
-        
+
         // Wait for all messages
         testSupport.waitForMessages( sent );
 
         unsigned int numReceived = testSupport.getNumReceived();
-        
+
         if( IntegrationCommon::debug ) {
             printf("received: %d\n", numReceived );
         }
-        
+
         CPPUNIT_ASSERT_EQUAL( sent, numReceived );
 
         // Nuke the consumer
@@ -127,7 +127,7 @@
         // Send some text messages
         sent += testSupport.produceTextMessages( *producer, 3 );
 
-        consumer = session->createDurableConsumer( topic, subName, "" );            
+        consumer = session->createDurableConsumer( topic, subName, "" );
         consumer->setMessageListener( &testSupport );
 
         // Send some text messages
@@ -135,7 +135,7 @@
 
         // Wait for all remaining messages
         testSupport.waitForMessages( sent );
-        
+
         numReceived = testSupport.getNumReceived();
         if( IntegrationCommon::debug ) {
             printf("received: %d\n", numReceived );
@@ -145,7 +145,7 @@
         if( IntegrationCommon::debug ) {
             printf("Shutting Down\n" );
         }
-        delete producer;                      
+        delete producer;
         delete consumer;
         delete topic;
     }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireExpirationTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireExpirationTest.cpp?view=diff&rev=533120&r1=533119&r2=533120
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireExpirationTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireExpirationTest.cpp
Fri Apr 27 07:37:18 2007
@@ -17,6 +17,7 @@
 
 #include "OpenwireExpirationTest.h"
 
+#include <integration/IntegrationCommon.h>
 #include <sstream>
 
 #include <activemq/core/ActiveMQConnectionFactory.h>
@@ -75,8 +76,6 @@
 using namespace integration;
 using namespace integration::connector::openwire;
 
-
-
 OpenwireExpirationTest::Producer::Producer( string topic, int numMessages, long long timeToLive
){
     connection = NULL;
     session = NULL;
@@ -103,7 +102,9 @@
 void OpenwireExpirationTest::Producer::run() {
     try {
         // Create a ConnectionFactory
-        ActiveMQConnectionFactory* connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61613?wireFormat=stomp");
+        ActiveMQConnectionFactory* connectionFactory =
+            new ActiveMQConnectionFactory(
+                IntegrationCommon::getInstance().getStompURL() );
 
         // Create a Connection
         connection = connectionFactory->createConnection();
@@ -199,7 +200,7 @@
 
         // Create a Connection
         connection = ActiveMQConnectionFactory::createConnection(
-            "tcp://localhost:61613?wireFormat=stomp", user, passwd, sID );
+            IntegrationCommon::getInstance().getStompURL(), user, passwd, sID );
         connection->start();
 
         // Create a Session

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireSimpleRollbackTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireSimpleRollbackTest.cpp?view=diff&rev=533120&r1=533119&r2=533120
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireSimpleRollbackTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireSimpleRollbackTest.cpp
Fri Apr 27 07:37:18 2007
@@ -82,7 +82,7 @@
 {
     try
     {
-        string url = "tcp://localhost:61616?wireFormat=openwire";
+        string url = IntegrationCommon::getInstance().getOpenwireURL();
         numReceived = 0;
 
         // Default amount to send and receive

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireSimpleTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireSimpleTest.cpp?view=diff&rev=533120&r1=533119&r2=533120
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireSimpleTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireSimpleTest.cpp
Fri Apr 27 07:37:18 2007
@@ -83,49 +83,49 @@
 {
     try
     {
-        TestSupport testSupport("tcp://localhost:61616?wireFormat=openwire");
+        TestSupport testSupport(IntegrationCommon::getInstance().getOpenwireURL());
         testSupport.initialize();
-        
+
         if( IntegrationCommon::debug ) {
             cout << "Starting activemqcms test (sending "
                  << IntegrationCommon::defaultMsgCount
                  << " messages per type and sleeping "
-                 << IntegrationCommon::defaultDelay 
+                 << IntegrationCommon::defaultDelay
                  << " milli-seconds) ...\n"
                  << endl;
         }
-        
+
         // Create CMS Object for Comms
         cms::Session* session = testSupport.getSession();
         cms::Topic* topic = session->createTopic("mytopic");
-        cms::MessageConsumer* consumer = 
-            session->createConsumer( topic );            
+        cms::MessageConsumer* consumer =
+            session->createConsumer( topic );
         consumer->setMessageListener( &testSupport );
-        cms::MessageProducer* producer = 
+        cms::MessageProducer* producer =
             session->createProducer( topic );
 
         // Send some text messages
-        testSupport.produceTextMessages( 
+        testSupport.produceTextMessages(
             *producer, IntegrationCommon::defaultMsgCount );
-        
+
         // Send some bytes messages.
-        testSupport.produceTextMessages( 
+        testSupport.produceTextMessages(
             *producer, IntegrationCommon::defaultMsgCount );
 
         // Wait for the messages to get here
         testSupport.waitForMessages( IntegrationCommon::defaultMsgCount * 2 );
-        
+
         unsigned int numReceived = testSupport.getNumReceived();
         if( IntegrationCommon::debug ) {
             printf("received: %d\n", numReceived );
         }
-        CPPUNIT_ASSERT( 
+        CPPUNIT_ASSERT(
             numReceived == IntegrationCommon::defaultMsgCount * 2 );
 
         if( IntegrationCommon::debug ) {
             printf("Shutting Down\n" );
         }
-        delete producer;                      
+        delete producer;
         delete consumer;
         delete topic;
     }
@@ -136,49 +136,49 @@
 {
     try
     {
-        TestSupport testSupport("tcp://localhost:61616?wireFormat=openwire", cms::Session::CLIENT_ACKNOWLEDGE
);
+        TestSupport testSupport(IntegrationCommon::getInstance().getOpenwireURL(), cms::Session::CLIENT_ACKNOWLEDGE
);
         testSupport.initialize();
-        
+
         if( IntegrationCommon::debug ) {
             cout << "Starting activemqcms test (sending "
                  << IntegrationCommon::defaultMsgCount
                  << " messages per type and sleeping "
-                 << IntegrationCommon::defaultDelay 
+                 << IntegrationCommon::defaultDelay
                  << " milli-seconds) ...\n"
                  << endl;
         }
-        
+
         // Create CMS Object for Comms
         cms::Session* session = testSupport.getSession();
         cms::Topic* topic = session->createTopic("mytopic");
-        cms::MessageConsumer* consumer = 
-            session->createConsumer( topic );            
+        cms::MessageConsumer* consumer =
+            session->createConsumer( topic );
         consumer->setMessageListener( &testSupport );
-        cms::MessageProducer* producer = 
+        cms::MessageProducer* producer =
             session->createProducer( topic );
 
         // Send some text messages
-        testSupport.produceTextMessages( 
+        testSupport.produceTextMessages(
             *producer, IntegrationCommon::defaultMsgCount );
-        
+
         // Send some bytes messages.
-        testSupport.produceTextMessages( 
+        testSupport.produceTextMessages(
             *producer, IntegrationCommon::defaultMsgCount );
 
         // Wait for the messages to get here
         testSupport.waitForMessages( IntegrationCommon::defaultMsgCount * 2 );
-        
+
         unsigned int numReceived = testSupport.getNumReceived();
         if( IntegrationCommon::debug ) {
             printf("received: %d\n", numReceived );
         }
-        CPPUNIT_ASSERT( 
+        CPPUNIT_ASSERT(
             numReceived == IntegrationCommon::defaultMsgCount * 2 );
 
         if( IntegrationCommon::debug ) {
             printf("Shutting Down\n" );
         }
-        delete producer;                      
+        delete producer;
         delete consumer;
         delete topic;
     }
@@ -189,35 +189,35 @@
 {
     try
     {
-        TestSupport testSupport("tcp://localhost:61616?wireFormat=openwire", cms::Session::CLIENT_ACKNOWLEDGE
);
+        TestSupport testSupport(IntegrationCommon::getInstance().getOpenwireURL(), cms::Session::CLIENT_ACKNOWLEDGE
);
         testSupport.initialize();
-        
+
         if( IntegrationCommon::debug ) {
             cout << "Starting activemqcms test (sending "
                  << IntegrationCommon::defaultMsgCount
                  << " messages per type and sleeping "
-                 << IntegrationCommon::defaultDelay 
+                 << IntegrationCommon::defaultDelay
                  << " milli-seconds) ...\n"
                  << endl;
         }
-        
+
         // Create CMS Object for Comms
         cms::Session* session = testSupport.getSession();
         cms::Topic* topic = session->createTopic(Guid::createGUIDString());
-        cms::MessageConsumer* consumer =  session->createConsumer( topic );          
 
+        cms::MessageConsumer* consumer =  session->createConsumer( topic );
         consumer->setMessageListener( &testSupport );
         cms::MessageProducer* producer = session->createProducer( NULL );
 
         cms::TextMessage* textMsg = session->createTextMessage();
-        
+
         // Send some text messages
         producer->send( topic, textMsg );
-        
+
         delete textMsg;
 
         // Wait for the messages to get here
         testSupport.waitForMessages( 1 );
-        
+
         unsigned int numReceived = testSupport.getNumReceived();
         if( IntegrationCommon::debug ) {
             printf("received: %d\n", numReceived );
@@ -227,7 +227,7 @@
         if( IntegrationCommon::debug ) {
             printf("Shutting Down\n" );
         }
-        delete producer;                      
+        delete producer;
         delete consumer;
         delete topic;
     }
@@ -238,18 +238,18 @@
 {
     try
     {
-        TestSupport testSupport("tcp://localhost:61616?wireFormat=openwire", cms::Session::CLIENT_ACKNOWLEDGE
);
+        TestSupport testSupport(IntegrationCommon::getInstance().getOpenwireURL(), cms::Session::CLIENT_ACKNOWLEDGE
);
         testSupport.initialize();
-        
+
         if( IntegrationCommon::debug ) {
             cout << "Starting activemqcms test (sending "
                  << IntegrationCommon::defaultMsgCount
                  << " messages per type and sleeping "
-                 << IntegrationCommon::defaultDelay 
+                 << IntegrationCommon::defaultDelay
                  << " milli-seconds) ...\n"
                  << endl;
         }
-        
+
         // Create CMS Object for Comms
         cms::Session* session = testSupport.getSession();
         cms::Topic* topic = session->createTopic(Guid::createGUIDString());
@@ -257,10 +257,10 @@
         cms::MessageProducer* producer = session->createProducer( topic );
 
         cms::TextMessage* textMsg = session->createTextMessage();
-        
+
         // Send some text messages
         producer->send( textMsg );
-        
+
         delete textMsg;
 
         cms::Message* message = consumer->receive(1000);
@@ -270,7 +270,7 @@
         if( IntegrationCommon::debug ) {
             printf("Shutting Down\n" );
         }
-        delete producer;                      
+        delete producer;
         delete consumer;
         delete topic;
     }
@@ -281,48 +281,50 @@
 {
     try
     {
-        
+
         if( IntegrationCommon::debug ) {
             cout << "Starting activemqcms test (sending "
                  << IntegrationCommon::defaultMsgCount
                  << " messages per type and sleeping "
-                 << IntegrationCommon::defaultDelay 
+                 << IntegrationCommon::defaultDelay
                  << " milli-seconds) ...\n"
                  << endl;
         }
-        
+
         // Create CMS Object for Comms
-        cms::ConnectionFactory* factory = new ActiveMQConnectionFactory("tcp://localhost:61616?wireFormat=openwire");
+        cms::ConnectionFactory* factory =
+            new ActiveMQConnectionFactory(
+                IntegrationCommon::getInstance().getOpenwireURL() );
         cms::Connection* connection1 = factory->createConnection();
         connection1->start();
-        
+
         cms::Connection* connection2 = factory->createConnection();
         connection2->start();
-        
+
         CPPUNIT_ASSERT( connection1->getClientID() != connection2->getClientID() );
-        
+
         cms::Session* session1 = connection1->createSession();
         cms::Session* session2 = connection2->createSession();
-        
+
         cms::Topic* topic = session1->createTopic(Guid::createGUIDString());
-        
-        
+
+
         cms::MessageConsumer* consumer1 = session1->createConsumer( topic );
         cms::MessageConsumer* consumer2 = session2->createConsumer( topic );
-        
+
         cms::MessageProducer* producer = session2->createProducer( topic );
 
         cms::TextMessage* textMsg = session2->createTextMessage();
-        
+
         // Send some text messages
         producer->send( textMsg );
-        
+
         delete textMsg;
 
         cms::Message* message = consumer1->receive(1000);
         CPPUNIT_ASSERT( message != NULL );
         delete message;
-        
+
         message = consumer2->receive(1000);
         CPPUNIT_ASSERT( message != NULL );
         delete message;
@@ -330,11 +332,11 @@
         if( IntegrationCommon::debug ) {
             printf("Shutting Down\n" );
         }
-        
+
         connection1->close();
         connection2->close();
-        
-        delete producer;                      
+
+        delete producer;
         delete consumer1;
         delete consumer2;
         delete topic;
@@ -351,42 +353,44 @@
 {
     try
     {
-        
+
         if( IntegrationCommon::debug ) {
             cout << "Starting activemqcms test (sending "
                  << IntegrationCommon::defaultMsgCount
                  << " messages per type and sleeping "
-                 << IntegrationCommon::defaultDelay 
+                 << IntegrationCommon::defaultDelay
                  << " milli-seconds) ...\n"
                  << endl;
         }
-        
+
         // Create CMS Object for Comms
-        cms::ConnectionFactory* factory = new ActiveMQConnectionFactory("tcp://localhost:61616?wireFormat=openwire");
+        cms::ConnectionFactory* factory =
+            new ActiveMQConnectionFactory(
+                IntegrationCommon::getInstance().getOpenwireURL() );
         cms::Connection* connection = factory->createConnection();
         connection->start();
-        
+
         cms::Session* session1 = connection->createSession();
         cms::Session* session2 = connection->createSession();
-        
+
         cms::Topic* topic = session1->createTopic(Guid::createGUIDString());
-        
+
         cms::MessageConsumer* consumer1 = session1->createConsumer( topic );
         cms::MessageConsumer* consumer2 = session2->createConsumer( topic );
-        
+
         cms::MessageProducer* producer = session2->createProducer( topic );
 
         cms::TextMessage* textMsg = session2->createTextMessage();
-        
+
         // Send some text messages
         producer->send( textMsg );
-        
+
         delete textMsg;
 
         cms::Message* message = consumer1->receive(1000);
         CPPUNIT_ASSERT( message != NULL );
         delete message;
-        
+
         message = consumer2->receive(1000);
         CPPUNIT_ASSERT( message != NULL );
         delete message;
@@ -394,10 +398,10 @@
         if( IntegrationCommon::debug ) {
             printf("Shutting Down\n" );
         }
-        
+
         connection->close();
-        
-        delete producer;                      
+
+        delete producer;
         delete consumer1;
         delete consumer2;
         delete topic;
@@ -410,40 +414,42 @@
 }
 
 void OpenwireSimpleTest::testReceiveAlreadyInQueue() {
-    
+
         try
     {
-        
+
         if( IntegrationCommon::debug ) {
             cout << "Starting activemqcms test (sending "
                  << IntegrationCommon::defaultMsgCount
                  << " messages per type and sleeping "
-                 << IntegrationCommon::defaultDelay 
+                 << IntegrationCommon::defaultDelay
                  << " milli-seconds) ...\n"
                  << endl;
         }
-        
+
         // Create CMS Object for Comms
-        cms::ConnectionFactory* factory = new ActiveMQConnectionFactory("tcp://localhost:61616?wireFormat=openwire");
+        cms::ConnectionFactory* factory =
+            new ActiveMQConnectionFactory(
+                IntegrationCommon::getInstance().getOpenwireURL() );
         cms::Connection* connection = factory->createConnection();
 
         cms::Session* session = connection->createSession();
-        
+
         cms::Topic* topic = session->createTopic(Guid::createGUIDString());
-        
+
         cms::MessageConsumer* consumer = session->createConsumer( topic );
-        
+
         cms::MessageProducer* producer = session->createProducer( topic );
 
         cms::TextMessage* textMsg = session->createTextMessage();
-        
+
         // Send some text messages
         producer->send( textMsg );
-        
+
         delete textMsg;
-        
+
         Thread::sleep( 100 );
-        
+
         connection->start();
 
         cms::Message* message = consumer->receive(1000);
@@ -453,10 +459,10 @@
         if( IntegrationCommon::debug ) {
             printf("Shutting Down\n" );
         }
-        
+
         connection->close();
-        
-        delete producer;                      
+
+        delete producer;
         delete consumer;
         delete topic;
         delete session;

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireSlowListenerTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireSlowListenerTest.cpp?view=diff&rev=533120&r1=533119&r2=533120
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireSlowListenerTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireSlowListenerTest.cpp
Fri Apr 27 07:37:18 2007
@@ -98,7 +98,9 @@
         SlowListener listener;
 
         ActiveMQConnectionFactory* connectionFactory;
-        connectionFactory = new activemq::core::ActiveMQConnectionFactory("tcp://127.0.0.1:61616?wireFormat=openwire");
+        connectionFactory =
+            new activemq::core::ActiveMQConnectionFactory(
+                IntegrationCommon::getInstance().getOpenwireURL() );
         cms::Connection* connection = connectionFactory->createConnection();
         cms::Session* session = connection->createSession( cms::Session::AUTO_ACKNOWLEDGE
);
         cms::Destination* destination = session->createTopic(Guid::createGUIDString());

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireTempDestinationTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireTempDestinationTest.cpp?view=diff&rev=533120&r1=533119&r2=533120
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireTempDestinationTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireTempDestinationTest.cpp
Fri Apr 27 07:37:18 2007
@@ -74,7 +74,7 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 OpenwireTempDestinationTest::OpenwireTempDestinationTest()
-  : testSupport( "tcp://127.0.0.1:61616?wireFormat=openwire" )
+  : testSupport( IntegrationCommon::getInstance().getOpenwireURL() )
 {
     testSupport.initialize();
 }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireTransactionTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireTransactionTest.cpp?view=diff&rev=533120&r1=533119&r2=533120
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireTransactionTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/openwire/OpenwireTransactionTest.cpp
Fri Apr 27 07:37:18 2007
@@ -72,7 +72,7 @@
 
 OpenwireTransactionTest::OpenwireTransactionTest()
 :
-    testSupport( "tcp://127.0.0.1:61616?wireFormat=openwire", cms::Session::SESSION_TRANSACTED
)
+    testSupport( IntegrationCommon::getInstance().getOpenwireURL(), cms::Session::SESSION_TRANSACTED
)
 {
     testSupport.initialize();
 }
@@ -88,46 +88,46 @@
             cout << "Starting activemqcms transactional test (sending "
                  << IntegrationCommon::defaultMsgCount
                  << " messages per type and sleeping "
-                 << IntegrationCommon::defaultDelay 
+                 << IntegrationCommon::defaultDelay
                 << " milli-seconds) ...\n"
                 << endl;
         }
-        
+
         // Create CMS Object for Comms
         cms::Session* session = testSupport.getSession();
         cms::Topic* topic = session->createTopic("mytopic");
-        cms::MessageConsumer* consumer = 
-            session->createConsumer( topic );            
+        cms::MessageConsumer* consumer =
+            session->createConsumer( topic );
         consumer->setMessageListener( &testSupport );
-        cms::MessageProducer* producer = 
+        cms::MessageProducer* producer =
             session->createProducer( topic );
 
         // Send some text messages
-        testSupport.produceTextMessages( 
+        testSupport.produceTextMessages(
             *producer, IntegrationCommon::defaultMsgCount );
-            
+
         session->commit();
-        
+
         // Send some bytes messages.
-        testSupport.produceTextMessages( 
+        testSupport.produceTextMessages(
             *producer, IntegrationCommon::defaultMsgCount );
-        
+
         session->commit();
 
         // Wait till we get all the messages
         testSupport.waitForMessages( IntegrationCommon::defaultMsgCount * 2 );
-        
+
         unsigned int numReceived = testSupport.getNumReceived();
         if( IntegrationCommon::debug ) {
             printf("received: %d\n", numReceived );
         }
-        CPPUNIT_ASSERT( 
+        CPPUNIT_ASSERT(
             numReceived == IntegrationCommon::defaultMsgCount * 2 );
 
         testSupport.setNumReceived( 0 );
 
         // Send some text messages
-        testSupport.produceTextMessages( 
+        testSupport.produceTextMessages(
             *producer, IntegrationCommon::defaultMsgCount );
 
         session->rollback();
@@ -139,13 +139,13 @@
         if( IntegrationCommon::debug ) {
             printf("received: %d\n", numReceived );
         }
-        CPPUNIT_ASSERT( 
+        CPPUNIT_ASSERT(
             numReceived == IntegrationCommon::defaultMsgCount );
 
         if( IntegrationCommon::debug ) {
             printf("Shutting Down\n" );
         }
-        delete producer;                      
+        delete producer;
         delete consumer;
         delete topic;
     }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/AsyncSenderTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/AsyncSenderTest.cpp?view=diff&rev=533120&r1=533119&r2=533120
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/AsyncSenderTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/AsyncSenderTest.cpp
Fri Apr 27 07:37:18 2007
@@ -73,8 +73,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 AsyncSenderTest::AsyncSenderTest()
-:
-    testSupport("tcp://localhost:61613?wireFormat=stomp&transport.useAsyncSend=true")
+:  testSupport( IntegrationCommon::getInstance().getStompURL() + "&transport.useAsyncSend=true")
 {
     testSupport.initialize();
 }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/DurableTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/DurableTest.cpp?view=diff&rev=533120&r1=533119&r2=533120
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/DurableTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/DurableTest.cpp
Fri Apr 27 07:37:18 2007
@@ -73,7 +73,7 @@
 
 DurableTest::DurableTest()
 :
-    testSupport("tcp://localhost:61613?wireFormat=stomp")
+    testSupport( IntegrationCommon::getInstance().getStompURL() )
 {
     testSupport.initialize();
 }
@@ -89,36 +89,36 @@
             cout << "Starting activemqcms durable test (sending "
                  << IntegrationCommon::defaultMsgCount
                  << " messages per type and sleeping "
-                 << IntegrationCommon::defaultDelay 
+                 << IntegrationCommon::defaultDelay
                  << " milli-seconds) ...\n"
                  << endl;
         }
-        
+
         std::string subName = Guid().createGUID();
 
         // Create CMS Object for Comms
         cms::Session* session = testSupport.getSession();
         cms::Topic* topic = session->createTopic(Guid::createGUIDString());
-        cms::MessageConsumer* consumer = 
-            session->createDurableConsumer( topic, subName, "" );            
+        cms::MessageConsumer* consumer =
+            session->createDurableConsumer( topic, subName, "" );
         consumer->setMessageListener( &testSupport );
-        cms::MessageProducer* producer = 
+        cms::MessageProducer* producer =
             session->createProducer( topic );
 
         unsigned int sent;
 
         // Send some text messages
         sent = testSupport.produceTextMessages( *producer, 3 );
-        
+
         // Wait for all messages
         testSupport.waitForMessages( sent );
 
         unsigned int numReceived = testSupport.getNumReceived();
-        
+
         if( IntegrationCommon::debug ) {
             printf("received: %d\n", numReceived );
         }
-        
+
         CPPUNIT_ASSERT_EQUAL( sent, numReceived );
 
         // Nuke the consumer
@@ -127,7 +127,7 @@
         // Send some text messages
         sent += testSupport.produceTextMessages( *producer, 3 );
 
-        consumer = session->createDurableConsumer( topic, subName, "" );            
+        consumer = session->createDurableConsumer( topic, subName, "" );
         consumer->setMessageListener( &testSupport );
 
         // Send some text messages
@@ -135,7 +135,7 @@
 
         // Wait for all remaining messages
         testSupport.waitForMessages( sent );
-        
+
         numReceived = testSupport.getNumReceived();
         if( IntegrationCommon::debug ) {
             printf("received: %d\n", numReceived );
@@ -145,7 +145,7 @@
         if( IntegrationCommon::debug ) {
             printf("Shutting Down\n" );
         }
-        delete producer;                      
+        delete producer;
         delete consumer;
         delete topic;
     }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/ExpirationTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/ExpirationTest.cpp?view=diff&rev=533120&r1=533119&r2=533120
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/ExpirationTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/ExpirationTest.cpp
Fri Apr 27 07:37:18 2007
@@ -16,6 +16,7 @@
  */
 
 #include "ExpirationTest.h"
+#include <integration/IntegrationCommon.h>
 
 #include <sstream>
 
@@ -75,8 +76,6 @@
 using namespace integration;
 using namespace integration::connector::stomp;
 
-
-
 ExpirationTest::Producer::Producer( string topic, int numMessages, long long timeToLive ){
     connection = NULL;
     session = NULL;
@@ -103,7 +102,8 @@
 void ExpirationTest::Producer::run() {
     try {
         // Create a ConnectionFactory
-        ActiveMQConnectionFactory* connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61613?wireFormat=stomp");
+        ActiveMQConnectionFactory* connectionFactory =
+            new ActiveMQConnectionFactory( IntegrationCommon::getInstance().getStompURL()
);
 
         // Create a Connection
         connection = connectionFactory->createConnection();
@@ -199,7 +199,7 @@
 
         // Create a Connection
         connection = ActiveMQConnectionFactory::createConnection(
-            "tcp://localhost:61613?wireFormat=stomp", user, passwd, sID );
+            IntegrationCommon::getInstance().getStompURL(), user, passwd, sID );
 
         connection->start();
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/SimpleRollbackTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/SimpleRollbackTest.cpp?view=diff&rev=533120&r1=533119&r2=533120
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/SimpleRollbackTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/SimpleRollbackTest.cpp
Fri Apr 27 07:37:18 2007
@@ -82,7 +82,7 @@
 {
     try
     {
-        string url = "tcp://localhost:61613?wireFormat=stomp";
+        string url = IntegrationCommon::getInstance().getStompURL();
         numReceived = 0;
 
         // Default amount to send and receive

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/SimpleTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/SimpleTest.cpp?view=diff&rev=533120&r1=533119&r2=533120
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/SimpleTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/SimpleTest.cpp
Fri Apr 27 07:37:18 2007
@@ -83,7 +83,7 @@
 {
     try
     {
-        TestSupport testSupport("tcp://localhost:61613?wireFormat=stomp");
+        TestSupport testSupport( IntegrationCommon::getInstance().getStompURL() );
         testSupport.initialize();
 
         if( IntegrationCommon::debug ) {
@@ -136,7 +136,7 @@
 {
     try
     {
-        TestSupport testSupport("tcp://localhost:61613?wireFormat=stomp", cms::Session::CLIENT_ACKNOWLEDGE
);
+        TestSupport testSupport(IntegrationCommon::getInstance().getStompURL(), cms::Session::CLIENT_ACKNOWLEDGE
);
         testSupport.initialize();
 
         if( IntegrationCommon::debug ) {
@@ -189,7 +189,7 @@
 {
     try
     {
-        TestSupport testSupport("tcp://localhost:61613?wireFormat=stomp", cms::Session::CLIENT_ACKNOWLEDGE
);
+        TestSupport testSupport(IntegrationCommon::getInstance().getStompURL(), cms::Session::CLIENT_ACKNOWLEDGE
);
         testSupport.initialize();
 
         if( IntegrationCommon::debug ) {
@@ -238,7 +238,7 @@
 {
     try
     {
-        TestSupport testSupport("tcp://localhost:61613?wireFormat=stomp", cms::Session::AUTO_ACKNOWLEDGE
);
+        TestSupport testSupport(IntegrationCommon::getInstance().getStompURL(), cms::Session::AUTO_ACKNOWLEDGE
);
         testSupport.initialize();
 
         if( IntegrationCommon::debug ) {
@@ -281,7 +281,7 @@
 {
     try
     {
-        TestSupport testSupport("tcp://localhost:61613?wireFormat=stomp", cms::Session::CLIENT_ACKNOWLEDGE
);
+        TestSupport testSupport(IntegrationCommon::getInstance().getStompURL(), cms::Session::CLIENT_ACKNOWLEDGE
);
         testSupport.initialize();
 
         if( IntegrationCommon::debug ) {
@@ -336,7 +336,9 @@
         }
 
         // Create CMS Object for Comms
-        cms::ConnectionFactory* factory = new ActiveMQConnectionFactory("tcp://localhost:61613?wireFormat=stomp");
+        cms::ConnectionFactory* factory =
+            new ActiveMQConnectionFactory(
+                IntegrationCommon::getInstance().getStompURL() );
         cms::Connection* connection1 = factory->createConnection();
         connection1->start();
 
@@ -406,7 +408,8 @@
         }
 
         // Create CMS Object for Comms
-        cms::ConnectionFactory* factory = new ActiveMQConnectionFactory("tcp://localhost:61613?wireFormat=stomp");
+        cms::ConnectionFactory* factory =
+            new ActiveMQConnectionFactory( IntegrationCommon::getInstance().getStompURL()
);
         cms::Connection* connection = factory->createConnection();
         connection->start();
 
@@ -468,7 +471,9 @@
         }
 
         // Create CMS Object for Comms
-        cms::ConnectionFactory* factory = new ActiveMQConnectionFactory("tcp://localhost:61613?wireFormat=stomp");
+        cms::ConnectionFactory* factory =
+            new ActiveMQConnectionFactory(
+                IntegrationCommon::getInstance().getStompURL() );
         cms::Connection* connection = factory->createConnection();
 
         cms::Session* session = connection->createSession();

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/TransactionTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/TransactionTest.cpp?view=diff&rev=533120&r1=533119&r2=533120
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/TransactionTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test-integration/integration/connector/stomp/TransactionTest.cpp
Fri Apr 27 07:37:18 2007
@@ -72,7 +72,7 @@
 
 TransactionTest::TransactionTest()
 :
-    testSupport( "tcp://127.0.0.1:61613?wireFormat=stomp", cms::Session::SESSION_TRANSACTED
)
+    testSupport( IntegrationCommon::getInstance().getStompURL(), cms::Session::SESSION_TRANSACTED
)
 {
     testSupport.initialize();
 }
@@ -88,46 +88,46 @@
             cout << "Starting activemqcms transactional test (sending "
                  << IntegrationCommon::defaultMsgCount
                  << " messages per type and sleeping "
-                 << IntegrationCommon::defaultDelay 
+                 << IntegrationCommon::defaultDelay
                 << " milli-seconds) ...\n"
                 << endl;
         }
-        
+
         // Create CMS Object for Comms
         cms::Session* session = testSupport.getSession();
         cms::Topic* topic = session->createTopic("mytopic");
-        cms::MessageConsumer* consumer = 
-            session->createConsumer( topic );            
+        cms::MessageConsumer* consumer =
+            session->createConsumer( topic );
         consumer->setMessageListener( &testSupport );
-        cms::MessageProducer* producer = 
+        cms::MessageProducer* producer =
             session->createProducer( topic );
 
         // Send some text messages
-        testSupport.produceTextMessages( 
+        testSupport.produceTextMessages(
             *producer, IntegrationCommon::defaultMsgCount );
-            
+
         session->commit();
-        
+
         // Send some bytes messages.
-        testSupport.produceTextMessages( 
+        testSupport.produceTextMessages(
             *producer, IntegrationCommon::defaultMsgCount );
-        
+
         session->commit();
 
         // Wait till we get all the messages
         testSupport.waitForMessages( IntegrationCommon::defaultMsgCount * 2 );
-        
+
         unsigned int numReceived = testSupport.getNumReceived();
         if( IntegrationCommon::debug ) {
             printf("received: %d\n", numReceived );
         }
-        CPPUNIT_ASSERT( 
+        CPPUNIT_ASSERT(
             numReceived == IntegrationCommon::defaultMsgCount * 2 );
 
         testSupport.setNumReceived( 0 );
 
         // Send some text messages
-        testSupport.produceTextMessages( 
+        testSupport.produceTextMessages(
             *producer, IntegrationCommon::defaultMsgCount );
 
         session->rollback();
@@ -139,13 +139,13 @@
         if( IntegrationCommon::debug ) {
             printf("received: %d\n", numReceived );
         }
-        CPPUNIT_ASSERT( 
+        CPPUNIT_ASSERT(
             numReceived == IntegrationCommon::defaultMsgCount );
 
         if( IntegrationCommon::debug ) {
             printf("Shutting Down\n" );
         }
-        delete producer;                      
+        delete producer;
         delete consumer;
         delete topic;
     }



Mime
View raw message