activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r419365 [21/25] - in /incubator/activemq/trunk: activemq-core/src/main/java/org/apache/activemq/thread/ activemq-core/src/test/java/org/apache/activemq/openwire/v1/ activemq-cpp/src/main/activemq/concurrent/ activemq-cpp/src/main/activemq/c...
Date Wed, 05 Jul 2006 22:27:47 GMT
Modified: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/StompConnectorTest.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/StompConnectorTest.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/StompConnectorTest.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/StompConnectorTest.h Wed Jul  5 15:27:34 2006
@@ -1,319 +1,319 @@
-#ifndef _ACTIVEMQ_CONNECTOR_STOMP_STOMPCONNECTORTEST_H_
-#define _ACTIVEMQ_CONNECTOR_STOMP_STOMPCONNECTORTEST_H_
-
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
-#include <activemq/connector/stomp/StompResponseBuilder.h>
-#include <activemq/connector/stomp/StompConnector.h>
-#include <activemq/transport/Command.h>
-#include <activemq/connector/stomp/commands/ConnectedCommand.h>
-#include <activemq/connector/stomp/commands/TextMessageCommand.h>
-#include <activemq/connector/stomp/commands/BytesMessageCommand.h>
-#include <activemq/connector/stomp/StompTopic.h>
-#include <activemq/connector/stomp/StompQueue.h>
-#include <activemq/transport/DummyTransport.h>
-
-#include <activemq/io/ByteArrayOutputStream.h>
-#include <algorithm>
-
-namespace activemq{
-namespace connector{
-namespace stomp{
-
-    class StompConnectorTest : public CppUnit::TestFixture
-    {
-        CPPUNIT_TEST_SUITE( StompConnectorTest );
-        CPPUNIT_TEST( testSessions );
-        CPPUNIT_TEST( testConsumers );
-        CPPUNIT_TEST( testProducers );
-        CPPUNIT_TEST( testCommand );
-        CPPUNIT_TEST( testSendingCommands );
-        CPPUNIT_TEST_SUITE_END();
-
-    public:
-    
-    	StompConnectorTest() {}
-    	virtual ~StompConnectorTest() {}
-        
-        class MyCommandListener : public transport::CommandListener{
-        public:
-        
-            transport::Command* cmd;
-            
-        public:
-        
-            MyCommandListener(){
-                cmd = NULL;
-            }
-            virtual ~MyCommandListener(){}
-            
-            virtual void onCommand( transport::Command* command ){
-                cmd = command;
-            }
-        };
-        
-        class MyMessageListener : public ConsumerMessageListener{
-        public:
-        
-            std::vector<ConsumerInfo*> consumers;
-            
-        public:
-            virtual ~MyMessageListener(){}
-            
-            virtual void onConsumerMessage( ConsumerInfo* consumer,
-                core::ActiveMQMessage* msg )
-            {
-                consumers.push_back( consumer );
-            }
-        };
-
-        void testSessions()
-        {
-            std::string connectionId = "testConnectionId";
-            StompResponseBuilder responseBuilder("testConnectionId");
-            transport::DummyTransport transport( &responseBuilder );
-            util::SimpleProperties properties;
-            StompConnector connector( &transport, properties );
-            connector.start();
-            
-            SessionInfo* info1 = connector.createSession( cms::Session::AutoAcknowledge );
-            CPPUNIT_ASSERT( info1->getAckMode() == cms::Session::AutoAcknowledge );
-            CPPUNIT_ASSERT( info1->getConnectionId() == connectionId );
-            
-            SessionInfo* info2 = connector.createSession( cms::Session::DupsOkAcknowledge );
-            CPPUNIT_ASSERT( info2->getAckMode() == cms::Session::DupsOkAcknowledge );
-            CPPUNIT_ASSERT( info2->getConnectionId() == connectionId );
-            
-            SessionInfo* info3 = connector.createSession( cms::Session::ClientAcknowledge );
-            CPPUNIT_ASSERT( info3->getAckMode() == cms::Session::ClientAcknowledge );
-            CPPUNIT_ASSERT( info3->getConnectionId() == connectionId );
-            
-            SessionInfo* info4 = connector.createSession( cms::Session::Transactional );
-            CPPUNIT_ASSERT( info4->getAckMode() == cms::Session::Transactional );
-            CPPUNIT_ASSERT( info4->getConnectionId() == connectionId );
-            
-            connector.destroyResource( info1 );
-            connector.destroyResource( info2 );
-            connector.destroyResource( info3 );
-            connector.destroyResource( info4 );
-
-        }
-        
-        void testConsumers()
-        {
-            std::string connectionId = "testConnectionId";
-            StompResponseBuilder responseBuilder("testConnectionId");
-            transport::DummyTransport transport( &responseBuilder );
-            util::SimpleProperties properties;
-            StompConnector connector( &transport, properties );
-            connector.start();
-            
-            SessionInfo* info1 = connector.createSession( cms::Session::AutoAcknowledge );
-            std::string sel1 = "";
-            StompTopic dest1( "dummy.topic.1" );
-            ConsumerInfo* cinfo1 = connector.createConsumer( &dest1, info1, sel1 );
-            CPPUNIT_ASSERT( cinfo1->getSessionInfo() == info1 );
-            CPPUNIT_ASSERT( cinfo1->getDestination().toString() == dest1.toString() );
-            CPPUNIT_ASSERT( cinfo1->getMessageSelector() == sel1 );
-            
-            SessionInfo* info2 = connector.createSession( cms::Session::DupsOkAcknowledge );
-            std::string sel2 = "mysel2";
-            StompTopic dest2( "dummy.topic.2" );
-            ConsumerInfo* cinfo2 = connector.createConsumer( &dest2, info2, sel2 );
-            CPPUNIT_ASSERT( cinfo2->getSessionInfo() == info2 );
-            CPPUNIT_ASSERT( cinfo2->getDestination().toString() == dest2.toString() );
-            CPPUNIT_ASSERT( cinfo2->getMessageSelector() == sel2 );
-            
-            SessionInfo* info3 = connector.createSession( cms::Session::ClientAcknowledge );
-            std::string sel3 = "mysel3";
-            StompQueue dest3( "dummy.queue.1" );
-            ConsumerInfo* cinfo3 = connector.createConsumer( &dest3, info3, sel3 );
-            CPPUNIT_ASSERT( cinfo3->getSessionInfo() == info3 );
-            CPPUNIT_ASSERT( cinfo3->getDestination().toString() == dest3.toString() );
-            CPPUNIT_ASSERT( cinfo3->getMessageSelector() == sel3 );
-            
-            SessionInfo* info4 = connector.createSession( cms::Session::Transactional );
-            std::string sel4 = "";
-            StompTopic dest4( "dummy.queue.2" );
-            ConsumerInfo* cinfo4 = connector.createConsumer( &dest4, info4, sel4 );
-            CPPUNIT_ASSERT( cinfo4->getSessionInfo() == info4 );
-            CPPUNIT_ASSERT( cinfo4->getDestination().toString() == dest4.toString() );
-            CPPUNIT_ASSERT( cinfo4->getMessageSelector() == sel4 );
-            
-            connector.destroyResource( cinfo1 );
-            connector.destroyResource( cinfo2 );
-            connector.destroyResource( cinfo3 );
-            connector.destroyResource( cinfo4 );
-
-            connector.destroyResource( info1 );
-            connector.destroyResource( info2 );
-            connector.destroyResource( info3 );
-            connector.destroyResource( info4 );
-        }
-
-        void testProducers()
-        {
-            std::string connectionId = "testConnectionId";
-            StompResponseBuilder responseBuilder("testConnectionId");
-            transport::DummyTransport transport( &responseBuilder );
-            util::SimpleProperties properties;
-            StompConnector connector( &transport, properties );
-            connector.start();
-            
-            SessionInfo* info1 = connector.createSession( cms::Session::AutoAcknowledge );
-            StompTopic dest1( "dummy.topic.1" );
-            ProducerInfo* pinfo1 = connector.createProducer( &dest1, info1 );
-            CPPUNIT_ASSERT( pinfo1->getSessionInfo() == info1 );
-            CPPUNIT_ASSERT( pinfo1->getDestination().toString() == dest1.toString() );
-            
-            SessionInfo* info2 = connector.createSession( cms::Session::DupsOkAcknowledge );
-            StompTopic dest2( "dummy.topic.2" );
-            ProducerInfo* pinfo2 = connector.createProducer( &dest2, info2 );
-            CPPUNIT_ASSERT( pinfo2->getSessionInfo() == info2 );
-            CPPUNIT_ASSERT( pinfo2->getDestination().toString() == dest2.toString() );
-            
-            SessionInfo* info3 = connector.createSession( cms::Session::ClientAcknowledge );
-            StompQueue dest3( "dummy.queue.1" );
-            ProducerInfo* pinfo3 = connector.createProducer( &dest3, info3 );
-            CPPUNIT_ASSERT( pinfo3->getSessionInfo() == info3 );
-            CPPUNIT_ASSERT( pinfo3->getDestination().toString() == dest3.toString() );
-            
-            SessionInfo* info4 = connector.createSession( cms::Session::Transactional );
-            StompTopic dest4( "dummy.queue.2" );
-            ProducerInfo* pinfo4 = connector.createProducer( &dest4, info4 );
-            CPPUNIT_ASSERT( pinfo4->getSessionInfo() == info4 );
-            CPPUNIT_ASSERT( pinfo4->getDestination().toString() == dest4.toString() );
-            
-            connector.destroyResource( pinfo1 );
-            connector.destroyResource( pinfo2 );
-            connector.destroyResource( pinfo3 );
-            connector.destroyResource( pinfo4 );
-
-            connector.destroyResource( info1 );
-            connector.destroyResource( info2 );
-            connector.destroyResource( info3 );
-            connector.destroyResource( info4 );
-        }
-        
-        void testCommand()
-        {
-            std::string connectionId = "testConnectionId";
-            StompResponseBuilder responseBuilder("testConnectionId");
-            transport::DummyTransport transport( &responseBuilder );
-            util::SimpleProperties properties;
-            StompConnector connector( &transport, properties );
-            connector.start();
-            
-            StompTopic dest1( "dummy.topic" );
-            StompTopic dest2( "dummy.topic2" );
-            
-            SessionInfo* info1 = connector.createSession( cms::Session::AutoAcknowledge );
-            ConsumerInfo* cinfo1 = connector.createConsumer( &dest1, info1, "" );
-            
-            SessionInfo* info2 = connector.createSession( cms::Session::DupsOkAcknowledge );
-            ConsumerInfo* cinfo2 = connector.createConsumer( &dest1, info2, "" );
-            
-            SessionInfo* info3 = connector.createSession( cms::Session::ClientAcknowledge );
-            ConsumerInfo* cinfo3 = connector.createConsumer( &dest2, info3, "" );
-            
-            SessionInfo* info4 = connector.createSession( cms::Session::Transactional );
-            ConsumerInfo* cinfo4 = connector.createConsumer( &dest2, info4, "" );
-            
-            MyMessageListener listener;
-            connector.setConsumerMessageListener( &listener );
-            
-            StompFrame* frame = new StompFrame();
-            frame->setCommand( "MESSAGE" );
-            frame->getProperties().setProperty( 
-                "destination", dest1.toProviderString() );
-            const char* buffer = strdup("hello world");
-            frame->setBody( buffer, 12 );
-
-            commands::TextMessageCommand* msg = 
-                new commands::TextMessageCommand( frame );
-            transport.fireCommand( msg );
-            
-            CPPUNIT_ASSERT( listener.consumers.size() == 2 );
-            for( unsigned int ix=0; ix<listener.consumers.size(); ++ix ){
-                CPPUNIT_ASSERT( listener.consumers[ix] == cinfo1 || 
-                    listener.consumers[ix] == cinfo2 );
-            }
-            
-            // Clean up the consumers list
-            listener.consumers.clear();
-            
-            frame = new StompFrame();
-            frame->setCommand( "MESSAGE" );
-            frame->getProperties().setProperty( 
-                "destination", dest2.toProviderString() );
-            buffer = strdup("hello world");
-            frame->setBody( buffer, 12 );
-
-            msg = new commands::TextMessageCommand( frame );
-            transport.fireCommand( msg );
-            
-            CPPUNIT_ASSERT( listener.consumers.size() == 2 );
-            for( unsigned int ix=0; ix<listener.consumers.size(); ++ix ){
-                CPPUNIT_ASSERT( listener.consumers[ix] == cinfo3 || 
-                    listener.consumers[ix] == cinfo4 );
-            }
-                        
-            connector.destroyResource( cinfo1 );
-            connector.destroyResource( cinfo2 );
-            connector.destroyResource( cinfo3 );
-            connector.destroyResource( cinfo4 );
-
-            connector.destroyResource( info1 );
-            connector.destroyResource( info2 );
-            connector.destroyResource( info3 );
-            connector.destroyResource( info4 );
-        }
-        
-        void testSendingCommands()
-        {
-            std::string connectionId = "testConnectionId";
-            StompResponseBuilder responseBuilder("testConnectionId");
-            transport::DummyTransport transport( &responseBuilder );
-            util::SimpleProperties properties;
-            StompConnector* connector = 
-                new StompConnector( &transport, properties );
-            connector->start();
-            
-            StompTopic dest1( "dummy.topic.1" );
-            
-            MyCommandListener cmdListener;
-            transport.setOutgoingCommandListener( &cmdListener );
-            
-            SessionInfo* info1 = connector->createSession( cms::Session::AutoAcknowledge );
-            ConsumerInfo* cinfo1 = connector->createConsumer( &dest1, info1, "" );                    
-            CPPUNIT_ASSERT( cmdListener.cmd != NULL );
-            
-            cmdListener.cmd = NULL;
-            
-            SessionInfo* info2 = connector->createSession( cms::Session::DupsOkAcknowledge );
-            ConsumerInfo* cinfo2 = connector->createConsumer( &dest1, info2, "" );
-            CPPUNIT_ASSERT( cmdListener.cmd == NULL );
-            
-            cmdListener.cmd = NULL;
-            
-            connector->destroyResource( cinfo1 );
-            CPPUNIT_ASSERT( cmdListener.cmd == NULL );
-            
-            cmdListener.cmd = NULL;
-            
-            connector->destroyResource( cinfo2 );
-            CPPUNIT_ASSERT( cmdListener.cmd != NULL );
-            
-            connector->destroyResource( info1 );
-            connector->destroyResource( info2 );
-            
-            delete connector;
-            CPPUNIT_ASSERT( cmdListener.cmd != NULL );
-        }
-
-    };
-
-}}}
-
-#endif /*_ACTIVEMQ_CONNECTOR_STOMP_STOMPCONNECTORTEST_H_*/
+#ifndef _ACTIVEMQ_CONNECTOR_STOMP_STOMPCONNECTORTEST_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_STOMPCONNECTORTEST_H_
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+#include <activemq/connector/stomp/StompResponseBuilder.h>
+#include <activemq/connector/stomp/StompConnector.h>
+#include <activemq/transport/Command.h>
+#include <activemq/connector/stomp/commands/ConnectedCommand.h>
+#include <activemq/connector/stomp/commands/TextMessageCommand.h>
+#include <activemq/connector/stomp/commands/BytesMessageCommand.h>
+#include <activemq/connector/stomp/StompTopic.h>
+#include <activemq/connector/stomp/StompQueue.h>
+#include <activemq/transport/DummyTransport.h>
+
+#include <activemq/io/ByteArrayOutputStream.h>
+#include <algorithm>
+
+namespace activemq{
+namespace connector{
+namespace stomp{
+
+    class StompConnectorTest : public CppUnit::TestFixture
+    {
+        CPPUNIT_TEST_SUITE( StompConnectorTest );
+        CPPUNIT_TEST( testSessions );
+        CPPUNIT_TEST( testConsumers );
+        CPPUNIT_TEST( testProducers );
+        CPPUNIT_TEST( testCommand );
+        CPPUNIT_TEST( testSendingCommands );
+        CPPUNIT_TEST_SUITE_END();
+
+    public:
+    
+    	StompConnectorTest() {}
+    	virtual ~StompConnectorTest() {}
+        
+        class MyCommandListener : public transport::CommandListener{
+        public:
+        
+            transport::Command* cmd;
+            
+        public:
+        
+            MyCommandListener(){
+                cmd = NULL;
+            }
+            virtual ~MyCommandListener(){}
+            
+            virtual void onCommand( transport::Command* command ){
+                cmd = command;
+            }
+        };
+        
+        class MyMessageListener : public ConsumerMessageListener{
+        public:
+        
+            std::vector<ConsumerInfo*> consumers;
+            
+        public:
+            virtual ~MyMessageListener(){}
+            
+            virtual void onConsumerMessage( ConsumerInfo* consumer,
+                core::ActiveMQMessage* msg )
+            {
+                consumers.push_back( consumer );
+            }
+        };
+
+        void testSessions()
+        {
+            std::string connectionId = "testConnectionId";
+            StompResponseBuilder responseBuilder("testConnectionId");
+            transport::DummyTransport transport( &responseBuilder );
+            util::SimpleProperties properties;
+            StompConnector connector( &transport, properties );
+            connector.start();
+            
+            SessionInfo* info1 = connector.createSession( cms::Session::AutoAcknowledge );
+            CPPUNIT_ASSERT( info1->getAckMode() == cms::Session::AutoAcknowledge );
+            CPPUNIT_ASSERT( info1->getConnectionId() == connectionId );
+            
+            SessionInfo* info2 = connector.createSession( cms::Session::DupsOkAcknowledge );
+            CPPUNIT_ASSERT( info2->getAckMode() == cms::Session::DupsOkAcknowledge );
+            CPPUNIT_ASSERT( info2->getConnectionId() == connectionId );
+            
+            SessionInfo* info3 = connector.createSession( cms::Session::ClientAcknowledge );
+            CPPUNIT_ASSERT( info3->getAckMode() == cms::Session::ClientAcknowledge );
+            CPPUNIT_ASSERT( info3->getConnectionId() == connectionId );
+            
+            SessionInfo* info4 = connector.createSession( cms::Session::Transactional );
+            CPPUNIT_ASSERT( info4->getAckMode() == cms::Session::Transactional );
+            CPPUNIT_ASSERT( info4->getConnectionId() == connectionId );
+            
+            connector.destroyResource( info1 );
+            connector.destroyResource( info2 );
+            connector.destroyResource( info3 );
+            connector.destroyResource( info4 );
+
+        }
+        
+        void testConsumers()
+        {
+            std::string connectionId = "testConnectionId";
+            StompResponseBuilder responseBuilder("testConnectionId");
+            transport::DummyTransport transport( &responseBuilder );
+            util::SimpleProperties properties;
+            StompConnector connector( &transport, properties );
+            connector.start();
+            
+            SessionInfo* info1 = connector.createSession( cms::Session::AutoAcknowledge );
+            std::string sel1 = "";
+            StompTopic dest1( "dummy.topic.1" );
+            ConsumerInfo* cinfo1 = connector.createConsumer( &dest1, info1, sel1 );
+            CPPUNIT_ASSERT( cinfo1->getSessionInfo() == info1 );
+            CPPUNIT_ASSERT( cinfo1->getDestination().toString() == dest1.toString() );
+            CPPUNIT_ASSERT( cinfo1->getMessageSelector() == sel1 );
+            
+            SessionInfo* info2 = connector.createSession( cms::Session::DupsOkAcknowledge );
+            std::string sel2 = "mysel2";
+            StompTopic dest2( "dummy.topic.2" );
+            ConsumerInfo* cinfo2 = connector.createConsumer( &dest2, info2, sel2 );
+            CPPUNIT_ASSERT( cinfo2->getSessionInfo() == info2 );
+            CPPUNIT_ASSERT( cinfo2->getDestination().toString() == dest2.toString() );
+            CPPUNIT_ASSERT( cinfo2->getMessageSelector() == sel2 );
+            
+            SessionInfo* info3 = connector.createSession( cms::Session::ClientAcknowledge );
+            std::string sel3 = "mysel3";
+            StompQueue dest3( "dummy.queue.1" );
+            ConsumerInfo* cinfo3 = connector.createConsumer( &dest3, info3, sel3 );
+            CPPUNIT_ASSERT( cinfo3->getSessionInfo() == info3 );
+            CPPUNIT_ASSERT( cinfo3->getDestination().toString() == dest3.toString() );
+            CPPUNIT_ASSERT( cinfo3->getMessageSelector() == sel3 );
+            
+            SessionInfo* info4 = connector.createSession( cms::Session::Transactional );
+            std::string sel4 = "";
+            StompTopic dest4( "dummy.queue.2" );
+            ConsumerInfo* cinfo4 = connector.createConsumer( &dest4, info4, sel4 );
+            CPPUNIT_ASSERT( cinfo4->getSessionInfo() == info4 );
+            CPPUNIT_ASSERT( cinfo4->getDestination().toString() == dest4.toString() );
+            CPPUNIT_ASSERT( cinfo4->getMessageSelector() == sel4 );
+            
+            connector.destroyResource( cinfo1 );
+            connector.destroyResource( cinfo2 );
+            connector.destroyResource( cinfo3 );
+            connector.destroyResource( cinfo4 );
+
+            connector.destroyResource( info1 );
+            connector.destroyResource( info2 );
+            connector.destroyResource( info3 );
+            connector.destroyResource( info4 );
+        }
+
+        void testProducers()
+        {
+            std::string connectionId = "testConnectionId";
+            StompResponseBuilder responseBuilder("testConnectionId");
+            transport::DummyTransport transport( &responseBuilder );
+            util::SimpleProperties properties;
+            StompConnector connector( &transport, properties );
+            connector.start();
+            
+            SessionInfo* info1 = connector.createSession( cms::Session::AutoAcknowledge );
+            StompTopic dest1( "dummy.topic.1" );
+            ProducerInfo* pinfo1 = connector.createProducer( &dest1, info1 );
+            CPPUNIT_ASSERT( pinfo1->getSessionInfo() == info1 );
+            CPPUNIT_ASSERT( pinfo1->getDestination().toString() == dest1.toString() );
+            
+            SessionInfo* info2 = connector.createSession( cms::Session::DupsOkAcknowledge );
+            StompTopic dest2( "dummy.topic.2" );
+            ProducerInfo* pinfo2 = connector.createProducer( &dest2, info2 );
+            CPPUNIT_ASSERT( pinfo2->getSessionInfo() == info2 );
+            CPPUNIT_ASSERT( pinfo2->getDestination().toString() == dest2.toString() );
+            
+            SessionInfo* info3 = connector.createSession( cms::Session::ClientAcknowledge );
+            StompQueue dest3( "dummy.queue.1" );
+            ProducerInfo* pinfo3 = connector.createProducer( &dest3, info3 );
+            CPPUNIT_ASSERT( pinfo3->getSessionInfo() == info3 );
+            CPPUNIT_ASSERT( pinfo3->getDestination().toString() == dest3.toString() );
+            
+            SessionInfo* info4 = connector.createSession( cms::Session::Transactional );
+            StompTopic dest4( "dummy.queue.2" );
+            ProducerInfo* pinfo4 = connector.createProducer( &dest4, info4 );
+            CPPUNIT_ASSERT( pinfo4->getSessionInfo() == info4 );
+            CPPUNIT_ASSERT( pinfo4->getDestination().toString() == dest4.toString() );
+            
+            connector.destroyResource( pinfo1 );
+            connector.destroyResource( pinfo2 );
+            connector.destroyResource( pinfo3 );
+            connector.destroyResource( pinfo4 );
+
+            connector.destroyResource( info1 );
+            connector.destroyResource( info2 );
+            connector.destroyResource( info3 );
+            connector.destroyResource( info4 );
+        }
+        
+        void testCommand()
+        {
+            std::string connectionId = "testConnectionId";
+            StompResponseBuilder responseBuilder("testConnectionId");
+            transport::DummyTransport transport( &responseBuilder );
+            util::SimpleProperties properties;
+            StompConnector connector( &transport, properties );
+            connector.start();
+            
+            StompTopic dest1( "dummy.topic" );
+            StompTopic dest2( "dummy.topic2" );
+            
+            SessionInfo* info1 = connector.createSession( cms::Session::AutoAcknowledge );
+            ConsumerInfo* cinfo1 = connector.createConsumer( &dest1, info1, "" );
+            
+            SessionInfo* info2 = connector.createSession( cms::Session::DupsOkAcknowledge );
+            ConsumerInfo* cinfo2 = connector.createConsumer( &dest1, info2, "" );
+            
+            SessionInfo* info3 = connector.createSession( cms::Session::ClientAcknowledge );
+            ConsumerInfo* cinfo3 = connector.createConsumer( &dest2, info3, "" );
+            
+            SessionInfo* info4 = connector.createSession( cms::Session::Transactional );
+            ConsumerInfo* cinfo4 = connector.createConsumer( &dest2, info4, "" );
+            
+            MyMessageListener listener;
+            connector.setConsumerMessageListener( &listener );
+            
+            StompFrame* frame = new StompFrame();
+            frame->setCommand( "MESSAGE" );
+            frame->getProperties().setProperty( 
+                "destination", dest1.toProviderString() );
+            const char* buffer = strdup("hello world");
+            frame->setBody( buffer, 12 );
+
+            commands::TextMessageCommand* msg = 
+                new commands::TextMessageCommand( frame );
+            transport.fireCommand( msg );
+            
+            CPPUNIT_ASSERT( listener.consumers.size() == 2 );
+            for( unsigned int ix=0; ix<listener.consumers.size(); ++ix ){
+                CPPUNIT_ASSERT( listener.consumers[ix] == cinfo1 || 
+                    listener.consumers[ix] == cinfo2 );
+            }
+            
+            // Clean up the consumers list
+            listener.consumers.clear();
+            
+            frame = new StompFrame();
+            frame->setCommand( "MESSAGE" );
+            frame->getProperties().setProperty( 
+                "destination", dest2.toProviderString() );
+            buffer = strdup("hello world");
+            frame->setBody( buffer, 12 );
+
+            msg = new commands::TextMessageCommand( frame );
+            transport.fireCommand( msg );
+            
+            CPPUNIT_ASSERT( listener.consumers.size() == 2 );
+            for( unsigned int ix=0; ix<listener.consumers.size(); ++ix ){
+                CPPUNIT_ASSERT( listener.consumers[ix] == cinfo3 || 
+                    listener.consumers[ix] == cinfo4 );
+            }
+                        
+            connector.destroyResource( cinfo1 );
+            connector.destroyResource( cinfo2 );
+            connector.destroyResource( cinfo3 );
+            connector.destroyResource( cinfo4 );
+
+            connector.destroyResource( info1 );
+            connector.destroyResource( info2 );
+            connector.destroyResource( info3 );
+            connector.destroyResource( info4 );
+        }
+        
+        void testSendingCommands()
+        {
+            std::string connectionId = "testConnectionId";
+            StompResponseBuilder responseBuilder("testConnectionId");
+            transport::DummyTransport transport( &responseBuilder );
+            util::SimpleProperties properties;
+            StompConnector* connector = 
+                new StompConnector( &transport, properties );
+            connector->start();
+            
+            StompTopic dest1( "dummy.topic.1" );
+            
+            MyCommandListener cmdListener;
+            transport.setOutgoingCommandListener( &cmdListener );
+            
+            SessionInfo* info1 = connector->createSession( cms::Session::AutoAcknowledge );
+            ConsumerInfo* cinfo1 = connector->createConsumer( &dest1, info1, "" );                    
+            CPPUNIT_ASSERT( cmdListener.cmd != NULL );
+            
+            cmdListener.cmd = NULL;
+            
+            SessionInfo* info2 = connector->createSession( cms::Session::DupsOkAcknowledge );
+            ConsumerInfo* cinfo2 = connector->createConsumer( &dest1, info2, "" );
+            CPPUNIT_ASSERT( cmdListener.cmd == NULL );
+            
+            cmdListener.cmd = NULL;
+            
+            connector->destroyResource( cinfo1 );
+            CPPUNIT_ASSERT( cmdListener.cmd == NULL );
+            
+            cmdListener.cmd = NULL;
+            
+            connector->destroyResource( cinfo2 );
+            CPPUNIT_ASSERT( cmdListener.cmd != NULL );
+            
+            connector->destroyResource( info1 );
+            connector->destroyResource( info2 );
+            
+            delete connector;
+            CPPUNIT_ASSERT( cmdListener.cmd != NULL );
+        }
+
+    };
+
+}}}
+
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_STOMPCONNECTORTEST_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/StompConnectorTest.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/StompFrameTest.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/StompFrameTest.cpp?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/StompFrameTest.cpp (original)
+++ incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/StompFrameTest.cpp Wed Jul  5 15:27:34 2006
@@ -1,3 +1,3 @@
-#include "StompFrameTest.h"
-
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::connector::stomp::StompFrameTest );
+#include "StompFrameTest.h"
+
+CPPUNIT_TEST_SUITE_REGISTRATION( activemq::connector::stomp::StompFrameTest );

