activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r755013 - /activemq/activemq-cpp/trunk/src/test/activemq/state/ConnectionStateTrackerTest.cpp
Date Mon, 16 Mar 2009 21:43:33 GMT
Author: tabish
Date: Mon Mar 16 21:43:33 2009
New Revision: 755013

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

Adding in unit tests for the State Tracker to try and help find some bugs and make platform
testing easier.

Modified:
    activemq/activemq-cpp/trunk/src/test/activemq/state/ConnectionStateTrackerTest.cpp

Modified: activemq/activemq-cpp/trunk/src/test/activemq/state/ConnectionStateTrackerTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/state/ConnectionStateTrackerTest.cpp?rev=755013&r1=755012&r2=755013&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/state/ConnectionStateTrackerTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/state/ConnectionStateTrackerTest.cpp Mon
Mar 16 21:43:33 2009
@@ -33,6 +33,40 @@
 ////////////////////////////////////////////////////////////////////////////////
 void ConnectionStateTrackerTest::test() {
 
+    Pointer<ConnectionId> conn_id( new ConnectionId );
+    conn_id->setValue( "CONNECTION" );
+    Pointer<ConnectionInfo> conn_info( new ConnectionInfo );
+    conn_info->setConnectionId( conn_id );
+
+    Pointer<SessionId> session_id( new SessionId );
+    session_id->setConnectionId( "CONNECTION" );
+    session_id->setValue( 12345 );
+    Pointer<SessionInfo> session_info( new SessionInfo );
+    session_info->setSessionId( session_id );
+
+    Pointer<ConsumerId> consumer_id( new ConsumerId );
+    consumer_id->setConnectionId( "CONNECTION" );
+    consumer_id->setSessionId( 12345 );
+    consumer_id->setValue( 42 );
+    Pointer<ConsumerInfo> consumer_info( new ConsumerInfo );
+    consumer_info->setConsumerId( consumer_id );
+
+    Pointer<ProducerId> producer_id( new ProducerId );
+    producer_id->setConnectionId( "CONNECTION" );
+    producer_id->setSessionId( 12345 );
+    producer_id->setValue( 42 );
+    Pointer<ProducerInfo> producer_info( new ProducerInfo );
+    producer_info->setProducerId( producer_id );
+
     ConnectionStateTracker tracker;
+    tracker.processAddConnection( conn_info.get() );
+    tracker.processAddSession( session_info.get() );
+    tracker.processAddConsumer( consumer_info.get() );
+    tracker.processAddProducer( producer_info.get() );
+
+    tracker.processRemoveProducer( producer_id.get() );
+    tracker.processRemoveConsumer( consumer_id.get() );
+    tracker.processRemoveSession( session_id.get() );
+    tracker.processRemoveConnection( conn_id.get() );
 
 }



Mime
View raw message