activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r543796 - in /activemq/activemq-cpp/trunk/src/test/activemq/core: ActiveMQConnectionTest.cpp ActiveMQConnectionTest.h
Date Sat, 02 Jun 2007 22:25:42 GMT
Author: tabish
Date: Sat Jun  2 15:25:35 2007
New Revision: 543796

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

return "" on class to getClientId after connection is closed

Modified:
    activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.cpp
    activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.h

Modified: activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.cpp?view=diff&rev=543796&r1=543795&r2=543796
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.cpp Sat Jun
 2 15:25:35 2007
@@ -180,3 +180,61 @@
         throw ex;
     }
 }
+
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQConnectionTest::test2()
+{
+    try
+    {
+        transport::TransportFactoryMapRegistrar registrar(
+            "dummy", new transport::DummyTransportFactory() );
+
+        MyMessageListener listener;
+        MyExceptionListener exListener;
+        MyCommandListener cmdListener;
+        MyDispatcher msgListener;
+        std::string connectionId = "testConnectionId";
+        util::Properties* properties =
+            new util::Properties();
+        transport::Transport* transport = NULL;
+
+        transport::TransportFactory* factory =
+            transport::TransportFactoryMap::getInstance().lookup(
+                "dummy" );
+        if( factory == NULL ){
+            CPPUNIT_ASSERT( false );
+        }
+
+        // Create the transport.
+        transport = factory->createTransport( *properties );
+        if( transport == NULL ){
+            CPPUNIT_ASSERT( false );
+        }
+
+        transport::DummyTransport* dTransport =
+            dynamic_cast< transport::DummyTransport*>( transport );
+
+        CPPUNIT_ASSERT( dTransport != NULL );
+
+        dTransport->setCommandListener( &cmdListener );
+
+        connector::stomp::StompConnector* connector =
+            new connector::stomp::StompConnector(
+                transport, *properties );
+
+        connector->start();
+
+        ActiveMQConnection connection(
+            new ActiveMQConnectionData(
+                connector, transport, properties) );
+
+        connection.getClientID();
+        connection.close();
+
+        CPPUNIT_ASSERT( connection.getClientID() == "" );
+
+    } catch( exceptions::ActiveMQException& ex ) {
+        ex.printStackTrace();
+        throw ex;
+    }
+}

Modified: activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.h?view=diff&rev=543796&r1=543795&r2=543796
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.h Sat Jun  2
15:25:35 2007
@@ -39,6 +39,7 @@
     {
         CPPUNIT_TEST_SUITE( ActiveMQConnectionTest );
         CPPUNIT_TEST( test );
+        CPPUNIT_TEST( test2 );
         CPPUNIT_TEST_SUITE_END();
 
     public:
@@ -113,6 +114,7 @@
         };
 
         void test();
+        void test2();
 
     };
 



Mime
View raw message