Propchange: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/StompFrameTest.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/StompFrameTest.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/StompFrameTest.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/StompFrameTest.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/StompFrameTest.h Wed Jul  5 15:27:34 2006
@@ -1,52 +1,52 @@
-#ifndef _ACTIVEMQ_CONNECTOR_STOMP_STOMPFRAMETEST_H_
-#define _ACTIVEMQ_CONNECTOR_STOMP_STOMPFRAMETEST_H_
-
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
-#include <activemq/connector/stomp/StompFrame.h>
-
-namespace activemq{
-namespace connector{
-namespace stomp{
-
-   class StompFrameTest : public CppUnit::TestFixture
-   {
-
-     CPPUNIT_TEST_SUITE( StompFrameTest );
-     CPPUNIT_TEST( test );
-     CPPUNIT_TEST_SUITE_END();
-
-   public:
-
-   	virtual ~StompFrameTest() {}
-
-      void test()
-      {
-         StompFrame frame;
-         
-         CPPUNIT_ASSERT( frame.getCommand() == "" );
-         frame.setCommand("test");
-         CPPUNIT_ASSERT( frame.getCommand() == "test" );
-                  
-         frame.getProperties().setProperty("key", "value");
-         
-         std::string result = frame.getProperties().getProperty("key");
-         
-         CPPUNIT_ASSERT( result == "value" );         
-         
-         CPPUNIT_ASSERT( frame.getBody() == NULL );
-         CPPUNIT_ASSERT( frame.getBodyLength() == 0 );
-         
-         frame.setBody( strdup("ABC"), 4 );
-         
-         CPPUNIT_ASSERT( frame.getBody() != NULL );
-         CPPUNIT_ASSERT( frame.getBodyLength() == 4 );
-         CPPUNIT_ASSERT( std::string(frame.getBody()) == "ABC" );
-      }
-      
-   };
-
-}}}
-
-#endif /*_ACTIVEMQ_CONNECTOR_STOMP_STOMPFRAMETEST_H_*/
+#ifndef _ACTIVEMQ_CONNECTOR_STOMP_STOMPFRAMETEST_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_STOMPFRAMETEST_H_
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+#include <activemq/connector/stomp/StompFrame.h>
+
+namespace activemq{
+namespace connector{
+namespace stomp{
+
+   class StompFrameTest : public CppUnit::TestFixture
+   {
+
+     CPPUNIT_TEST_SUITE( StompFrameTest );
+     CPPUNIT_TEST( test );
+     CPPUNIT_TEST_SUITE_END();
+
+   public:
+
+   	virtual ~StompFrameTest() {}
+
+      void test()
+      {
+         StompFrame frame;
+         
+         CPPUNIT_ASSERT( frame.getCommand() == "" );
+         frame.setCommand("test");
+         CPPUNIT_ASSERT( frame.getCommand() == "test" );
+                  
+         frame.getProperties().setProperty("key", "value");
+         
+         std::string result = frame.getProperties().getProperty("key");
+         
+         CPPUNIT_ASSERT( result == "value" );         
+         
+         CPPUNIT_ASSERT( frame.getBody() == NULL );
+         CPPUNIT_ASSERT( frame.getBodyLength() == 0 );
+         
+         frame.setBody( strdup("ABC"), 4 );
+         
+         CPPUNIT_ASSERT( frame.getBody() != NULL );
+         CPPUNIT_ASSERT( frame.getBodyLength() == 4 );
+         CPPUNIT_ASSERT( std::string(frame.getBody()) == "ABC" );
+      }
+      
+   };
+
+}}}
+
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_STOMPFRAMETEST_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/StompFrameTest.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/StompResponseBuilder.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/StompSessionManagerTest.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/StompSessionManagerTest.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/AbortCommandTest.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/AbortCommandTest.cpp?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/AbortCommandTest.cpp (original)
+++ incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/AbortCommandTest.cpp Wed Jul  5 15:27:34 2006
@@ -1,3 +1,3 @@
-#include "AbortCommandTest.h"
-
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::connector::stomp::commands::AbortCommandTest );
+#include "AbortCommandTest.h"
+
+CPPUNIT_TEST_SUITE_REGISTRATION( activemq::connector::stomp::commands::AbortCommandTest );

