You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2009/02/02 16:37:38 UTC

svn commit: r740010 - in /activemq/activemq-cpp/trunk/src/test-integration/activemq/test: TransactionTest.cpp TransactionTest.h openwire/OpenwireTransactionTest.h stomp/StompTransactionTest.h

Author: tabish
Date: Mon Feb  2 15:37:37 2009
New Revision: 740010

URL: http://svn.apache.org/viewvc?rev=740010&view=rev
Log:
Add a Transaction integration test that sends messages inside a transaction with TTL values set.

Modified:
    activemq/activemq-cpp/trunk/src/test-integration/activemq/test/TransactionTest.cpp
    activemq/activemq-cpp/trunk/src/test-integration/activemq/test/TransactionTest.h
    activemq/activemq-cpp/trunk/src/test-integration/activemq/test/openwire/OpenwireTransactionTest.h
    activemq/activemq-cpp/trunk/src/test-integration/activemq/test/stomp/StompTransactionTest.h

Modified: activemq/activemq-cpp/trunk/src/test-integration/activemq/test/TransactionTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/activemq/test/TransactionTest.cpp?rev=740010&r1=740009&r2=740010&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/activemq/test/TransactionTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test-integration/activemq/test/TransactionTest.cpp Mon Feb  2 15:37:37 2009
@@ -156,3 +156,38 @@
     AMQ_CATCH_RETHROW( ActiveMQException )
     AMQ_CATCHALL_THROW( ActiveMQException )
 }
+
+////////////////////////////////////////////////////////////////////////////////
+void TransactionTest::testWithTTLSet() {
+
+    try{
+        cmsProvider->getProducer()->setDeliveryMode( DeliveryMode::PERSISTENT );
+
+        cms::MessageConsumer* consumer = cmsProvider->getConsumer();
+
+        auto_ptr<TextMessage> outbound1(
+            cmsProvider->getSession()->createTextMessage( "First Message" ) );
+
+        const std::size_t NUM_MESSAGES = 50;
+
+        // sends a message
+        for( std::size_t i = 0; i < NUM_MESSAGES; ++i ) {
+            cmsProvider->getProducer()->send( outbound1.get(),
+                                              cms::DeliveryMode::PERSISTENT,
+                                              cmsProvider->getProducer()->getPriority(),
+                                              120*1000 );
+        }
+
+        cmsProvider->getSession()->commit();
+
+        for( std::size_t i = 0; i < NUM_MESSAGES; ++i ) {
+
+            // receives the second message
+            auto_ptr<TextMessage> inbound1(
+                dynamic_cast<TextMessage*>( consumer->receive( 4000 ) ) );
+            CPPUNIT_ASSERT( outbound1->getText() == inbound1->getText() );
+        }
+    }
+    AMQ_CATCH_RETHROW( ActiveMQException )
+    AMQ_CATCHALL_THROW( ActiveMQException )
+}

Modified: activemq/activemq-cpp/trunk/src/test-integration/activemq/test/TransactionTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/activemq/test/TransactionTest.h?rev=740010&r1=740009&r2=740010&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/activemq/test/TransactionTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test-integration/activemq/test/TransactionTest.h Mon Feb  2 15:37:37 2009
@@ -43,6 +43,7 @@
         void testSendReceiveTransactedBatches();
         void testSendRollback();
         void testSendSessionClose();
+        void testWithTTLSet();
 
     };
 

Modified: activemq/activemq-cpp/trunk/src/test-integration/activemq/test/openwire/OpenwireTransactionTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/activemq/test/openwire/OpenwireTransactionTest.h?rev=740010&r1=740009&r2=740010&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/activemq/test/openwire/OpenwireTransactionTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test-integration/activemq/test/openwire/OpenwireTransactionTest.h Mon Feb  2 15:37:37 2009
@@ -29,6 +29,7 @@
         CPPUNIT_TEST_SUITE( OpenwireTransactionTest );
         CPPUNIT_TEST( testSendReceiveTransactedBatches );
         CPPUNIT_TEST( testSendRollback );
+        CPPUNIT_TEST( testWithTTLSet );
 //        CPPUNIT_TEST( testSendSessionClose );
         CPPUNIT_TEST_SUITE_END();
 

Modified: activemq/activemq-cpp/trunk/src/test-integration/activemq/test/stomp/StompTransactionTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/activemq/test/stomp/StompTransactionTest.h?rev=740010&r1=740009&r2=740010&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/activemq/test/stomp/StompTransactionTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test-integration/activemq/test/stomp/StompTransactionTest.h Mon Feb  2 15:37:37 2009
@@ -29,6 +29,7 @@
         CPPUNIT_TEST_SUITE( StompTransactionTest );
 //        CPPUNIT_TEST( testSendReceiveTransactedBatches );
         CPPUNIT_TEST( testSendRollback );
+        CPPUNIT_TEST( testWithTTLSet );
 //        CPPUNIT_TEST( testSendSessionClose );
         CPPUNIT_TEST_SUITE_END();