activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r709275 - in /activemq/activemq-cpp/trunk/src/test-integration/integration/connector: openwire/ stomp/
Date Thu, 30 Oct 2008 23:02:54 GMT
Author: tabish
Date: Thu Oct 30 16:02:53 2008
New Revision: 709275

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

Modified:
    activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireSimpleRollbackTest.cpp
    activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireTempDestinationTest.cpp
    activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireTempDestinationTest.h
    activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireTransactionTest.cpp
    activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/AsyncSenderTest.cpp
    activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/CmsTemplateTest.h
    activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/ExpirationTest.cpp
    activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/SimpleRollbackTest.cpp
    activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/SimpleTest.cpp
    activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/TransactionTest.cpp

Modified: activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireSimpleRollbackTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireSimpleRollbackTest.cpp?rev=709275&r1=709274&r2=709275&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireSimpleRollbackTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireSimpleRollbackTest.cpp
Thu Oct 30 16:02:53 2008
@@ -134,6 +134,7 @@
         consumer->setMessageListener( this );
         cms::MessageProducer* producer =
             session->createProducer( topic );
+        producer->setDeliveryMode( DeliveryMode::NON_PERSISTENT );
 
         cms::TextMessage* textMsg =
             session->createTextMessage();

Modified: activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireTempDestinationTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireTempDestinationTest.cpp?rev=709275&r1=709274&r2=709275&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireTempDestinationTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireTempDestinationTest.cpp
Thu Oct 30 16:02:53 2008
@@ -114,7 +114,9 @@
         Thread responderThread( responseConsumer );
         requestorThread.start();
         responderThread.start();
-        Thread::sleep( 100 );
+
+        requestConsumer->waitUnitReady();
+        responseConsumer->waitUnitReady();
 
         cms::MessageProducer* producer =
             session->createProducer( requestTopic );
@@ -187,7 +189,7 @@
 OpenwireTempDestinationTest::Consumer::Consumer(
     cms::Connection* connection,
     cms::Session* session,
-    cms::Destination* destination )
+    cms::Destination* destination ) : ready(1)
 {
     this->connection = connection;
     this->destination = destination;
@@ -227,6 +229,7 @@
 
         // Sleep while asynchronous messages come in.
         synchronized( &mutex ) {
+            this->ready.countDown();
             mutex.wait();
         }
 

Modified: activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireTempDestinationTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireTempDestinationTest.h?rev=709275&r1=709274&r2=709275&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireTempDestinationTest.h
(original)
+++ activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireTempDestinationTest.h
Thu Oct 30 16:02:53 2008
@@ -19,6 +19,7 @@
 #define _INTEGRATION_CONNECTOR_OPENWIRE_OPENWIRETEMPDESTINATIONTEST_H_
 
 #include <decaf/util/concurrent/Mutex.h>
+#include <decaf/util/concurrent/CountDownLatch.h>
 
 #include <cppunit/TestFixture.h>
 #include <cppunit/extensions/HelperMacros.h>
@@ -66,6 +67,7 @@
             unsigned int numReceived;
             decaf::util::concurrent::Mutex mutex;
             decaf::util::concurrent::Mutex onMsgMutex;
+            decaf::util::concurrent::CountDownLatch ready;
 
         public:
 
@@ -83,6 +85,10 @@
                 return this->numReceived;
             }
 
+            virtual void waitUnitReady() {
+                this->ready.await();
+            }
+
             virtual void stop();
             virtual void run();
             virtual void onMessage( const cms::Message* message );

Modified: activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireTransactionTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireTransactionTest.cpp?rev=709275&r1=709274&r2=709275&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireTransactionTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/src/test-integration/integration/connector/openwire/OpenwireTransactionTest.cpp
Thu Oct 30 16:02:53 2008
@@ -99,6 +99,7 @@
         consumer->setMessageListener( testSupport );
         cms::MessageProducer* producer =
             session->createProducer( topic );