Propchange: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/AbortCommandTest.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/AbortCommandTest.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/AbortCommandTest.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/AbortCommandTest.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/AbortCommandTest.h Wed Jul  5 15:27:34 2006
@@ -1,62 +1,62 @@
-#ifndef _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ABORTCOMMANDTEST_H_
-#define _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ABORTCOMMANDTEST_H_
-
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
-#include <activemq/connector/stomp/commands/AbortCommand.h>
-
-namespace activemq{
-namespace connector{
-namespace stomp{
-namespace commands{
-
-    class AbortCommandTest : public CppUnit::TestFixture
-    {
-        CPPUNIT_TEST_SUITE( AbortCommandTest );
-        CPPUNIT_TEST( test );
-        CPPUNIT_TEST_SUITE_END();
-
-    public:
-
-    	AbortCommandTest() {}
-    	virtual ~AbortCommandTest() {}
-
-        void test(void)
-        {
-            AbortCommand cmd;
-
-            CPPUNIT_ASSERT( cmd.getStompCommandId() == 
-                            CommandConstants::ABORT );
-            
-            CPPUNIT_ASSERT( cmd.isResponseRequired() == false );
-            cmd.setResponseRequired( true );
-            cmd.setCommandId( 123 );
-            CPPUNIT_ASSERT( cmd.isResponseRequired() == true );
-            CPPUNIT_ASSERT( cmd.getCommandId() == 123 );
-            cmd.setCorrelationId( 99 );
-            CPPUNIT_ASSERT( cmd.getCorrelationId() == 99 );
-            CPPUNIT_ASSERT( cmd.getTransactionId() == NULL );
-            cmd.setTransactionId( "ID:123456" );
-            CPPUNIT_ASSERT( std::string( cmd.getTransactionId() ) == 
-                            "ID:123456" );
-            
-            StompFrame* frame = cmd.marshal().clone();
-            
-            CPPUNIT_ASSERT( frame != NULL );
-            
-            AbortCommand cmd1( frame );
-            
-            CPPUNIT_ASSERT( cmd.getCommandId() == cmd1.getCommandId() );
-            CPPUNIT_ASSERT( cmd.getStompCommandId() == cmd1.getStompCommandId() );
-            CPPUNIT_ASSERT( cmd.isResponseRequired() == cmd1.isResponseRequired() );
-            CPPUNIT_ASSERT( cmd.getCorrelationId() == cmd1.getCorrelationId() );
-            CPPUNIT_ASSERT( std::string(cmd.getTransactionId()) == cmd1.getTransactionId() );
-            
-        }
-        
-    };
-
-}}}}
-
-#endif /*_ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ABORTCOMMANDTEST_H_*/
+#ifndef _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ABORTCOMMANDTEST_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ABORTCOMMANDTEST_H_
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+#include <activemq/connector/stomp/commands/AbortCommand.h>
+
+namespace activemq{
+namespace connector{
+namespace stomp{
+namespace commands{
+
+    class AbortCommandTest : public CppUnit::TestFixture
+    {
+        CPPUNIT_TEST_SUITE( AbortCommandTest );
+        CPPUNIT_TEST( test );
+        CPPUNIT_TEST_SUITE_END();
+
+    public:
+
+    	AbortCommandTest() {}
+    	virtual ~AbortCommandTest() {}
+
+        void test(void)
+        {
+            AbortCommand cmd;
+
+            CPPUNIT_ASSERT( cmd.getStompCommandId() == 
+                            CommandConstants::ABORT );
+            
+            CPPUNIT_ASSERT( cmd.isResponseRequired() == false );
+            cmd.setResponseRequired( true );
+            cmd.setCommandId( 123 );
+            CPPUNIT_ASSERT( cmd.isResponseRequired() == true );
+            CPPUNIT_ASSERT( cmd.getCommandId() == 123 );
+            cmd.setCorrelationId( 99 );
+            CPPUNIT_ASSERT( cmd.getCorrelationId() == 99 );
+            CPPUNIT_ASSERT( cmd.getTransactionId() == NULL );
+            cmd.setTransactionId( "ID:123456" );
+            CPPUNIT_ASSERT( std::string( cmd.getTransactionId() ) == 
+                            "ID:123456" );
+            
+            StompFrame* frame = cmd.marshal().clone();
+            
+            CPPUNIT_ASSERT( frame != NULL );
+            
+            AbortCommand cmd1( frame );
+            
+            CPPUNIT_ASSERT( cmd.getCommandId() == cmd1.getCommandId() );
+            CPPUNIT_ASSERT( cmd.getStompCommandId() == cmd1.getStompCommandId() );
+            CPPUNIT_ASSERT( cmd.isResponseRequired() == cmd1.isResponseRequired() );
+            CPPUNIT_ASSERT( cmd.getCorrelationId() == cmd1.getCorrelationId() );
+            CPPUNIT_ASSERT( std::string(cmd.getTransactionId()) == cmd1.getTransactionId() );
+            
+        }
+        
+    };
+
+}}}}
+
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ABORTCOMMANDTEST_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/AbortCommandTest.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/AckCommandTest.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/AckCommandTest.cpp?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/AckCommandTest.cpp (original)
+++ incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/AckCommandTest.cpp Wed Jul  5 15:27:34 2006
@@ -1,3 +1,3 @@
-#include "AckCommandTest.h"
-
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::connector::stomp::commands::AckCommandTest );
+#include "AckCommandTest.h"
+
+CPPUNIT_TEST_SUITE_REGISTRATION( activemq::connector::stomp::commands::AckCommandTest );

