Author: tabish
Date: Mon Feb 2 15:34:36 2009
New Revision: 740006
URL: http://svn.apache.org/viewvc?rev=740006&view=rev
Log:
Add a Transaction integration test that sends messages inside a transaction
with TTL values set.
Modified:
activemq/activemq-cpp/branches/activemq-cpp-2.x/src/test-integration/activemq/test/TransactionTest.cpp
activemq/activemq-cpp/branches/activemq-cpp-2.x/src/test-integration/activemq/test/TransactionTest.h
activemq/activemq-cpp/branches/activemq-cpp-2.x/src/test-integration/activemq/test/openwire/OpenwireTransactionTest.h
activemq/activemq-cpp/branches/activemq-cpp-2.x/src/test-integration/activemq/test/stomp/StompTransactionTest.h
Modified:
activemq/activemq-cpp/branches/activemq-cpp-2.x/src/test-integration/activemq/test/TransactionTest.cpp
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-2.x/src/test-integration/activemq/test/TransactionTest.cpp?rev=740006&r1=740005&r2=740006&view=diff
==============================================================================
---
activemq/activemq-cpp/branches/activemq-cpp-2.x/src/test-integration/activemq/test/TransactionTest.cpp
(original)
+++
activemq/activemq-cpp/branches/activemq-cpp-2.x/src/test-integration/activemq/test/TransactionTest.cpp
Mon Feb 2 15:34:36 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/branches/activemq-cpp-2.x/src/test-integration/activemq/test/TransactionTest.h
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-2.x/src/test-integration/activemq/test/TransactionTest.h?rev=740006&r1=740005&r2=740006&view=diff
==============================================================================
---
activemq/activemq-cpp/branches/activemq-cpp-2.x/src/test-integration/activemq/test/TransactionTest.h
(original)
+++
activemq/activemq-cpp/branches/activemq-cpp-2.x/src/test-integration/activemq/test/TransactionTest.h
Mon Feb 2 15:34:36 2009
@@ -43,6 +43,7 @@
void testSendReceiveTransactedBatches();
void testSendRollback();
void testSendSessionClose();
+ void testWithTTLSet();
};
Modified:
activemq/activemq-cpp/branches/activemq-cpp-2.x/src/test-integration/activemq/test/openwire/OpenwireTransactionTest.h
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-2.x/src/test-integration/activemq/test/openwire/OpenwireTransactionTest.h?rev=740006&r1=740005&r2=740006&view=diff
==============================================================================
---
activemq/activemq-cpp/branches/activemq-cpp-2.x/src/test-integration/activemq/test/openwire/OpenwireTransactionTest.h
(original)
+++
activemq/activemq-cpp/branches/activemq-cpp-2.x/src/test-integration/activemq/test/openwire/OpenwireTransactionTest.h
Mon Feb 2 15:34:36 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/branches/activemq-cpp-2.x/src/test-integration/activemq/test/stomp/StompTransactionTest.h
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-2.x/src/test-integration/activemq/test/stomp/StompTransactionTest.h?rev=740006&r1=740005&r2=740006&view=diff
==============================================================================
---
activemq/activemq-cpp/branches/activemq-cpp-2.x/src/test-integration/activemq/test/stomp/StompTransactionTest.h
(original)
+++
activemq/activemq-cpp/branches/activemq-cpp-2.x/src/test-integration/activemq/test/stomp/StompTransactionTest.h
Mon Feb 2 15:34:36 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();