+        producer->setDeliveryMode( DeliveryMode::NON_PERSISTENT );
 
         // Send some text messages
         testSupport->produceTextMessages(

Modified: activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/AsyncSenderTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/AsyncSenderTest.cpp?rev=709275&r1=709274&r2=709275&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/AsyncSenderTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/AsyncSenderTest.cpp
Thu Oct 30 16:02:53 2008
@@ -102,6 +102,7 @@
         consumer->setMessageListener( testSupport );
         cms::MessageProducer* producer =
             session->createProducer( topic );
+        producer->setDeliveryMode( DeliveryMode::NON_PERSISTENT );
 
         // Send some text messages
         testSupport->produceTextMessages(

Modified: activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/CmsTemplateTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/CmsTemplateTest.h?rev=709275&r1=709274&r2=709275&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/CmsTemplateTest.h
(original)
+++ activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/CmsTemplateTest.h
Thu Oct 30 16:02:53 2008
@@ -37,7 +37,7 @@
         CPPUNIT_TEST( testReceiveException );
         CPPUNIT_TEST( testSendException );
         CPPUNIT_TEST_SUITE_END();
-        
+
         class TextMessageCreator : public activemq::cmsutil::MessageCreator {
         private:
             std::string text;
@@ -46,66 +46,68 @@
                 this->text = text;
             }
             virtual ~TextMessageCreator() {}
-            
+
             std::string getText() const {
                 return text;
             }
-            
-            virtual cms::Message* createMessage(cms::Session* session ) 
+
+            virtual cms::Message* createMessage(cms::Session* session )
                         throw (cms::CMSException) {
                 return session->createTextMessage(text);
-            } 
+            }
         };