Propchange: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/AckCommandTest.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/AckCommandTest.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/AckCommandTest.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/AckCommandTest.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/AckCommandTest.h Wed Jul  5 15:27:34 2006
@@ -1,65 +1,65 @@
-#ifndef _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ACKCOMMANDTEST_H_
-#define _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ACKCOMMANDTEST_H_
-
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
-#include <activemq/connector/stomp/commands/AckCommand.h>
-
-namespace activemq{
-namespace connector{
-namespace stomp{
-namespace commands{
-            
-    class AckCommandTest : public CppUnit::TestFixture
-    {
-        CPPUNIT_TEST_SUITE( AckCommandTest );
-        CPPUNIT_TEST( test );
-        CPPUNIT_TEST_SUITE_END();
-
-    public:
-
-    	AckCommandTest() {}
-    	virtual ~AckCommandTest() {}
-
-        void test(void)
-        {
-            AckCommand cmd;
-
-            CPPUNIT_ASSERT( cmd.getStompCommandId() == 
-                            CommandConstants::ACK );
-            
-            CPPUNIT_ASSERT( cmd.isResponseRequired() == false );
-            cmd.setResponseRequired( true );
-            cmd.setCommandId( 123 );
-            CPPUNIT_ASSERT( cmd.isResponseRequired() == true );
-            CPPUNIT_ASSERT( cmd.getCommandId() == 123 );
-            cmd.setCorrelationId( 99 );
-            CPPUNIT_ASSERT( cmd.getCorrelationId() == 99 );
-            CPPUNIT_ASSERT( cmd.getTransactionId() == NULL );
-            cmd.setTransactionId( "ID:123456" );
-            CPPUNIT_ASSERT( std::string( cmd.getTransactionId() ) == 
-                            "ID:123456" );
-            CPPUNIT_ASSERT( cmd.getMessageId() == NULL );
-            cmd.setMessageId( "ID:123456789" );
-            CPPUNIT_ASSERT( std::string( cmd.getMessageId() ) == "ID:123456789" );
-            
-            StompFrame* frame = cmd.marshal().clone();
-            
-            CPPUNIT_ASSERT( frame != NULL );
-            
-            AckCommand cmd1( frame );
-            
-            CPPUNIT_ASSERT( cmd.getCommandId() == cmd1.getCommandId() );
-            CPPUNIT_ASSERT( cmd.getStompCommandId() == cmd1.getStompCommandId() );
-            CPPUNIT_ASSERT( cmd.isResponseRequired() == cmd1.isResponseRequired() );
-            CPPUNIT_ASSERT( cmd.getCorrelationId() == cmd1.getCorrelationId() );
-            CPPUNIT_ASSERT( std::string(cmd.getMessageId()) == cmd1.getMessageId() );
-            CPPUNIT_ASSERT( std::string(cmd.getTransactionId()) == cmd1.getTransactionId() );
-            
-        }
-    };
-
-}}}}
-
-#endif /*_ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ACKCOMMANDTEST_H_*/
+#ifndef _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ACKCOMMANDTEST_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ACKCOMMANDTEST_H_
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+#include <activemq/connector/stomp/commands/AckCommand.h>
+
+namespace activemq{
+namespace connector{
+namespace stomp{
+namespace commands{
+            
+    class AckCommandTest : public CppUnit::TestFixture
+    {
+        CPPUNIT_TEST_SUITE( AckCommandTest );
+        CPPUNIT_TEST( test );
+        CPPUNIT_TEST_SUITE_END();
+
+    public:
+
+    	AckCommandTest() {}
+    	virtual ~AckCommandTest() {}
+
+        void test(void)
+        {
+            AckCommand cmd;
+
+            CPPUNIT_ASSERT( cmd.getStompCommandId() == 
+                            CommandConstants::ACK );
+            
+            CPPUNIT_ASSERT( cmd.isResponseRequired() == false );
+            cmd.setResponseRequired( true );
+            cmd.setCommandId( 123 );
+            CPPUNIT_ASSERT( cmd.isResponseRequired() == true );
+            CPPUNIT_ASSERT( cmd.getCommandId() == 123 );
+            cmd.setCorrelationId( 99 );
+            CPPUNIT_ASSERT( cmd.getCorrelationId() == 99 );
+            CPPUNIT_ASSERT( cmd.getTransactionId() == NULL );
+            cmd.setTransactionId( "ID:123456" );
+            CPPUNIT_ASSERT( std::string( cmd.getTransactionId() ) == 
+                            "ID:123456" );
+            CPPUNIT_ASSERT( cmd.getMessageId() == NULL );
+            cmd.setMessageId( "ID:123456789" );
+            CPPUNIT_ASSERT( std::string( cmd.getMessageId() ) == "ID:123456789" );
+            
+            StompFrame* frame = cmd.marshal().clone();
+            
+            CPPUNIT_ASSERT( frame != NULL );
+            
+            AckCommand cmd1( frame );
+            
+            CPPUNIT_ASSERT( cmd.getCommandId() == cmd1.getCommandId() );
+            CPPUNIT_ASSERT( cmd.getStompCommandId() == cmd1.getStompCommandId() );
+            CPPUNIT_ASSERT( cmd.isResponseRequired() == cmd1.isResponseRequired() );
+            CPPUNIT_ASSERT( cmd.getCorrelationId() == cmd1.getCorrelationId() );
+            CPPUNIT_ASSERT( std::string(cmd.getMessageId()) == cmd1.getMessageId() );
+            CPPUNIT_ASSERT( std::string(cmd.getTransactionId()) == cmd1.getTransactionId() );
+            
+        }
+    };
+
+}}}}
+
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_ACKCOMMANDTEST_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/AckCommandTest.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/BeginCommandTest.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/BeginCommandTest.cpp?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/BeginCommandTest.cpp (original)
+++ incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/BeginCommandTest.cpp Wed Jul  5 15:27:34 2006
@@ -1,3 +1,3 @@
-#include "BeginCommandTest.h"
-
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::connector::stomp::commands::BeginCommandTest );
+#include "BeginCommandTest.h"
+
+CPPUNIT_TEST_SUITE_REGISTRATION( activemq::connector::stomp::commands::BeginCommandTest );

Propchange: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/BeginCommandTest.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/BeginCommandTest.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/BeginCommandTest.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/BeginCommandTest.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/BeginCommandTest.h Wed Jul  5 15:27:34 2006
@@ -1,62 +1,62 @@
-#ifndef _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_BEGINCOMMANDTEST_H_
-#define _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_BEGINCOMMANDTEST_H_
-
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
-#include <activemq/connector/stomp/commands/BeginCommand.h>
-
-namespace activemq{
-namespace connector{
-namespace stomp{
-namespace commands{
-
-    class BeginCommandTest: public CppUnit::TestFixture
-    {
-        CPPUNIT_TEST_SUITE( BeginCommandTest );
-        CPPUNIT_TEST( test );
-        CPPUNIT_TEST_SUITE_END();
-        
-    public:
-
-    	BeginCommandTest() {}
-    	virtual ~BeginCommandTest() {}
-
-        void test(void)
-        {
-            BeginCommand cmd;
-
-            CPPUNIT_ASSERT( cmd.getStompCommandId() == 
-                            CommandConstants::BEGIN );
-            
-            CPPUNIT_ASSERT( cmd.isResponseRequired() == false );
-            cmd.setResponseRequired( true );
-            cmd.setCommandId( 123 );
-            CPPUNIT_ASSERT( cmd.isResponseRequired() == true );
-            CPPUNIT_ASSERT( cmd.getCommandId() == 123 );
-            cmd.setCorrelationId( 99 );
-            CPPUNIT_ASSERT( cmd.getCorrelationId() == 99 );
-            CPPUNIT_ASSERT( cmd.getTransactionId() == NULL );
-            cmd.setTransactionId( "ID:123456" );
-            CPPUNIT_ASSERT( std::string( cmd.getTransactionId() ) == 
-                            "ID:123456" );
-            
-            StompFrame* frame = cmd.marshal().clone();
-            
-            CPPUNIT_ASSERT( frame != NULL );
-            
-            BeginCommand cmd1( frame );
-            
-            CPPUNIT_ASSERT( cmd.getCommandId() == cmd1.getCommandId() );
-            CPPUNIT_ASSERT( cmd.getStompCommandId() == cmd1.getStompCommandId() );
-            CPPUNIT_ASSERT( cmd.isResponseRequired() == cmd1.isResponseRequired() );
-            CPPUNIT_ASSERT( cmd.getCorrelationId() == cmd1.getCorrelationId() );
-            CPPUNIT_ASSERT( std::string(cmd.getTransactionId()) == cmd1.getTransactionId() );
-            
-        }
-
-    };
-
-}}}}
-
-#endif /*_ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_BEGINCOMMANDTEST_H_*/
+#ifndef _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_BEGINCOMMANDTEST_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_BEGINCOMMANDTEST_H_
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+#include <activemq/connector/stomp/commands/BeginCommand.h>
+
+namespace activemq{
+namespace connector{
+namespace stomp{
+namespace commands{
+
+    class BeginCommandTest: public CppUnit::TestFixture
+    {
+        CPPUNIT_TEST_SUITE( BeginCommandTest );
+        CPPUNIT_TEST( test );
+        CPPUNIT_TEST_SUITE_END();
+        
+    public:
+
+    	BeginCommandTest() {}
+    	virtual ~BeginCommandTest() {}
+
+        void test(void)
+        {
+            BeginCommand cmd;
+
+            CPPUNIT_ASSERT( cmd.getStompCommandId() == 
+                            CommandConstants::BEGIN );
+            
+            CPPUNIT_ASSERT( cmd.isResponseRequired() == false );
+            cmd.setResponseRequired( true );
+            cmd.setCommandId( 123 );
+            CPPUNIT_ASSERT( cmd.isResponseRequired() == true );
+            CPPUNIT_ASSERT( cmd.getCommandId() == 123 );
+            cmd.setCorrelationId( 99 );
+            CPPUNIT_ASSERT( cmd.getCorrelationId() == 99 );
+            CPPUNIT_ASSERT( cmd.getTransactionId() == NULL );
+            cmd.setTransactionId( "ID:123456" );
+            CPPUNIT_ASSERT( std::string( cmd.getTransactionId() ) == 
+                            "ID:123456" );
+            
+            StompFrame* frame = cmd.marshal().clone();
+            
+            CPPUNIT_ASSERT( frame != NULL );
+            
+            BeginCommand cmd1( frame );
+            
+            CPPUNIT_ASSERT( cmd.getCommandId() == cmd1.getCommandId() );
+            CPPUNIT_ASSERT( cmd.getStompCommandId() == cmd1.getStompCommandId() );
+            CPPUNIT_ASSERT( cmd.isResponseRequired() == cmd1.isResponseRequired() );
+            CPPUNIT_ASSERT( cmd.getCorrelationId() == cmd1.getCorrelationId() );
+            CPPUNIT_ASSERT( std::string(cmd.getTransactionId()) == cmd1.getTransactionId() );
+            
+        }
+
+    };
+
+}}}}
+
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_BEGINCOMMANDTEST_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/BeginCommandTest.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/BytesMessageCommandTest.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/BytesMessageCommandTest.cpp?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/BytesMessageCommandTest.cpp (original)
+++ incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/BytesMessageCommandTest.cpp Wed Jul  5 15:27:34 2006
@@ -1,3 +1,3 @@
-#include "BytesMessageCommandTest.h"
-
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::connector::stomp::commands::BytesMessageCommandTest );
+#include "BytesMessageCommandTest.h"
+
+CPPUNIT_TEST_SUITE_REGISTRATION( activemq::connector::stomp::commands::BytesMessageCommandTest );