-        
+
         class Sender : public decaf::lang::Runnable {
         private:
-                    
+
             activemq::core::ActiveMQConnectionFactory cf;
             activemq::cmsutil::CmsTemplate cmsTemplate;
             int count;
-            
+
         public:
-            
+
             Sender( const std::string& url, bool pubSub, const std::string& destName,
int count ) {
                 cf.setBrokerURL(url);
                 cmsTemplate.setConnectionFactory(&cf);
                 cmsTemplate.setPubSubDomain(pubSub);
                 cmsTemplate.setDefaultDestinationName(destName);
+                cmsTemplate.setDeliveryPersistent(false);
                 this->count = count;
             }
-            
+
             virtual ~Sender(){
             }
-            
-            virtual void run() {                
+
+            virtual void run() {
                 try {
                     // Send a batch of messages.
                     TextMessageCreator tmc("hello world");
                     for( int ix=0; ix<count; ++ix ) {
                         cmsTemplate.send(&tmc);
                     }
-                    
+
                 } catch( cms::CMSException& ex) {
                     ex.printStackTrace();
                 }
             }
         };
-        
+
         class Receiver : public decaf::lang::Runnable {
         private:
-            
+
             activemq::core::ActiveMQConnectionFactory cf;
             activemq::cmsutil::CmsTemplate cmsTemplate;
             int count;
             int numReceived;
-            
+
         public:
-            
+
             Receiver( const std::string& url, bool pubSub, const std::string& destName,
int count ) {
                 cf.setBrokerURL(url);
                 cmsTemplate.setConnectionFactory(&cf);
                 cmsTemplate.setPubSubDomain(pubSub);
                 cmsTemplate.setDefaultDestinationName(destName);
+                cmsTemplate.setDeliveryPersistent(false);
                 this->count = count;
             }
             virtual ~Receiver(){
@@ -114,22 +116,22 @@
                 return numReceived;
             }
             virtual void run() {
-                
+
                 try {
                     numReceived = 0;
-                    
+
                     // Receive a batch of messages.
                     for( int ix=0; ix<count; ++ix ) {
                         cms::Message* message = cmsTemplate.receive();
                         numReceived++;
-                        delete message;                    
+                        delete message;
                     }
                 } catch( cms::CMSException& ex) {
                     ex.printStackTrace();
                 }
             }
         };
-        
+
     public:
 
         CmsTemplateTest(){}
@@ -137,7 +139,7 @@
 
         virtual void setUp();
         virtual void tearDown();
-                
+
         virtual void testBasics();
         virtual void testReceiveException();
         virtual void testSendException();

Modified: activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/ExpirationTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/ExpirationTest.cpp?rev=709275&r1=709274&r2=709275&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/ExpirationTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/ExpirationTest.cpp
Thu Oct 30 16:02:53 2008
@@ -139,7 +139,7 @@
                 destination = session->createQueue( topic );
 
                 producer = session->createProducer( destination );
-                producer->setDeliveryMode( DeliveryMode::PERSISTENT );
+                producer->setDeliveryMode( DeliveryMode::NON_PERSISTENT );
                 producer->setDisableMessageTimeStamp( disableTimeStamps );
 
                 //unsigned long ttt=getcurt();

Modified: activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/SimpleRollbackTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/SimpleRollbackTest.cpp?rev=709275&r1=709274&r2=709275&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/SimpleRollbackTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/SimpleRollbackTest.cpp
Thu Oct 30 16:02:53 2008
@@ -138,6 +138,7 @@
         consumer->setMessageListener( this );
         cms::MessageProducer* producer =
             session->createProducer( topic );
+        producer->setDeliveryMode( DeliveryMode::NON_PERSISTENT );
 
         cms::TextMessage* textMsg =
             session->createTextMessage();

Modified: activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/SimpleTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/SimpleTest.cpp?rev=709275&r1=709274&r2=709275&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/SimpleTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/SimpleTest.cpp
Thu Oct 30 16:02:53 2008
@@ -105,6 +105,7 @@
         consumer->setMessageListener( testSupport );
         cms::MessageProducer* producer =
             session->createProducer( topic );
+        producer->setDeliveryMode( DeliveryMode::NON_PERSISTENT );
 
         // Send some text messages
         testSupport->produceTextMessages(
@@ -159,6 +160,7 @@
         consumer->setMessageListener( testSupport );
         cms::MessageProducer* producer =
             session->createProducer( topic );
+        producer->setDeliveryMode( DeliveryMode::NON_PERSISTENT );
 
         // Send some text messages
         testSupport->produceTextMessages(
@@ -211,6 +213,7 @@
         cms::MessageConsumer* consumer =  session->createConsumer( topic );
         consumer->setMessageListener( testSupport );
         cms::MessageProducer* producer = session->createProducer( NULL );
+        producer->setDeliveryMode( DeliveryMode::NON_PERSISTENT );
 
         cms::TextMessage* textMsg = session->createTextMessage();
 
@@ -260,6 +263,7 @@
         cms::Topic* topic = session->createTopic(UUID::randomUUID().toString());
         cms::MessageConsumer* consumer = session->createConsumer( topic );
         cms::MessageProducer* producer = session->createProducer( topic );
+        producer->setDeliveryMode( DeliveryMode::NON_PERSISTENT );
 
         cms::TextMessage* textMsg = session->createTextMessage();
 
@@ -304,6 +308,7 @@
         cms::Topic* topic = session->createTopic(UUID::randomUUID().toString());
         cms::MessageConsumer* consumer = session->createConsumer( topic );
         cms::MessageProducer* producer = session->createProducer( topic );
+        producer->setDeliveryMode( DeliveryMode::NON_PERSISTENT );
 
         cms::TextMessage* textMsg = session->createTextMessage();
 
@@ -364,6 +369,7 @@
         cms::MessageConsumer* consumer2 = session2->createConsumer( topic );
 
         cms::MessageProducer* producer = session2->createProducer( topic );
+        producer->setDeliveryMode( DeliveryMode::NON_PERSISTENT );
 
         cms::TextMessage* textMsg = session2->createTextMessage();
 
@@ -429,6 +435,7 @@
         cms::MessageConsumer* consumer2 = session2->createConsumer( topic );
 
         cms::MessageProducer* producer = session2->createProducer( topic );
+        producer->setDeliveryMode( DeliveryMode::NON_PERSISTENT );
 
         cms::TextMessage* textMsg = session2->createTextMessage();
 
@@ -490,6 +497,7 @@
         cms::MessageConsumer* consumer = session->createConsumer( topic );
 
         cms::MessageProducer* producer = session->createProducer( topic );
+        producer->setDeliveryMode( DeliveryMode::NON_PERSISTENT );
 
         cms::TextMessage* textMsg = session->createTextMessage();
 

Modified: activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/TransactionTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/TransactionTest.cpp?rev=709275&r1=709274&r2=709275&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/TransactionTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/TransactionTest.cpp
Thu Oct 30 16:02:53 2008
@@ -99,6 +99,7 @@
         consumer->setMessageListener( testSupport );
         cms::MessageProducer* producer =
             session->createProducer( topic );
+        producer->setDeliveryMode( DeliveryMode::NON_PERSISTENT );
 
         // Send some text messages
         testSupport->produceTextMessages(



Mime
View raw message