Propchange: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/BytesMessageCommandTest.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/BytesMessageCommandTest.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/BytesMessageCommandTest.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/BytesMessageCommandTest.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/BytesMessageCommandTest.h Wed Jul  5 15:27:34 2006
@@ -1,188 +1,188 @@
-#ifndef _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_BYTESMESSAGECOMMANDTEST_H_
-#define _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_BYTESMESSAGECOMMANDTEST_H_
-
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-#include <activemq/connector/stomp/StompTopic.h>
-#include <cms/Message.h>
-
-#include <activemq/connector/stomp/commands/BytesMessageCommand.h>
-
-namespace activemq{
-namespace connector{
-namespace stomp{
-namespace commands{
-
-    class BytesMessageCommandTest : public CppUnit::TestFixture
-    {
-        CPPUNIT_TEST_SUITE( BytesMessageCommandTest );
-        CPPUNIT_TEST( test );
-        CPPUNIT_TEST_SUITE_END();
-
-    protected:
-
-        class TestAckHandler : public core::ActiveMQAckHandler
-        {
-        public:
-        
-            TestAckHandler(void) { wasAcked = false; }
-            virtual ~TestAckHandler(void) {}
-            
-            virtual void acknowledgeMessage( const core::ActiveMQMessage* message)
-                throw ( cms::CMSException ) 
-            {
-                wasAcked = true;
-            }
-            
-        public:
-        
-            bool wasAcked;
-
-        };
-
-    public:
-
-    	BytesMessageCommandTest() {}
-    	virtual ~BytesMessageCommandTest() {}
-
-        void test(void)
-        {
-            TestAckHandler ackHandler;
-            BytesMessageCommand cmd;
-
-            CPPUNIT_ASSERT( cmd.getStompCommandId() == 
-                            CommandConstants::SEND );
-            
-            CPPUNIT_ASSERT( cmd.isResponseRequired() == false );
-            cmd.setResponseRequired( true );
-            cmd.setCommandId( 123 );
-            CPPUNIT_ASSERT( cmd.isResponseRequired() == true );
-            CPPUNIT_ASSERT( cmd.getCommandId() == 123 );
-            cmd.setCorrelationId( 99 );
-            CPPUNIT_ASSERT( cmd.getCorrelationId() == 99 );
-            CPPUNIT_ASSERT( cmd.getTransactionId() == NULL );
-            cmd.setTransactionId( "ID:123456" );
-            CPPUNIT_ASSERT( std::string( cmd.getTransactionId() ) == 
-                            "ID:123456" );
-            StompTopic topic("testTopic");
-            cmd.setCMSDestination( topic );
-            CPPUNIT_ASSERT( cmd.getCMSDestination().toString() == 
-                            "testTopic" );
-            
-            StompFrame* frame = cmd.marshal().clone();
-            
-            CPPUNIT_ASSERT( frame != NULL );
-            
-            BytesMessageCommand cmd1( frame );
-            
-            CPPUNIT_ASSERT( cmd.getCommandId() == cmd1.getCommandId() );
-            CPPUNIT_ASSERT( cmd.getStompCommandId() == cmd1.getStompCommandId() );
-            CPPUNIT_ASSERT( cmd.isResponseRequired() == cmd1.isResponseRequired() );
-            CPPUNIT_ASSERT( cmd.getCorrelationId() == cmd1.getCorrelationId() );
-            CPPUNIT_ASSERT( std::string(cmd.getTransactionId()) == cmd1.getTransactionId() );
-            
-            cmd.setAckHandler( &ackHandler );
-            cmd.acknowledge();
-            CPPUNIT_ASSERT( ackHandler.wasAcked == true );
-            
-            CPPUNIT_ASSERT( 
-                cmd.getProperties().hasProperty( "test" ) == false );
-            cmd.getProperties().setProperty( "test", "value" );
-            CPPUNIT_ASSERT( 
-                cmd.getProperties().hasProperty( "test" ) == true );
-            CPPUNIT_ASSERT( 
-                std::string( cmd.getProperties().getProperty( "test" ) ) == "value" );
-                
-            CPPUNIT_ASSERT( cmd.getCMSCorrelationId() == NULL );
-            cmd.setCMSCorrelationId( "ID:1234567" );
-            CPPUNIT_ASSERT( std::string( cmd.getCMSCorrelationId() ) == 
-                            "ID:1234567" );
-            CPPUNIT_ASSERT( cmd.getCMSDeliveryMode() == 
-                            cms::Message::PERSISTANT );
-            cmd.setCMSDeliveryMode( cms::Message::NONPERSISTANT );
-            CPPUNIT_ASSERT( cmd.getCMSDeliveryMode() == 
-                            cms::Message::NONPERSISTANT );
-            cmd.setCMSDestination( topic );
-            CPPUNIT_ASSERT( cmd.getCMSDestination().toString() == 
-                            "testTopic" );
-            CPPUNIT_ASSERT( cmd.getCMSExpiration() == 0 );
-            cmd.setCMSExpiration( 123 );
-            CPPUNIT_ASSERT( cmd.getCMSExpiration() == 123 );
-            CPPUNIT_ASSERT( cmd.getCMSMessageId() == NULL );
-            cmd.setCMSMessageId( "ID:1234567" );
-            CPPUNIT_ASSERT( std::string( cmd.getCMSMessageId() ) == 
-                            "ID:1234567" );
-            CPPUNIT_ASSERT( cmd.getCMSPriority() == 0 );
-            cmd.setCMSPriority( 5 );
-            CPPUNIT_ASSERT( cmd.getCMSPriority() == 5 );
-            CPPUNIT_ASSERT( cmd.getCMSRedelivered() == false );
-            cmd.setCMSRedelivered( true );
-            CPPUNIT_ASSERT( cmd.getCMSRedelivered() == true );
-            CPPUNIT_ASSERT( cmd.getCMSReplyTo() == NULL );
-            cmd.setCMSReplyTo( "topic" );
-            CPPUNIT_ASSERT( std::string( cmd.getCMSReplyTo() ) == 
-                            "topic" );
-            CPPUNIT_ASSERT( cmd.getCMSTimeStamp() == 0 );
-            cmd.setCMSTimeStamp( 123 );
-            CPPUNIT_ASSERT( cmd.getCMSTimeStamp() == 123 );
-            CPPUNIT_ASSERT( cmd.getCMSMessageType() == NULL );
-            cmd.setCMSMessageType( "test" );
-            CPPUNIT_ASSERT( std::string( cmd.getCMSMessageType() ) == 
-                            "test" );
-            CPPUNIT_ASSERT( cmd.getRedeliveryCount() == 0 );
-            cmd.setRedeliveryCount( 123 );
-            CPPUNIT_ASSERT( cmd.getRedeliveryCount() == 123 );
-            
-            const char* bodyBytes = "TESTBODYBYTES\0";
-            CPPUNIT_ASSERT( cmd.getBodyLength() == 0 );
-            cmd.setBodyBytes( (const unsigned char*)bodyBytes, 
-                              strlen( bodyBytes ) + 1 );
-            CPPUNIT_ASSERT( cmd.getBodyLength() == 
-                            (unsigned int)strlen( bodyBytes ) + 1 );
-            CPPUNIT_ASSERT( std::string( (const char*)cmd.getBodyBytes() ) == 
-                            bodyBytes );
-
-            cms::Message* cmd2 = cmd.clone();
-            
-            CPPUNIT_ASSERT( cmd.getCMSPriority() == cmd2->getCMSPriority() );
-            CPPUNIT_ASSERT( cmd.getCMSTimeStamp() == cmd2->getCMSTimeStamp() );
-            CPPUNIT_ASSERT( cmd.getCMSExpiration() == cmd2->getCMSExpiration() );
-            CPPUNIT_ASSERT( cmd.getCMSDeliveryMode() == cmd2->getCMSDeliveryMode() );
-            CPPUNIT_ASSERT( std::string(cmd.getCMSCorrelationId()) == cmd2->getCMSCorrelationId() );
-            CPPUNIT_ASSERT( std::string(cmd.getCMSReplyTo()) == cmd2->getCMSReplyTo() );
-            CPPUNIT_ASSERT( std::string(cmd.getCMSMessageType()) == cmd2->getCMSMessageType() );
-            CPPUNIT_ASSERT( std::string(cmd.getCMSMessageId()) == cmd2->getCMSMessageId() );
-
-            core::ActiveMQMessage* message = 
-                dynamic_cast< core::ActiveMQMessage* >( cmd2 );
-                
-            CPPUNIT_ASSERT( message != NULL );
-            CPPUNIT_ASSERT( cmd.getRedeliveryCount() == 
-                            message->getRedeliveryCount() );
-            
-            StompCommand* cmd4 = 
-                dynamic_cast< StompCommand* >( cmd2 );
-
-            CPPUNIT_ASSERT( cmd4 != NULL );
-            CPPUNIT_ASSERT( cmd.getCommandId() == cmd4->getCommandId() );
-            CPPUNIT_ASSERT( cmd.getStompCommandId() == cmd4->getStompCommandId() );
-            CPPUNIT_ASSERT( cmd.isResponseRequired() == cmd4->isResponseRequired() );
-            CPPUNIT_ASSERT( cmd.getCorrelationId() == cmd4->getCorrelationId() );
-            CPPUNIT_ASSERT( std::string(cmd.getTransactionId()) == 
-                            cmd4->getTransactionId() );
-
-            BytesMessageCommand* cmd5 = 
-                dynamic_cast< BytesMessageCommand* >( cmd2 );
-
-            CPPUNIT_ASSERT( cmd5 != NULL );
-            CPPUNIT_ASSERT( std::string( (const char*)cmd.getBodyBytes() ) == 
-                            (const char*)cmd5->getBodyBytes() );
-
-            delete cmd2;
-        }
-
-    };
-
-}}}}
-
-#endif /*_ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_BYTESMESSAGECOMMANDTEST_H_*/
+#ifndef _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_BYTESMESSAGECOMMANDTEST_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_BYTESMESSAGECOMMANDTEST_H_
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+#include <activemq/connector/stomp/StompTopic.h>
+#include <cms/Message.h>
+
+#include <activemq/connector/stomp/commands/BytesMessageCommand.h>
+
+namespace activemq{
+namespace connector{
+namespace stomp{
+namespace commands{
+
+    class BytesMessageCommandTest : public CppUnit::TestFixture
+    {
+        CPPUNIT_TEST_SUITE( BytesMessageCommandTest );
+        CPPUNIT_TEST( test );
+        CPPUNIT_TEST_SUITE_END();
+
+    protected:
+
+        class TestAckHandler : public core::ActiveMQAckHandler
+        {
+        public:
+        
+            TestAckHandler(void) { wasAcked = false; }
+            virtual ~TestAckHandler(void) {}
+            
+            virtual void acknowledgeMessage( const core::ActiveMQMessage* message)
+                throw ( cms::CMSException ) 
+            {
+                wasAcked = true;
+            }
+            
+        public:
+        
+            bool wasAcked;
+
+        };
+
+    public:
+
+    	BytesMessageCommandTest() {}
+    	virtual ~BytesMessageCommandTest() {}
+
+        void test(void)
+        {
+            TestAckHandler ackHandler;
+            BytesMessageCommand cmd;
+
+            CPPUNIT_ASSERT( cmd.getStompCommandId() == 
+                            CommandConstants::SEND );
+            
+            CPPUNIT_ASSERT( cmd.isResponseRequired() == false );
+            cmd.setResponseRequired( true );
+            cmd.setCommandId( 123 );
+            CPPUNIT_ASSERT( cmd.isResponseRequired() == true );
+            CPPUNIT_ASSERT( cmd.getCommandId() == 123 );
+            cmd.setCorrelationId( 99 );
+            CPPUNIT_ASSERT( cmd.getCorrelationId() == 99 );
+            CPPUNIT_ASSERT( cmd.getTransactionId() == NULL );
+            cmd.setTransactionId( "ID:123456" );
+            CPPUNIT_ASSERT( std::string( cmd.getTransactionId() ) == 
+                            "ID:123456" );
+            StompTopic topic("testTopic");
+            cmd.setCMSDestination( topic );
+            CPPUNIT_ASSERT( cmd.getCMSDestination().toString() == 
+                            "testTopic" );
+            
+            StompFrame* frame = cmd.marshal().clone();
+            
+            CPPUNIT_ASSERT( frame != NULL );
+            
+            BytesMessageCommand cmd1( frame );
+            
+            CPPUNIT_ASSERT( cmd.getCommandId() == cmd1.getCommandId() );
+            CPPUNIT_ASSERT( cmd.getStompCommandId() == cmd1.getStompCommandId() );
+            CPPUNIT_ASSERT( cmd.isResponseRequired() == cmd1.isResponseRequired() );
+            CPPUNIT_ASSERT( cmd.getCorrelationId() == cmd1.getCorrelationId() );
+            CPPUNIT_ASSERT( std::string(cmd.getTransactionId()) == cmd1.getTransactionId() );
+            
+            cmd.setAckHandler( &ackHandler );
+            cmd.acknowledge();
+            CPPUNIT_ASSERT( ackHandler.wasAcked == true );
+            
+            CPPUNIT_ASSERT( 
+                cmd.getProperties().hasProperty( "test" ) == false );
+            cmd.getProperties().setProperty( "test", "value" );
+            CPPUNIT_ASSERT( 
+                cmd.getProperties().hasProperty( "test" ) == true );
+            CPPUNIT_ASSERT( 
+                std::string( cmd.getProperties().getProperty( "test" ) ) == "value" );
+                
+            CPPUNIT_ASSERT( cmd.getCMSCorrelationId() == NULL );
+            cmd.setCMSCorrelationId( "ID:1234567" );
+            CPPUNIT_ASSERT( std::string( cmd.getCMSCorrelationId() ) == 
+                            "ID:1234567" );
+            CPPUNIT_ASSERT( cmd.getCMSDeliveryMode() == 
+                            cms::Message::PERSISTANT );
+            cmd.setCMSDeliveryMode( cms::Message::NONPERSISTANT );
+            CPPUNIT_ASSERT( cmd.getCMSDeliveryMode() == 
+                            cms::Message::NONPERSISTANT );
+            cmd.setCMSDestination( topic );
+            CPPUNIT_ASSERT( cmd.getCMSDestination().toString() == 
+                            "testTopic" );
+            CPPUNIT_ASSERT( cmd.getCMSExpiration() == 0 );
+            cmd.setCMSExpiration( 123 );
+            CPPUNIT_ASSERT( cmd.getCMSExpiration() == 123 );
+            CPPUNIT_ASSERT( cmd.getCMSMessageId() == NULL );
+            cmd.setCMSMessageId( "ID:1234567" );
+            CPPUNIT_ASSERT( std::string( cmd.getCMSMessageId() ) == 
+                            "ID:1234567" );
+            CPPUNIT_ASSERT( cmd.getCMSPriority() == 0 );
+            cmd.setCMSPriority( 5 );
+            CPPUNIT_ASSERT( cmd.getCMSPriority() == 5 );
+            CPPUNIT_ASSERT( cmd.getCMSRedelivered() == false );
+            cmd.setCMSRedelivered( true );
+            CPPUNIT_ASSERT( cmd.getCMSRedelivered() == true );
+            CPPUNIT_ASSERT( cmd.getCMSReplyTo() == NULL );
+            cmd.setCMSReplyTo( "topic" );
+            CPPUNIT_ASSERT( std::string( cmd.getCMSReplyTo() ) == 
+                            "topic" );
+            CPPUNIT_ASSERT( cmd.getCMSTimeStamp() == 0 );
+            cmd.setCMSTimeStamp( 123 );
+            CPPUNIT_ASSERT( cmd.getCMSTimeStamp() == 123 );
+            CPPUNIT_ASSERT( cmd.getCMSMessageType() == NULL );
+            cmd.setCMSMessageType( "test" );
+            CPPUNIT_ASSERT( std::string( cmd.getCMSMessageType() ) == 
+                            "test" );
+            CPPUNIT_ASSERT( cmd.getRedeliveryCount() == 0 );
+            cmd.setRedeliveryCount( 123 );
+            CPPUNIT_ASSERT( cmd.getRedeliveryCount() == 123 );
+            
+            const char* bodyBytes = "TESTBODYBYTES\0";
+            CPPUNIT_ASSERT( cmd.getBodyLength() == 0 );
+            cmd.setBodyBytes( (const unsigned char*)bodyBytes, 
+                              strlen( bodyBytes ) + 1 );
+            CPPUNIT_ASSERT( cmd.getBodyLength() == 
+                            (unsigned int)strlen( bodyBytes ) + 1 );
+            CPPUNIT_ASSERT( std::string( (const char*)cmd.getBodyBytes() ) == 
+                            bodyBytes );
+
+            cms::Message* cmd2 = cmd.clone();
+            
+            CPPUNIT_ASSERT( cmd.getCMSPriority() == cmd2->getCMSPriority() );
+            CPPUNIT_ASSERT( cmd.getCMSTimeStamp() == cmd2->getCMSTimeStamp() );
+            CPPUNIT_ASSERT( cmd.getCMSExpiration() == cmd2->getCMSExpiration() );
+            CPPUNIT_ASSERT( cmd.getCMSDeliveryMode() == cmd2->getCMSDeliveryMode() );
+            CPPUNIT_ASSERT( std::string(cmd.getCMSCorrelationId()) == cmd2->getCMSCorrelationId() );
+            CPPUNIT_ASSERT( std::string(cmd.getCMSReplyTo()) == cmd2->getCMSReplyTo() );
+            CPPUNIT_ASSERT( std::string(cmd.getCMSMessageType()) == cmd2->getCMSMessageType() );
+            CPPUNIT_ASSERT( std::string(cmd.getCMSMessageId()) == cmd2->getCMSMessageId() );
+
+            core::ActiveMQMessage* message = 
+                dynamic_cast< core::ActiveMQMessage* >( cmd2 );
+                
+            CPPUNIT_ASSERT( message != NULL );
+            CPPUNIT_ASSERT( cmd.getRedeliveryCount() == 
+                            message->getRedeliveryCount() );
+            
+            StompCommand* cmd4 = 
+                dynamic_cast< StompCommand* >( cmd2 );
+
+            CPPUNIT_ASSERT( cmd4 != NULL );
+            CPPUNIT_ASSERT( cmd.getCommandId() == cmd4->getCommandId() );
+            CPPUNIT_ASSERT( cmd.getStompCommandId() == cmd4->getStompCommandId() );
+            CPPUNIT_ASSERT( cmd.isResponseRequired() == cmd4->isResponseRequired() );
+            CPPUNIT_ASSERT( cmd.getCorrelationId() == cmd4->getCorrelationId() );
+            CPPUNIT_ASSERT( std::string(cmd.getTransactionId()) == 
+                            cmd4->getTransactionId() );
+
+            BytesMessageCommand* cmd5 = 
+                dynamic_cast< BytesMessageCommand* >( cmd2 );
+
+            CPPUNIT_ASSERT( cmd5 != NULL );
+            CPPUNIT_ASSERT( std::string( (const char*)cmd.getBodyBytes() ) == 
+                            (const char*)cmd5->getBodyBytes() );
+
+            delete cmd2;
+        }
+
+    };
+
+}}}}
+
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_BYTESMESSAGECOMMANDTEST_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/BytesMessageCommandTest.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/CommandConstantsTest.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/CommandConstantsTest.cpp?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/CommandConstantsTest.cpp (original)
+++ incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/CommandConstantsTest.cpp Wed Jul  5 15:27:34 2006
@@ -1,3 +1,3 @@
-#include "CommandConstantsTest.h"
-
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::connector::stomp::commands::CommandConstantsTest );
+#include "CommandConstantsTest.h"
+
+CPPUNIT_TEST_SUITE_REGISTRATION( activemq::connector::stomp::commands::CommandConstantsTest );

Propchange: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/CommandConstantsTest.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/CommandConstantsTest.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/CommandConstantsTest.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/CommandConstantsTest.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/CommandConstantsTest.h Wed Jul  5 15:27:34 2006
@@ -1,81 +1,81 @@
-#ifndef _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_COMMANDCONSTANTSTEST_H_
-#define _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_COMMANDCONSTANTSTEST_H_
-
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
-#include <activemq/connector/stomp/commands/CommandConstants.h>
-
-namespace activemq{
-namespace connector{
-namespace stomp{
-namespace commands{
-
-    class CommandConstantsTest : public CppUnit::TestFixture
-    {
-        CPPUNIT_TEST_SUITE( CommandConstantsTest );
-        CPPUNIT_TEST( test );
-        CPPUNIT_TEST_SUITE_END();
-
-    public:
-
-    	CommandConstantsTest() {}
-    	virtual ~CommandConstantsTest() {}
-
-        void test(void)
-        {
-            int index = 0;
-            
-            for(; index < CommandConstants::NUM_COMMANDS; ++index )
-            {
-                CommandConstants::CommandId cmdId = 
-                    (CommandConstants::CommandId)index;
-                std::string cmd = CommandConstants::toString( cmdId );
-    
-                CPPUNIT_ASSERT( cmd != "");            
-                CPPUNIT_ASSERT( 
-                    cmdId == CommandConstants::toCommandId( cmd ) );
-            }
-            
-            CPPUNIT_ASSERT( index != 0 );
-            
-            index = 0;
-                                        
-            for(; index < CommandConstants::NUM_STOMP_HEADERS; ++index )
-            {
-                CommandConstants::StompHeader hdrId = 
-                    (CommandConstants::StompHeader)index;
-                std::string hdr = CommandConstants::toString( hdrId );
-    
-                CPPUNIT_ASSERT( hdr != "");            
-                CPPUNIT_ASSERT( 
-                    hdrId == CommandConstants::toStompHeader( hdr ) );
-            }
-
-            CPPUNIT_ASSERT( index != 0 );
-            
-            index = 0;
-                                        
-            for(; index < CommandConstants::NUM_ACK_MODES; ++index )
-            {
-                CommandConstants::AckMode ackMode = 
-                    (CommandConstants::AckMode)index;
-                std::string ackStr = CommandConstants::toString( ackMode );
-    
-                CPPUNIT_ASSERT( ackStr != "");            
-                CPPUNIT_ASSERT( 
-                    ackMode == CommandConstants::toAckMode( ackStr ) );
-            }
-
-            CPPUNIT_ASSERT( index != 0 );
-
-            CPPUNIT_ASSERT( CommandConstants::queuePrefix != NULL );
-            CPPUNIT_ASSERT( CommandConstants::topicPrefix != NULL );
-
-        }
-
-    };
-
-}}}}
-
-#endif /*_ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_COMMANDCONSTANTSTEST_H_*/
+#ifndef _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_COMMANDCONSTANTSTEST_H_
+#define _ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_COMMANDCONSTANTSTEST_H_
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+#include <activemq/connector/stomp/commands/CommandConstants.h>
+
+namespace activemq{
+namespace connector{
+namespace stomp{
+namespace commands{
+
+    class CommandConstantsTest : public CppUnit::TestFixture
+    {
+        CPPUNIT_TEST_SUITE( CommandConstantsTest );
+        CPPUNIT_TEST( test );
+        CPPUNIT_TEST_SUITE_END();
+
+    public:
+
+    	CommandConstantsTest() {}
+    	virtual ~CommandConstantsTest() {}
+
+        void test(void)
+        {
+            int index = 0;
+            
+            for(; index < CommandConstants::NUM_COMMANDS; ++index )
+            {
+                CommandConstants::CommandId cmdId = 
+                    (CommandConstants::CommandId)index;
+                std::string cmd = CommandConstants::toString( cmdId );
+    
+                CPPUNIT_ASSERT( cmd != "");            
+                CPPUNIT_ASSERT( 
+                    cmdId == CommandConstants::toCommandId( cmd ) );
+            }
+            
+            CPPUNIT_ASSERT( index != 0 );
+            
+            index = 0;
+                                        
+            for(; index < CommandConstants::NUM_STOMP_HEADERS; ++index )
+            {
+                CommandConstants::StompHeader hdrId = 
+                    (CommandConstants::StompHeader)index;
+                std::string hdr = CommandConstants::toString( hdrId );
+    
+                CPPUNIT_ASSERT( hdr != "");            
+                CPPUNIT_ASSERT( 
+                    hdrId == CommandConstants::toStompHeader( hdr ) );
+            }
+
+            CPPUNIT_ASSERT( index != 0 );
+            
+            index = 0;
+                                        
+            for(; index < CommandConstants::NUM_ACK_MODES; ++index )
+            {
+                CommandConstants::AckMode ackMode = 
+                    (CommandConstants::AckMode)index;
+                std::string ackStr = CommandConstants::toString( ackMode );
+    
+                CPPUNIT_ASSERT( ackStr != "");            
+                CPPUNIT_ASSERT( 
+                    ackMode == CommandConstants::toAckMode( ackStr ) );
+            }
+
+            CPPUNIT_ASSERT( index != 0 );
+
+            CPPUNIT_ASSERT( CommandConstants::queuePrefix != NULL );
+            CPPUNIT_ASSERT( CommandConstants::topicPrefix != NULL );
+
+        }
+
+    };
+
+}}}}
+
+#endif /*_ACTIVEMQ_CONNECTOR_STOMP_COMMANDS_COMMANDCONSTANTSTEST_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/CommandConstantsTest.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/CommitCommandTest.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/CommitCommandTest.cpp?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/CommitCommandTest.cpp (original)
+++ incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/CommitCommandTest.cpp Wed Jul  5 15:27:34 2006
@@ -1,3 +1,3 @@
-#include "CommitCommandTest.h"
-
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::connector::stomp::commands::CommitCommandTest );
+#include "CommitCommandTest.h"
+
+CPPUNIT_TEST_SUITE_REGISTRATION( activemq::connector::stomp::commands::CommitCommandTest );

Propchange: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/CommitCommandTest.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/CommitCommandTest.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/CommitCommandTest.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/CommitCommandTest.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/CommitCommandTest.h Wed Jul  5 15:27:34 2006
@@ -1,62 +1,62 @@
-#ifndef COMMITCOMMANDTEST_H_
-#define COMMITCOMMANDTEST_H_
-
-#include <cppunit/TestFixture.h>
-#include <cppunit/extensions/HelperMacros.h>
-
-#include <activemq/connector/stomp/commands/CommitCommand.h>
-
-namespace activemq{
-namespace connector{
-namespace stomp{
-namespace commands{
-
-    class CommitCommandTest : public CppUnit::TestFixture
-    {
-        CPPUNIT_TEST_SUITE( CommitCommandTest );
-        CPPUNIT_TEST( test );
-        CPPUNIT_TEST_SUITE_END();
-
-    public:
-
-    	CommitCommandTest() {}
-    	virtual ~CommitCommandTest() {}
-
-        void test(void)
-        {
-            CommitCommand cmd;
-
-            CPPUNIT_ASSERT( cmd.getStompCommandId() == 
-                            CommandConstants::COMMIT );
-            
-            CPPUNIT_ASSERT( cmd.isResponseRequired() == false );
-            cmd.setResponseRequired( true );
-            cmd.setCommandId( 123 );
-            CPPUNIT_ASSERT( cmd.isResponseRequired() == true );
-            CPPUNIT_ASSERT( cmd.getCommandId() == 123 );
-            cmd.setCorrelationId( 99 );
-            CPPUNIT_ASSERT( cmd.getCorrelationId() == 99 );
-            CPPUNIT_ASSERT( cmd.getTransactionId() == NULL );
-            cmd.setTransactionId( "ID:123456" );
-            CPPUNIT_ASSERT( std::string( cmd.getTransactionId() ) == 
-                            "ID:123456" );
-            
-            StompFrame* frame = cmd.marshal().clone();
-            
-            CPPUNIT_ASSERT( frame != NULL );
-            
-            CommitCommand cmd1( frame );
-            
-            CPPUNIT_ASSERT( cmd.getCommandId() == cmd1.getCommandId() );
-            CPPUNIT_ASSERT( cmd.getStompCommandId() == cmd1.getStompCommandId() );
-            CPPUNIT_ASSERT( cmd.isResponseRequired() == cmd1.isResponseRequired() );
-            CPPUNIT_ASSERT( cmd.getCorrelationId() == cmd1.getCorrelationId() );
-            CPPUNIT_ASSERT( std::string(cmd.getTransactionId()) == cmd1.getTransactionId() );
-            
-        }
-
-    };
-
-}}}}
-
-#endif /*COMMITCOMMANDTEST_H_*/
+#ifndef COMMITCOMMANDTEST_H_
+#define COMMITCOMMANDTEST_H_
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+#include <activemq/connector/stomp/commands/CommitCommand.h>
+
+namespace activemq{
+namespace connector{
+namespace stomp{
+namespace commands{
+
+    class CommitCommandTest : public CppUnit::TestFixture
+    {
+        CPPUNIT_TEST_SUITE( CommitCommandTest );
+        CPPUNIT_TEST( test );
+        CPPUNIT_TEST_SUITE_END();
+
+    public:
+
+    	CommitCommandTest() {}
+    	virtual ~CommitCommandTest() {}
+
+        void test(void)
+        {
+            CommitCommand cmd;
+
+            CPPUNIT_ASSERT( cmd.getStompCommandId() == 
+                            CommandConstants::COMMIT );
+            
+            CPPUNIT_ASSERT( cmd.isResponseRequired() == false );
+            cmd.setResponseRequired( true );
+            cmd.setCommandId( 123 );
+            CPPUNIT_ASSERT( cmd.isResponseRequired() == true );
+            CPPUNIT_ASSERT( cmd.getCommandId() == 123 );
+            cmd.setCorrelationId( 99 );
+            CPPUNIT_ASSERT( cmd.getCorrelationId() == 99 );
+            CPPUNIT_ASSERT( cmd.getTransactionId() == NULL );
+            cmd.setTransactionId( "ID:123456" );
+            CPPUNIT_ASSERT( std::string( cmd.getTransactionId() ) == 
+                            "ID:123456" );
+            
+            StompFrame* frame = cmd.marshal().clone();
+            
+            CPPUNIT_ASSERT( frame != NULL );
+            
+            CommitCommand cmd1( frame );
+            
+            CPPUNIT_ASSERT( cmd.getCommandId() == cmd1.getCommandId() );
+            CPPUNIT_ASSERT( cmd.getStompCommandId() == cmd1.getStompCommandId() );
+            CPPUNIT_ASSERT( cmd.isResponseRequired() == cmd1.isResponseRequired() );
+            CPPUNIT_ASSERT( cmd.getCorrelationId() == cmd1.getCorrelationId() );
+            CPPUNIT_ASSERT( std::string(cmd.getTransactionId()) == cmd1.getTransactionId() );
+            
+        }
+
+    };
+
+}}}}
+
+#endif /*COMMITCOMMANDTEST_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/CommitCommandTest.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/ConnectCommandTest.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/ConnectCommandTest.cpp?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/ConnectCommandTest.cpp (original)
+++ incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/ConnectCommandTest.cpp Wed Jul  5 15:27:34 2006
@@ -1,3 +1,3 @@
-#include "ConnectCommandTest.h"
-
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::connector::stomp::commands::ConnectCommandTest );
+#include "ConnectCommandTest.h"
+
+CPPUNIT_TEST_SUITE_REGISTRATION( activemq::connector::stomp::commands::ConnectCommandTest );

Propchange: incubator/activemq/trunk/activemq-cpp/src/test/activemq/connector/stomp/commands/ConnectCommandTest.cpp
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message