activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r736842 [4/5] - in /activemq/activemq-cpp/trunk/src: main/ main/activemq/commands/ main/activemq/connector/ main/activemq/core/ main/activemq/exceptions/ main/activemq/library/ main/activemq/transport/ main/activemq/transport/mock/ main/act...
Date Thu, 22 Jan 2009 22:55:28 GMT
Modified: activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/CmsTemplateTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/CmsTemplateTest.cpp?rev=736842&r1=736841&r2=736842&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/CmsTemplateTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/CmsTemplateTest.cpp Thu Jan 22 14:55:27 2009
@@ -42,27 +42,27 @@
 
     try {
         cmsTemplate->setSessionAcknowledgeMode(cms::Session::CLIENT_ACKNOWLEDGE);
-        
+
         // Test basics.
-        MySessionCallback sessionCallback;    
-        cmsTemplate->execute(&sessionCallback);    
+        MySessionCallback sessionCallback;
+        cmsTemplate->execute(&sessionCallback);
         CPPUNIT_ASSERT(sessionCallback.session != NULL);
         CPPUNIT_ASSERT(sessionCallback.ackMode == cms::Session::CLIENT_ACKNOWLEDGE);
-        
+
         // Try again and make sure we get the same session
         MySessionCallback sessionCallback2;
-        cmsTemplate->execute(&sessionCallback2);    
+        cmsTemplate->execute(&sessionCallback2);
         CPPUNIT_ASSERT(sessionCallback2.session == sessionCallback.session);
         CPPUNIT_ASSERT(sessionCallback2.ackMode == cms::Session::CLIENT_ACKNOWLEDGE);
-        
+
         // Now try different ack mode and make sure we have a different session.
         cmsTemplate->setSessionAcknowledgeMode(cms::Session::AUTO_ACKNOWLEDGE);
         MySessionCallback sessionCallback3;
-        cmsTemplate->execute(&sessionCallback3);  
+        cmsTemplate->execute(&sessionCallback3);
         CPPUNIT_ASSERT(sessionCallback3.session != NULL);
         CPPUNIT_ASSERT(sessionCallback3.session != sessionCallback.session);
         CPPUNIT_ASSERT(sessionCallback3.ackMode == cms::Session::AUTO_ACKNOWLEDGE);
-        
+
     } catch( cms::CMSException& e) {
         e.printStackTrace();
     }
@@ -70,40 +70,37 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 void CmsTemplateTest::testExecuteProducer() {
-    
+
     try {
-        
+
         cmsTemplate->setPubSubDomain(false);
-       
+
         // Test basics.
-        MyProducerCallback callback;    
-        cmsTemplate->execute(&callback);    
+        MyProducerCallback callback;
+        cmsTemplate->execute(&callback);
         CPPUNIT_ASSERT(callback.session != NULL);
         CPPUNIT_ASSERT(callback.producer != NULL);
-    
+
         // Try again and make sure we have the same producer
-        MyProducerCallback callback2;    
-        cmsTemplate->execute(&callback2);    
+        MyProducerCallback callback2;
+        cmsTemplate->execute(&callback2);
         CPPUNIT_ASSERT(callback2.session == callback.session);
         CPPUNIT_ASSERT(callback2.producer == callback.producer);
-        
+
         // Change to topics and make sure it's a different producer.
         cmsTemplate->setPubSubDomain(true);
-        MyProducerCallback callback3;    
-        cmsTemplate->execute(&callback3);    
+        MyProducerCallback callback3;
+        cmsTemplate->execute(&callback3);
         CPPUNIT_ASSERT(callback3.session == callback.session);
         CPPUNIT_ASSERT(callback3.producer != callback.producer);
-        
+
         // Now change destination name and make sure it's different yet again.
         cmsTemplate->setDefaultDestinationName("fred");
-        MyProducerCallback callback4;    
-        cmsTemplate->execute(&callback4);    
+        MyProducerCallback callback4;
+        cmsTemplate->execute(&callback4);
         CPPUNIT_ASSERT(callback4.session == callback.session);
         CPPUNIT_ASSERT(callback4.producer != callback3.producer);
-        
-        std::cout << "before exception" << std::endl;
-        std::cout.flush();
-        
+
         // Now try without a valid default destination and make sure
         // we get an exception.
         try {
@@ -114,22 +111,19 @@
         } catch( cms::CMSException& ex) {
             // expected.
         }
-        
-        std::cout << "after exception" << std::endl;
-        std::cout.flush();
-        
-        // Now try an explicit destination 
+
+        // Now try an explicit destination
         MyProducerCallback callback6;
-        activemq::connector::stomp::StompTopic myTopic("anothertopic");
+        activemq::commands::ActiveMQTopic myTopic("anothertopic");
         cmsTemplate->execute(&myTopic, &callback6);
         CPPUNIT_ASSERT(callback6.session != NULL);
-        
-        // Now try an explicitly named destination 
+
+        // Now try an explicitly named destination
         MyProducerCallback callback7;
         cmsTemplate->execute("fred", &callback7);
         CPPUNIT_ASSERT(callback7.session == callback6.session);
         CPPUNIT_ASSERT(callback7.producer != callback6.producer);
-                
+
     } catch( cms::CMSException& e) {
         e.printStackTrace();
     }
@@ -137,18 +131,18 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 void CmsTemplateTest::testSend() {
-    
+
     try {
-        
+
         MessageContext* messageContext = cf->getMessageContext();
-        
+
         MySendListener listener;
         messageContext->setSendListener(&listener);
-        
+
         DummyMessageCreator msgCreator;
-        
+
         // First, test basics.
-        cmsTemplate->send(&msgCreator);        
+        cmsTemplate->send(&msgCreator);
         const cms::Queue* q = dynamic_cast<const cms::Queue*>(listener.dest);
         CPPUNIT_ASSERT(q != NULL);
         CPPUNIT_ASSERT_EQUAL((std::string)"test", q->getQueueName());
@@ -156,7 +150,7 @@
         CPPUNIT_ASSERT_EQUAL(4, listener.priority);
         CPPUNIT_ASSERT_EQUAL(0LL, listener.ttl);
         CPPUNIT_ASSERT_EQUAL(1, listener.deliveryMode);
-        
+
         // Now change the defaults and verify that they did not change
         // the values (explicit qos not enabled). Also, change to using topics.
         cmsTemplate->setPubSubDomain(true);
@@ -165,7 +159,7 @@
         cmsTemplate->setTimeToLive(10LL);
         cmsTemplate->setDefaultDestinationName("bob");
         cmsTemplate->setDeliveryMode(0);
-        cmsTemplate->send(&msgCreator);  
+        cmsTemplate->send(&msgCreator);
         const cms::Topic* t = dynamic_cast<const cms::Topic*>(listener.dest);
         CPPUNIT_ASSERT(t != NULL);
         CPPUNIT_ASSERT_EQUAL((std::string)"bob", t->getTopicName());
@@ -173,11 +167,11 @@
         CPPUNIT_ASSERT_EQUAL(4, listener.priority);
         CPPUNIT_ASSERT_EQUAL(0LL, listener.ttl);
         CPPUNIT_ASSERT_EQUAL(1, listener.deliveryMode);
-        
+
         // Now enable explicit quality of service and verify that the new default
         // values are used.
         cmsTemplate->setExplicitQosEnabled(true);
-        cmsTemplate->send(&msgCreator);  
+        cmsTemplate->send(&msgCreator);
         t = dynamic_cast<const cms::Topic*>(listener.dest);
         CPPUNIT_ASSERT(t != NULL);
         CPPUNIT_ASSERT_EQUAL((std::string)"bob", t->getTopicName());
@@ -185,19 +179,19 @@
         CPPUNIT_ASSERT_EQUAL(5, listener.priority);
         CPPUNIT_ASSERT_EQUAL(10LL, listener.ttl);
         CPPUNIT_ASSERT_EQUAL(0, listener.deliveryMode);
-        
+
         // Now try the version of send with an explicit destination.
-        activemq::connector::stomp::StompTopic myTopic("anothertopic");
-        cmsTemplate->send(&myTopic, &msgCreator);  
+        activemq::commands::ActiveMQTopic myTopic("anothertopic");
+        cmsTemplate->send(&myTopic, &msgCreator);
         t = dynamic_cast<const cms::Topic*>(listener.dest);
         CPPUNIT_ASSERT(t == &myTopic);
-        
+
         // Now try the version of send with just a named destination.
-        cmsTemplate->send("yetanothertopic", &msgCreator);  
+        cmsTemplate->send("yetanothertopic", &msgCreator);
         t = dynamic_cast<const cms::Topic*>(listener.dest);
         CPPUNIT_ASSERT(t != NULL);
         CPPUNIT_ASSERT_EQUAL((std::string)"yetanothertopic", t->getTopicName());
-                
+
     } catch( cms::CMSException& e) {
         e.printStackTrace();
     }
@@ -205,16 +199,16 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 void CmsTemplateTest::testReceive() {
-    
+
     try {
 
         MessageContext* messageContext = cf->getMessageContext();
-                
+
         MySendListener listener;
         messageContext->setSendListener(&listener);
-        
+
         // First, test basics.
-        cms::Message* message = cmsTemplate->receive(); 
+        cms::Message* message = cmsTemplate->receive();
         CPPUNIT_ASSERT( message != NULL );
         const cms::Queue* q = dynamic_cast<const cms::Queue*>(listener.dest);
         CPPUNIT_ASSERT(q != NULL);
@@ -222,54 +216,54 @@
         CPPUNIT_ASSERT(listener.selector == "" );
         CPPUNIT_ASSERT_EQUAL(cmsTemplate->isNoLocal(), listener.noLocal);
         CPPUNIT_ASSERT_EQUAL(cmsTemplate->getReceiveTimeout(), listener.timeout);
-        delete message;        
-        
+        delete message;
+
         // Now change the destination type and verify that it changes.
         cmsTemplate->setPubSubDomain(true);
-        message = cmsTemplate->receive(); 
+        message = cmsTemplate->receive();
         CPPUNIT_ASSERT( message != NULL );
         const cms::Topic* t = dynamic_cast<const cms::Topic*>(listener.dest);
         CPPUNIT_ASSERT(t != NULL);
         CPPUNIT_ASSERT_EQUAL((std::string)"test", t->getTopicName());
         delete message;
-        
+
         // Now change the destination name and verify that it changes.
         cmsTemplate->setDefaultDestinationName("bob");
-        message = cmsTemplate->receive(); 
+        message = cmsTemplate->receive();
         CPPUNIT_ASSERT( message != NULL );
         t = dynamic_cast<const cms::Topic*>(listener.dest);
         CPPUNIT_ASSERT(t != NULL);
         CPPUNIT_ASSERT_EQUAL((std::string)"bob", t->getTopicName());
         delete message;
-        
+
         // Now change the timeout and verify that it changes.
         cmsTemplate->setReceiveTimeout(1000);
-        message = cmsTemplate->receive(); 
+        message = cmsTemplate->receive();
         CPPUNIT_ASSERT( message != NULL );
         CPPUNIT_ASSERT_EQUAL(cmsTemplate->getReceiveTimeout(), listener.timeout);
         delete message;
-        
+
         // Now change the noLocal flag and verify that it changes.
         cmsTemplate->setNoLocal(true);
-        message = cmsTemplate->receive(); 
+        message = cmsTemplate->receive();
         CPPUNIT_ASSERT( message != NULL );
         CPPUNIT_ASSERT_EQUAL(cmsTemplate->isNoLocal(), listener.noLocal);
         delete message;
-        
+
         // Now try a failure.
         try {
-            
+
             FailSendListener failListener;
             messageContext->setSendListener(&failListener);
-            
+
             // First, test basics.
-            cmsTemplate->receive(); 
+            cmsTemplate->receive();
             CPPUNIT_FAIL("failed to throw expected exception");
-            
+
         } catch( cms::CMSException& e) {
             // Expected
         }
-                
+
     } catch( cms::CMSException& e) {
         e.printStackTrace();
     }
@@ -277,35 +271,35 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 void CmsTemplateTest::testReceive_Destination() {
-    
+
     try {
 
         MessageContext* messageContext = cf->getMessageContext();
-                
+
         MySendListener listener;
         messageContext->setSendListener(&listener);
-        
+
         // First, test basics.
-        activemq::connector::stomp::StompTopic myTopic("anothertopic");
-        cms::Message* message = cmsTemplate->receive(&myTopic); 
+        activemq::commands::ActiveMQTopic myTopic("anothertopic");
+        cms::Message* message = cmsTemplate->receive(&myTopic);
         CPPUNIT_ASSERT( message != NULL );
         CPPUNIT_ASSERT(&myTopic == listener.dest);
         delete message;
-        
+
         // Now try a failure.
         try {
-            
+
             FailSendListener failListener;
             messageContext->setSendListener(&failListener);
-            
+
             // First, test basics.
-            cmsTemplate->receive(&myTopic); 
+            cmsTemplate->receive(&myTopic);
             CPPUNIT_FAIL("failed to throw expected exception");
-            
+
         } catch( cms::CMSException& e) {
             // Expected
         }
-                
+
     } catch( cms::CMSException& e) {
         e.printStackTrace();
     }
@@ -313,37 +307,37 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 void CmsTemplateTest::testReceive_DestinationName() {
-    
+
     try {
 
         MessageContext* messageContext = cf->getMessageContext();
-                
+
         MySendListener listener;
         messageContext->setSendListener(&listener);
-        
+
         // First, test basics.
         std::string destName = "bob";
-        cms::Message* message = cmsTemplate->receive(destName); 
+        cms::Message* message = cmsTemplate->receive(destName);
         CPPUNIT_ASSERT( message != NULL );
         const cms::Queue* q = dynamic_cast<const cms::Queue*>(listener.dest);
         CPPUNIT_ASSERT(q != NULL);
         CPPUNIT_ASSERT_EQUAL((std::string)"bob", q->getQueueName());
         delete message;
-        
+
         // Now try a failure.
         try {
-            
+
             FailSendListener failListener;
             messageContext->setSendListener(&failListener);
-            
+
             // First, test basics.
-            cmsTemplate->receive(destName); 
+            cmsTemplate->receive(destName);
             CPPUNIT_FAIL("failed to throw expected exception");
-            
+
         } catch( cms::CMSException& e) {
             // Expected
         }
-                
+
     } catch( cms::CMSException& e) {
         e.printStackTrace();
     }
@@ -351,17 +345,17 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 void CmsTemplateTest::testReceiveSelected() {
-    
+
     try {
 
         MessageContext* messageContext = cf->getMessageContext();
-                
+
         MySendListener listener;
         messageContext->setSendListener(&listener);
-        
+
         // First, test basics.
         std::string selector = "yadda";
-        cms::Message* message = cmsTemplate->receiveSelected(selector); 
+        cms::Message* message = cmsTemplate->receiveSelected(selector);
         CPPUNIT_ASSERT( message != NULL );
         const cms::Queue* q = dynamic_cast<const cms::Queue*>(listener.dest);
         CPPUNIT_ASSERT(q != NULL);
@@ -369,59 +363,59 @@
         CPPUNIT_ASSERT_EQUAL(cmsTemplate->isNoLocal(), listener.noLocal);
         CPPUNIT_ASSERT_EQUAL(cmsTemplate->getReceiveTimeout(), listener.timeout);
         CPPUNIT_ASSERT_EQUAL(selector, listener.selector);
-        delete message;        
-        
+        delete message;
+
         // Now change the destination type and verify that it changes.
         selector = "blah";
         cmsTemplate->setPubSubDomain(true);
-        message = cmsTemplate->receiveSelected(selector); 
+        message = cmsTemplate->receiveSelected(selector);
         CPPUNIT_ASSERT( message != NULL );
         const cms::Topic* t = dynamic_cast<const cms::Topic*>(listener.dest);
         CPPUNIT_ASSERT(t != NULL);
         CPPUNIT_ASSERT_EQUAL((std::string)"test", t->getTopicName());
         CPPUNIT_ASSERT_EQUAL(selector, listener.selector);
         delete message;
-        
+
         // Now change the destination name and verify that it changes.
         cmsTemplate->setDefaultDestinationName("bob");
-        message = cmsTemplate->receiveSelected(selector); 
+        message = cmsTemplate->receiveSelected(selector);
         CPPUNIT_ASSERT( message != NULL );
         t = dynamic_cast<const cms::Topic*>(listener.dest);
         CPPUNIT_ASSERT(t != NULL);
         CPPUNIT_ASSERT_EQUAL((std::string)"bob", t->getTopicName());
         CPPUNIT_ASSERT_EQUAL(selector, listener.selector);
         delete message;
-        
+
         // Now change the timeout and verify that it changes.
         cmsTemplate->setReceiveTimeout(1000);
-        message = cmsTemplate->receiveSelected(selector); 
+        message = cmsTemplate->receiveSelected(selector);
         CPPUNIT_ASSERT( message != NULL );
         CPPUNIT_ASSERT_EQUAL(cmsTemplate->getReceiveTimeout(), listener.timeout);
         CPPUNIT_ASSERT_EQUAL(selector, listener.selector);
         delete message;
-        
+
         // Now change the noLocal flag and verify that it changes.
         cmsTemplate->setNoLocal(true);
-        message = cmsTemplate->receiveSelected(selector); 
+        message = cmsTemplate->receiveSelected(selector);
         CPPUNIT_ASSERT( message != NULL );
         CPPUNIT_ASSERT_EQUAL(cmsTemplate->isNoLocal(), listener.noLocal);
         CPPUNIT_ASSERT_EQUAL(selector, listener.selector);
         delete message;
-        
+
         // Now try a failure.
         try {
-            
+
             FailSendListener failListener;
             messageContext->setSendListener(&failListener);
-            
+
             // First, test basics.
-            cmsTemplate->receiveSelected(selector); 
+            cmsTemplate->receiveSelected(selector);
             CPPUNIT_FAIL("failed to throw expected exception");
-            
+
         } catch( cms::CMSException& e) {
             // Expected
         }
-                
+
     } catch( cms::CMSException& e) {
         e.printStackTrace();
     }
@@ -429,37 +423,37 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 void CmsTemplateTest::testReceiveSelected_Destination() {
-    
+
     try {
 
         MessageContext* messageContext = cf->getMessageContext();
-                
+
         MySendListener listener;
         messageContext->setSendListener(&listener);
-        
+
         // First, test basics.
         std::string selector = "yadda";
-        activemq::connector::stomp::StompTopic myTopic("anothertopic");
-        cms::Message* message = cmsTemplate->receiveSelected(&myTopic, selector); 
+        activemq::commands::ActiveMQTopic myTopic("anothertopic");
+        cms::Message* message = cmsTemplate->receiveSelected(&myTopic, selector);
         CPPUNIT_ASSERT( message != NULL );
         CPPUNIT_ASSERT(&myTopic == listener.dest);
         CPPUNIT_ASSERT_EQUAL(selector, listener.selector);
         delete message;
-        
+
         // Now try a failure.
         try {
-            
+
             FailSendListener failListener;
             messageContext->setSendListener(&failListener);
-            
+
             // First, test basics.
-            cmsTemplate->receiveSelected(&myTopic, selector); 
+            cmsTemplate->receiveSelected(&myTopic, selector);
             CPPUNIT_FAIL("failed to throw expected exception");
-            
+
         } catch( cms::CMSException& e) {
             // Expected
         }
-                
+
     } catch( cms::CMSException& e) {
         e.printStackTrace();
     }
@@ -467,39 +461,39 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 void CmsTemplateTest::testReceiveSelected_DestinationName() {
-    
+
     try {
 
         MessageContext* messageContext = cf->getMessageContext();
-                
+
         MySendListener listener;
         messageContext->setSendListener(&listener);
-        
+
         // First, test basics.
         std::string selector = "yadda";
         std::string destName = "bob";
-        cms::Message* message = cmsTemplate->receiveSelected(destName, selector); 
+        cms::Message* message = cmsTemplate->receiveSelected(destName, selector);
         CPPUNIT_ASSERT( message != NULL );
         const cms::Queue* q = dynamic_cast<const cms::Queue*>(listener.dest);
         CPPUNIT_ASSERT(q != NULL);
         CPPUNIT_ASSERT_EQUAL((std::string)"bob", q->getQueueName());
         CPPUNIT_ASSERT_EQUAL(selector, listener.selector);
         delete message;
-        
+
         // Now try a failure.
         try {
-            
+
             FailSendListener failListener;
             messageContext->setSendListener(&failListener);
-            
+
             // First, test basics.
-            cmsTemplate->receiveSelected(destName, selector); 
+            cmsTemplate->receiveSelected(destName, selector);
             CPPUNIT_FAIL("failed to throw expected exception");
-            
+
         } catch( cms::CMSException& e) {
             // Expected
         }
-                
+
     } catch( cms::CMSException& e) {
         e.printStackTrace();
     }

Modified: activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/DummyConnection.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/DummyConnection.h?rev=736842&r1=736841&r2=736842&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/DummyConnection.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/DummyConnection.h Thu Jan 22 14:55:27 2009
@@ -28,11 +28,11 @@
 
     class DummyConnection : public cms::Connection {
     private:
-        
+
         cms::ExceptionListener* listener;
         std::string clientId;
         MessageContext* messageContext;
-        
+
     public:
 
         DummyConnection(MessageContext* messageContext ) {
@@ -40,22 +40,26 @@
         }
         virtual ~DummyConnection() {}
 
-        virtual void close() throw( cms::CMSException ) {            
+        virtual const cms::ConnectionMetaData* getMetaData() const throw( cms::CMSException ) {
+            return NULL;
         }
-        
-        virtual void start() throw( cms::CMSException ) {            
+
+        virtual void close() throw( cms::CMSException ) {
+        }
+
+        virtual void start() throw( cms::CMSException ) {
         }
-        
-        virtual void stop() throw( cms::CMSException ) {            
+
+        virtual void stop() throw( cms::CMSException ) {
         }
 
         virtual cms::Session* createSession() throw ( cms::CMSException ) {
             return new DummySession(messageContext);
         }
-                
-        virtual cms::Session* createSession( cms::Session::AcknowledgeMode ackMode ) 
+
+        virtual cms::Session* createSession( cms::Session::AcknowledgeMode ackMode )
             throw ( cms::CMSException ) {
-            
+
             DummySession* s = new DummySession(messageContext);
             s->setAcknowledgeMode(ackMode);
             return s;
@@ -64,7 +68,7 @@
         virtual std::string getClientID() const {
             return clientId;
         }
-        
+
         virtual void setClientID( const std::string& id ) {
             this->clientId = id;
         }
@@ -77,7 +81,7 @@
             this->listener = listener;
         }
     };
-    
+
 }}
 
 #endif /*ACTIVEMQ_CMSUTIL_DUMMYCONNECTION_H_*/

Modified: activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/DummySession.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/DummySession.h?rev=736842&r1=736841&r2=736842&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/DummySession.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/DummySession.h Thu Jan 22 14:55:27 2009
@@ -19,10 +19,10 @@
 #define ACTIVEMQ_CMSUTIL_DUMMYSESSION_H_
 
 #include <cms/Session.h>
-#include <activemq/connector/stomp/StompTopic.h>
-#include <activemq/connector/stomp/StompQueue.h>
 #include <activemq/cmsutil/DummyProducer.h>
 #include <activemq/cmsutil/DummyConsumer.h>
+#include <activemq/commands/ActiveMQQueue.h>
+#include <activemq/commands/ActiveMQTopic.h>
 
 namespace activemq {
 namespace cmsutil {
@@ -30,42 +30,42 @@
     class MessageContext;
 
     class DummySession : public cms::Session {
-    
+
     private:
-        
+
         cms::Session::AcknowledgeMode mode;
         MessageContext* messageContext;
-        
+
     public:
 
         DummySession(MessageContext* messageContext) {
             this->mode = cms::Session::AUTO_ACKNOWLEDGE;
             this->messageContext = messageContext;
         }
-        
+
         virtual ~DummySession() {}
 
         virtual void close() throw( cms::CMSException ){}
-            
+
         virtual void commit() throw ( cms::CMSException ) {}
-            
+
         virtual void rollback() throw ( cms::CMSException ) {}
 
         virtual cms::MessageConsumer* createConsumer(
             const cms::Destination* destination )
                 throw ( cms::CMSException ) {
-            
+
             return new DummyConsumer(messageContext, destination, "", false);
         }
 
-        virtual cms::MessageConsumer* createConsumer( 
+        virtual cms::MessageConsumer* createConsumer(
             const cms::Destination* destination,
             const std::string& selector )
                 throw ( cms::CMSException ) {
             return new DummyConsumer(messageContext, destination, selector, false);
         }
-        
-        virtual cms::MessageConsumer* createConsumer( 
+
+        virtual cms::MessageConsumer* createConsumer(
             const cms::Destination* destination,
             const std::string& selector,
             bool noLocal )
@@ -85,12 +85,12 @@
 
         virtual cms::Queue* createQueue( const std::string& queueName )
             throw ( cms::CMSException ) {
-            return new activemq::connector::stomp::StompQueue(queueName);
+            return new activemq::commands::ActiveMQQueue( queueName );
         }
-            
+
         virtual cms::Topic* createTopic( const std::string& topicName )
             throw ( cms::CMSException ) {
-            return new activemq::connector::stomp::StompTopic(topicName);
+            return new activemq::commands::ActiveMQTopic( topicName );
         }
 
         virtual cms::TemporaryQueue* createTemporaryQueue()
@@ -99,40 +99,40 @@
         virtual cms::TemporaryTopic* createTemporaryTopic()
             throw ( cms::CMSException ){ return NULL; }
 
-        virtual cms::Message* createMessage() 
+        virtual cms::Message* createMessage()
             throw ( cms::CMSException ){ return NULL; }
 
-        virtual cms::BytesMessage* createBytesMessage() 
+        virtual cms::BytesMessage* createBytesMessage()
             throw ( cms::CMSException){ return NULL; }
 
         virtual cms::BytesMessage* createBytesMessage(
             const unsigned char* bytes,
-            std::size_t bytesSize ) 
+            std::size_t bytesSize )
                 throw ( cms::CMSException){
             return NULL;
         }
 
-        virtual cms::TextMessage* createTextMessage() 
+        virtual cms::TextMessage* createTextMessage()
             throw ( cms::CMSException ){ return NULL; }
 
-        virtual cms::TextMessage* createTextMessage( const std::string& text ) 
+        virtual cms::TextMessage* createTextMessage( const std::string& text )
             throw ( cms::CMSException ){ return NULL; }
 
-        virtual cms::MapMessage* createMapMessage() 
+        virtual cms::MapMessage* createMapMessage()
             throw ( cms::CMSException ){ return NULL; }
 
         virtual cms::Session::AcknowledgeMode getAcknowledgeMode() const { return mode; }
-        virtual void setAcknowledgeMode(cms::Session::AcknowledgeMode mode) { 
-            this->mode = mode; 
+        virtual void setAcknowledgeMode(cms::Session::AcknowledgeMode mode) {
+            this->mode = mode;
         }
 
         virtual bool isTransacted() const{ return mode==cms::Session::SESSION_TRANSACTED; }
- 
-        virtual void unsubscribe( const std::string& name ) 
+
+        virtual void unsubscribe( const std::string& name )
             throw ( cms::CMSException ){}
-        
+
     };
-    
+
 }}
 
 #endif /*ACTIVEMQ_CMSUTIL_DUMMYSESSION_H_*/

Modified: activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/DynamicDestinationResolverTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/DynamicDestinationResolverTest.h?rev=736842&r1=736841&r2=736842&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/DynamicDestinationResolverTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/DynamicDestinationResolverTest.h Thu Jan 22 14:55:27 2009
@@ -21,7 +21,6 @@
 #include <cppunit/TestFixture.h>
 #include <cppunit/extensions/HelperMacros.h>
 
-
 namespace activemq{
 namespace cmsutil{
 

Modified: activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/SessionPoolTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/SessionPoolTest.h?rev=736842&r1=736841&r2=736842&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/SessionPoolTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/SessionPoolTest.h Thu Jan 22 14:55:27 2009
@@ -21,7 +21,6 @@
 #include <cppunit/TestFixture.h>
 #include <cppunit/extensions/HelperMacros.h>
 
-
 namespace activemq{
 namespace cmsutil{
 
@@ -32,12 +31,12 @@
         CPPUNIT_TEST( testReturnSession );
         CPPUNIT_TEST( testCloseSession );
         CPPUNIT_TEST_SUITE_END();
-        
+
     public:
 
         SessionPoolTest() {}
         virtual ~SessionPoolTest() {}
-                
+
         void testTakeSession();
         void testReturnSession();
         void testCloseSession();

Modified: activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionFactoryTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionFactoryTest.cpp?rev=736842&r1=736841&r2=736842&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionFactoryTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionFactoryTest.cpp Thu Jan 22 14:55:27 2009
@@ -23,77 +23,76 @@
 #include <decaf/lang/Thread.h>
 #include <activemq/core/ActiveMQConnectionFactory.h>
 #include <activemq/core/ActiveMQConnection.h>
-#include <activemq/connector/Connector.h>
 #include <memory>
 
 using namespace std;
 using namespace activemq;
 using namespace activemq::core;
 
-////////////////////////////////////////////////////////////////////////////////
-void ActiveMQConnectionFactoryTest::test1WithStomp()
-{
-    try
-    {
-        std::string URI =
-            "mock://127.0.0.1:23232?wireFormat=stomp";
-
-        ActiveMQConnectionFactory connectionFactory( URI );
-
-        cms::Connection* connection =
-            connectionFactory.createConnection();
-
-        CPPUNIT_ASSERT( connection != NULL );
-
-        delete connection;
-
-        return;
-    }
-    AMQ_CATCH_NOTHROW( exceptions::ActiveMQException )
-    AMQ_CATCHALL_NOTHROW( )
-
-    CPPUNIT_ASSERT( false );
-}
-
-////////////////////////////////////////////////////////////////////////////////
-void ActiveMQConnectionFactoryTest::test2WithStomp()
-{
-    try
-    {
-        std::string URI = std::string() +
-            "mock://127.0.0.1:23232?wireFormat=stomp&"
-            "username=" + username + "&password=" + password +
-            "&client-id=" + clientId;
-
-        ActiveMQConnectionFactory connectionFactory( URI );
-
-        cms::Connection* connection =
-            connectionFactory.createConnection();
-        CPPUNIT_ASSERT( connection != NULL );
-
-        ActiveMQConnection* amqConnection =
-            dynamic_cast< ActiveMQConnection* >( connection );
-        CPPUNIT_ASSERT( amqConnection != NULL );
-
-        connector::Connector* connector =
-            dynamic_cast< connector::Connector* >(
-            amqConnection->getConnectionData()->getConnector() );
-        CPPUNIT_ASSERT( connector != NULL );
-
-        CPPUNIT_ASSERT( username == connector->getUsername() );
-        CPPUNIT_ASSERT( password == connector->getPassword() );
-        CPPUNIT_ASSERT( clientId == connector->getClientId() );
-
-        // Free the allocated connection object.
-        delete connection;
-
-        return;
-    }
-    AMQ_CATCH_NOTHROW( exceptions::ActiveMQException )
-    AMQ_CATCHALL_NOTHROW( )
-
-    CPPUNIT_ASSERT( false );
-}
+//////////////////////////////////////////////////////////////////////////////////
+//void ActiveMQConnectionFactoryTest::test1WithStomp()
+//{
+//    try
+//    {
+//        std::string URI =
+//            "mock://127.0.0.1:23232?wireFormat=stomp";
+//
+//        ActiveMQConnectionFactory connectionFactory( URI );
+//
+//        cms::Connection* connection =
+//            connectionFactory.createConnection();
+//
+//        CPPUNIT_ASSERT( connection != NULL );
+//
+//        delete connection;
+//
+//        return;
+//    }
+//    AMQ_CATCH_NOTHROW( exceptions::ActiveMQException )
+//    AMQ_CATCHALL_NOTHROW( )
+//
+//    CPPUNIT_ASSERT( false );
+//}
+//
+//////////////////////////////////////////////////////////////////////////////////
+//void ActiveMQConnectionFactoryTest::test2WithStomp()
+//{
+//    try
+//    {
+//        std::string URI = std::string() +
+//            "mock://127.0.0.1:23232?wireFormat=stomp&"
+//            "username=" + username + "&password=" + password +
+//            "&client-id=" + clientId;
+//
+//        ActiveMQConnectionFactory connectionFactory( URI );
+//
+//        cms::Connection* connection =
+//            connectionFactory.createConnection();
+//        CPPUNIT_ASSERT( connection != NULL );
+//
+//        ActiveMQConnection* amqConnection =
+//            dynamic_cast< ActiveMQConnection* >( connection );
+//        CPPUNIT_ASSERT( amqConnection != NULL );
+//
+//        connector::Connector* connector =
+//            dynamic_cast< connector::Connector* >(
+//            amqConnection->getConnectionData()->getConnector() );
+//        CPPUNIT_ASSERT( connector != NULL );
+//
+//        CPPUNIT_ASSERT( username == connector->getUsername() );
+//        CPPUNIT_ASSERT( password == connector->getPassword() );
+//        CPPUNIT_ASSERT( clientId == connector->getClientId() );
+//
+//        // Free the allocated connection object.
+//        delete connection;
+//
+//        return;
+//    }
+//    AMQ_CATCH_NOTHROW( exceptions::ActiveMQException )
+//    AMQ_CATCHALL_NOTHROW( )
+//
+//    CPPUNIT_ASSERT( false );
+//}
 
 ////////////////////////////////////////////////////////////////////////////////
 void ActiveMQConnectionFactoryTest::test1WithOpenWire()
@@ -139,15 +138,9 @@
         ActiveMQConnection* amqConnection =
             dynamic_cast< ActiveMQConnection* >( connection );
         CPPUNIT_ASSERT( amqConnection != NULL );
-
-        connector::Connector* connector =
-            dynamic_cast< connector::Connector* >(
-            amqConnection->getConnectionData()->getConnector() );
-        CPPUNIT_ASSERT( connector != NULL );
-
-        CPPUNIT_ASSERT( username == connector->getUsername() );
-        CPPUNIT_ASSERT( password == connector->getPassword() );
-        CPPUNIT_ASSERT( clientId == connector->getClientId() );
+        CPPUNIT_ASSERT( username == amqConnection->getUsername() );
+        CPPUNIT_ASSERT( password == amqConnection->getPassword() );
+        CPPUNIT_ASSERT( clientId == amqConnection->getClientId() );
 
         // Free the allocated connection object.
         delete connection;

Modified: activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionFactoryTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionFactoryTest.h?rev=736842&r1=736841&r2=736842&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionFactoryTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionFactoryTest.h Thu Jan 22 14:55:27 2009
@@ -27,8 +27,8 @@
     class ActiveMQConnectionFactoryTest : public CppUnit::TestFixture
     {
         CPPUNIT_TEST_SUITE( ActiveMQConnectionFactoryTest );
-        CPPUNIT_TEST( test1WithStomp );
-        CPPUNIT_TEST( test2WithStomp );
+//        CPPUNIT_TEST( test1WithStomp );
+//        CPPUNIT_TEST( test2WithStomp );
         CPPUNIT_TEST( test1WithOpenWire );
         CPPUNIT_TEST( test2WithOpenWire );
         CPPUNIT_TEST( testExceptionOnCreate );
@@ -47,8 +47,8 @@
         }
         virtual ~ActiveMQConnectionFactoryTest() {}
 
-        void test1WithStomp();
-        void test2WithStomp();
+//        void test1WithStomp();
+//        void test2WithStomp();
         void test1WithOpenWire();
         void test2WithOpenWire();
         void testExceptionOnCreate();

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?rev=736842&r1=736841&r2=736842&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.cpp Thu Jan 22 14:55:27 2009
@@ -17,24 +17,15 @@
 
 #include "ActiveMQConnectionTest.h"
 
+#include <decaf/util/Properties.h>
 #include <decaf/util/concurrent/Concurrent.h>
 #include <decaf/util/concurrent/Mutex.h>
 #include <decaf/lang/Thread.h>
-#include <decaf/util/Properties.h>
 #include <activemq/core/ActiveMQConnectionFactory.h>
-#include <activemq/transport/mock/MockTransport.h>
 #include <activemq/core/ActiveMQConnection.h>
-#include <activemq/core/ActiveMQConnectionData.h>
-#include <activemq/connector/stomp/StompConnector.h>
-#include <activemq/connector/openwire/OpenWireConnector.h>
+#include <activemq/transport/mock/MockTransport.h>
 #include <activemq/transport/mock/MockTransportFactory.h>
 #include <activemq/transport/TransportRegistry.h>
-#include <activemq/connector/stomp/StompConsumerInfo.h>
-#include <activemq/connector/stomp/StompProducerInfo.h>
-#include <activemq/connector/stomp/StompTransactionInfo.h>
-#include <activemq/connector/stomp/StompSessionInfo.h>
-#include <activemq/connector/stomp/StompTopic.h>
-#include <activemq/connector/stomp/commands/TextMessageCommand.h>
 #include <activemq/util/Config.h>
 
 using namespace activemq;
@@ -43,208 +34,207 @@
 using namespace decaf::util;
 
 ////////////////////////////////////////////////////////////////////////////////
-void ActiveMQConnectionTest::test1WithStomp()
-{
-    try
-    {
-        MyMessageListener listener;
-        MyExceptionListener exListener;
-        MyCommandListener cmdListener;
-        MyDispatcher msgListener;
-        std::string connectionId = "testConnectionId";
-        decaf::util::Properties* properties =
-            new decaf::util::Properties();
-        transport::Transport* transport = NULL;
-
-        // Default to Stomp
-        properties->setProperty( "wireFormat", "stomp" );
-        decaf::net::URI uri( "mock://mock?wireFormat=stomp" );
-
-        transport::TransportFactory* factory =
-            transport::TransportRegistry::getInstance().findFactory( "mock" );
-        if( factory == NULL ){
-            CPPUNIT_ASSERT( false );
-        }
-
-        // Create the transport.
-        transport = factory->createComposite( uri );
-        if( transport == NULL ){
-            CPPUNIT_ASSERT( false );
-        }
-
-        transport::mock::MockTransport* dTransport =
-            dynamic_cast< transport::mock::MockTransport*>( 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) );
-
-        // First - make sure exceptions are working.
-        connection.setExceptionListener( &exListener );
-        CPPUNIT_ASSERT( exListener.caughtOne == false );
-        dTransport->fireException( exceptions::ActiveMQException( __FILE__, __LINE__, "test" ) );
-        CPPUNIT_ASSERT( exListener.caughtOne == true );
-
-        cms::Session* session1 = connection.createSession();
-        cms::Session* session2 = connection.createSession();
-        cms::Session* session3 = connection.createSession();
-
-        CPPUNIT_ASSERT( session1 != NULL );
-        CPPUNIT_ASSERT( session2 != NULL );
-        CPPUNIT_ASSERT( session3 != NULL );
-
-        connector::stomp::StompSessionInfo session;
-        connector::stomp::StompConsumerInfo consumer;
-
-        session.setSessionId( 1 );
-        session.setConnectionId( "TEST:123" );
-        session.setAckMode( cms::Session::AUTO_ACKNOWLEDGE );
-
-        connector::stomp::StompTopic myTopic( "test" );
-        consumer.setConsumerId( 1 );
-        consumer.setSessionInfo( &session );
-        consumer.setDestination( &myTopic );
-
-        connection.addDispatcher( &consumer, &msgListener );
-
-        connector::stomp::commands::TextMessageCommand* cmd =
-            new connector::stomp::commands::TextMessageCommand;
-        connector::stomp::StompTopic topic1( "test" );
-        cmd->setCMSDestination( &topic1 );
-
-        connector::ConsumerMessageListener* consumerListener =
-            dynamic_cast< connector::ConsumerMessageListener* >(
-                &connection );
-
-        connection.start();
-
-        CPPUNIT_ASSERT( consumerListener != NULL );
-
-        consumerListener->onConsumerMessage( &consumer, cmd );
-
-        CPPUNIT_ASSERT_EQUAL( 1, (int)msgListener.messages.size() );
-
-        connection.removeDispatcher( &consumer );
-
-        msgListener.messages.clear();
-        consumerListener->onConsumerMessage( &consumer, cmd );
-
-        CPPUNIT_ASSERT_EQUAL( 0, (int)msgListener.messages.size() );
-
-        connection.addDispatcher( &consumer, &msgListener );
-
-        connection.stop();
-        consumerListener->onConsumerMessage( &consumer, cmd );
-        connection.start();
-        CPPUNIT_ASSERT_EQUAL( 1, (int)msgListener.messages.size() );
-
-        delete cmd;
-        cmd = new connector::stomp::commands::TextMessageCommand;
-
-        connector::stomp::StompTopic topic2( "test" );
-        cmd->setCMSDestination( &topic2 );
-
-        consumerListener->onConsumerMessage( &consumer, cmd );
-        CPPUNIT_ASSERT_EQUAL( 2, (int)msgListener.messages.size() );
-
-        connection.removeDispatcher( &consumer );
-        msgListener.messages.clear();
-
-        session1->close();
-        session2->close();
-        session3->close();
-        connection.close();
-
-        exListener.caughtOne = false;
-        consumerListener->onConsumerMessage( &consumer, cmd );
-        CPPUNIT_ASSERT( exListener.caughtOne == true );
-
-        delete cmd;
-
-        delete session1;
-        delete session2;
-        delete session3;
-
-    } catch( exceptions::ActiveMQException& ex ) {
-        ex.printStackTrace();
-        throw ex;
-    }
-}
+//void ActiveMQConnectionTest::test1WithStomp()
+//{
+//    try
+//    {
+//        MyMessageListener listener;
+//        MyExceptionListener exListener;
+//        MyCommandListener cmdListener;
+//        MyDispatcher msgListener;
+//        std::string connectionId = "testConnectionId";
+//        decaf::util::Properties* properties =
+//            new decaf::util::Properties();
+//        transport::Transport* transport = NULL;
+//
+//        // Default to Stomp
+//        properties->setProperty( "wireFormat", "stomp" );
+//        decaf::net::URI uri( "mock://mock?wireFormat=stomp" );
+//
+//        transport::TransportFactory* factory =
+//            transport::TransportRegistry::getInstance().findFactory( "mock" );
+//        if( factory == NULL ){
+//            CPPUNIT_ASSERT( false );
+//        }
+//
+//        // Create the transport.
+//        transport = factory->createComposite( uri );
+//        if( transport == NULL ){
+//            CPPUNIT_ASSERT( false );
+//        }
+//
+//        transport::mock::MockTransport* dTransport =
+//            dynamic_cast< transport::mock::MockTransport*>( 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) );
+//
+//        // First - make sure exceptions are working.
+//        connection.setExceptionListener( &exListener );
+//        CPPUNIT_ASSERT( exListener.caughtOne == false );
+//        dTransport->fireException( exceptions::ActiveMQException( __FILE__, __LINE__, "test" ) );
+//        CPPUNIT_ASSERT( exListener.caughtOne == true );
+//
+//        cms::Session* session1 = connection.createSession();
+//        cms::Session* session2 = connection.createSession();
+//        cms::Session* session3 = connection.createSession();
+//
+//        CPPUNIT_ASSERT( session1 != NULL );
+//        CPPUNIT_ASSERT( session2 != NULL );
+//        CPPUNIT_ASSERT( session3 != NULL );
+//
+//        connector::stomp::StompSessionInfo session;
+//        connector::stomp::StompConsumerInfo consumer;
+//
+//        session.setSessionId( 1 );
+//        session.setConnectionId( "TEST:123" );
+//        session.setAckMode( cms::Session::AUTO_ACKNOWLEDGE );
+//
+//        connector::stomp::StompTopic myTopic( "test" );
+//        consumer.setConsumerId( 1 );
+//        consumer.setSessionInfo( &session );
+//        consumer.setDestination( &myTopic );
+//
+//        connection.addDispatcher( &consumer, &msgListener );
+//
+//        connector::stomp::commands::TextMessageCommand* cmd =
+//            new connector::stomp::commands::TextMessageCommand;
+//        connector::stomp::StompTopic topic1( "test" );
+//        cmd->setCMSDestination( &topic1 );
+//
+//        connector::ConsumerMessageListener* consumerListener =
+//            dynamic_cast< connector::ConsumerMessageListener* >(
+//                &connection );
+//
+//        connection.start();
+//
+//        CPPUNIT_ASSERT( consumerListener != NULL );
+//
+//        consumerListener->onConsumerMessage( &consumer, cmd );
+//
+//        CPPUNIT_ASSERT_EQUAL( 1, (int)msgListener.messages.size() );
+//
+//        connection.removeDispatcher( &consumer );
+//
+//        msgListener.messages.clear();
+//        consumerListener->onConsumerMessage( &consumer, cmd );
+//
+//        CPPUNIT_ASSERT_EQUAL( 0, (int)msgListener.messages.size() );
+//
+//        connection.addDispatcher( &consumer, &msgListener );
+//
+//        connection.stop();
+//        consumerListener->onConsumerMessage( &consumer, cmd );
+//        connection.start();
+//        CPPUNIT_ASSERT_EQUAL( 1, (int)msgListener.messages.size() );
+//
+//        delete cmd;
+//        cmd = new connector::stomp::commands::TextMessageCommand;
+//
+//        connector::stomp::StompTopic topic2( "test" );
+//        cmd->setCMSDestination( &topic2 );
+//
+//        consumerListener->onConsumerMessage( &consumer, cmd );
+//        CPPUNIT_ASSERT_EQUAL( 2, (int)msgListener.messages.size() );
+//
+//        connection.removeDispatcher( &consumer );
+//        msgListener.messages.clear();
+//
+//        session1->close();
+//        session2->close();
+//        session3->close();
+//        connection.close();
+//
+//        exListener.caughtOne = false;
+//        consumerListener->onConsumerMessage( &consumer, cmd );
+//        CPPUNIT_ASSERT( exListener.caughtOne == true );
+//
+//        delete cmd;
+//
+//        delete session1;
+//        delete session2;
+//        delete session3;
+//
+//    } catch( exceptions::ActiveMQException& ex ) {
+//        ex.printStackTrace();
+//        throw ex;
+//    }
+//}
 
 ////////////////////////////////////////////////////////////////////////////////
-void ActiveMQConnectionTest::test2WithStomp()
-{
-    try
-    {
-        MyMessageListener listener;
-        MyExceptionListener exListener;
-        MyCommandListener cmdListener;
-        MyDispatcher msgListener;
-        std::string connectionId = "testConnectionId";
-        decaf::util::Properties* properties =
-            new decaf::util::Properties();
-        transport::Transport* transport = NULL;
-
-        // Default to Stomp
-        properties->setProperty( "wireFormat", "stomp" );
-        decaf::net::URI uri( "mock://mock?wireFormat=stomp" );
-
-        transport::TransportFactory* factory =
-            transport::TransportRegistry::getInstance().findFactory( "mock" );
-        if( factory == NULL ){
-            CPPUNIT_ASSERT( false );
-        }
-
-        // Create the transport.
-        transport = factory->createComposite( uri );
-        if( transport == NULL ){
-            CPPUNIT_ASSERT( false );
-        }
-
-        transport::mock::MockTransport* dTransport =
-            dynamic_cast< transport::mock::MockTransport*>( 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;
-    }
-}
+//void ActiveMQConnectionTest::test2WithStomp()
+//{
+//    try
+//    {
+//        MyMessageListener listener;
+//        MyExceptionListener exListener;
+//        MyCommandListener cmdListener;
+//        MyDispatcher msgListener;
+//        std::string connectionId = "testConnectionId";
+//        decaf::util::Properties* properties =
+//            new decaf::util::Properties();
+//        transport::Transport* transport = NULL;
+//
+//        // Default to Stomp
+//        properties->setProperty( "wireFormat", "stomp" );
+//        decaf::net::URI uri( "mock://mock?wireFormat=stomp" );
+//
+//        transport::TransportFactory* factory =
+//            transport::TransportRegistry::getInstance().findFactory( "mock" );
+//        if( factory == NULL ){
+//            CPPUNIT_ASSERT( false );
+//        }
+//
+//        // Create the transport.
+//        transport = factory->createComposite( uri );
+//        if( transport == NULL ){
+//            CPPUNIT_ASSERT( false );
+//        }
+//
+//        transport::mock::MockTransport* dTransport =
+//            dynamic_cast< transport::mock::MockTransport*>( 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;
+//    }
+//}
 
 ////////////////////////////////////////////////////////////////////////////////
 void ActiveMQConnectionTest::test2WithOpenwire()
 {
     try
     {
-        MyMessageListener listener;
         MyExceptionListener exListener;
         MyCommandListener cmdListener;
         MyDispatcher msgListener;
@@ -271,15 +261,7 @@
 
         transport->setCommandListener( &cmdListener );
 
-        connector::Connector* connector =
-            new connector::openwire::OpenWireConnector(
-                transport, *properties );
-
-        connector->start();
-
-        ActiveMQConnection connection(
-            new ActiveMQConnectionData(
-                connector, transport, properties) );
+        ActiveMQConnection connection( transport, properties );
 
         connection.getClientID();
         connection.close();

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?rev=736842&r1=736841&r2=736842&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQConnectionTest.h Thu Jan 22 14:55:27 2009
@@ -25,8 +25,6 @@
 #include <cms/ExceptionListener.h>
 
 #include <activemq/core/ActiveMQMessage.h>
-#include <activemq/connector/ConsumerMessageListener.h>
-#include <activemq/connector/ConsumerInfo.h>
 #include <activemq/transport/Transport.h>
 #include <activemq/transport/CommandListener.h>
 #include <activemq/util/Config.h>
@@ -38,8 +36,8 @@
     class ActiveMQConnectionTest : public CppUnit::TestFixture
     {
         CPPUNIT_TEST_SUITE( ActiveMQConnectionTest );
-        CPPUNIT_TEST( test1WithStomp );
-        CPPUNIT_TEST( test2WithStomp );
+//        CPPUNIT_TEST( test1WithStomp );
+//        CPPUNIT_TEST( test2WithStomp );
         CPPUNIT_TEST( test2WithOpenwire );
         CPPUNIT_TEST_SUITE_END();
 
@@ -65,24 +63,6 @@
             }
         };
 
-        class MyMessageListener :
-            public connector::ConsumerMessageListener
-        {
-        public:
-
-            std::vector<connector::ConsumerInfo*> consumers;
-
-        public:
-            virtual ~MyMessageListener(){}
-
-            virtual void onConsumerMessage(
-                connector::ConsumerInfo* consumer,
-                core::ActiveMQMessage* msg AMQCPP_UNUSED )
-            {
-                consumers.push_back( consumer );
-            }
-        };
-
         class MyExceptionListener : public cms::ExceptionListener{
         public:
 
@@ -114,8 +94,8 @@
             }
         };
 
-        void test1WithStomp();
-        void test2WithStomp();
+//        void test1WithStomp();
+//        void test2WithStomp();
         void test2WithOpenwire();
 
     };

Modified: activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQSessionTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQSessionTest.cpp?rev=736842&r1=736841&r2=736842&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQSessionTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQSessionTest.cpp Thu Jan 22 14:55:27 2009
@@ -20,28 +20,22 @@
 #include <decaf/lang/Thread.h>
 #include <activemq/transport/mock/MockTransportFactory.h>
 #include <activemq/transport/TransportRegistry.h>
-#include <activemq/connector/ConsumerInfo.h>
-#include <activemq/connector/stomp/StompConnector.h>
-#include <activemq/connector/stomp/StompConsumerInfo.h>
-#include <activemq/connector/stomp/StompProducerInfo.h>
-#include <activemq/connector/stomp/StompTransactionInfo.h>
-#include <activemq/connector/stomp/StompSessionInfo.h>
-#include <activemq/connector/stomp/StompTopic.h>
-#include <activemq/connector/stomp/commands/TextMessageCommand.h>
 #include <decaf/net/Socket.h>
 #include <decaf/net/ServerSocket.h>
+#include <activemq/commands/ActiveMQTextMessage.h>
+#include <activemq/commands/ConsumerId.h>
+#include <activemq/commands/MessageDispatch.h>
 #include <activemq/core/ActiveMQConnectionFactory.h>
-#include <activemq/core/ActiveMQConnectionData.h>
 #include <activemq/core/ActiveMQSession.h>
 #include <activemq/core/ActiveMQConsumer.h>
 #include <activemq/core/ActiveMQProducer.h>
 #include <decaf/util/Properties.h>
 #include <decaf/util/Date.h>
-#include <activemq/connector/ConsumerMessageListener.h>
 
 using namespace std;
 using namespace activemq;
 using namespace activemq::core;
+using namespace activemq::commands;
 
 ////////////////////////////////////////////////////////////////////////////////
 void ActiveMQSessionTest::testAutoAcking() {
@@ -55,17 +49,17 @@
     cms::Session* session = connection->createSession();
 
     // Create a Topic
-    cms::Topic* topic1 = session->createTopic( "TestTopic1");
-    cms::Topic* topic2 = session->createTopic( "TestTopic2");
+    cms::Topic* topic1 = session->createTopic( "TestTopic1" );
+    cms::Topic* topic2 = session->createTopic( "TestTopic2" );
 
     CPPUNIT_ASSERT( topic1 != NULL );
     CPPUNIT_ASSERT( topic2 != NULL );
 
     // Create a consumer
-    cms::MessageConsumer* consumer1 =
-        session->createConsumer( topic1 );
-    cms::MessageConsumer* consumer2 =
-        session->createConsumer( topic2 );
+    ActiveMQConsumer* consumer1 =
+        dynamic_cast<ActiveMQConsumer*>( session->createConsumer( topic1 ) );
+    ActiveMQConsumer* consumer2 =
+        dynamic_cast<ActiveMQConsumer*>( session->createConsumer( topic2 ) );
 
     CPPUNIT_ASSERT( consumer1 != NULL );
     CPPUNIT_ASSERT( consumer2 != NULL );
@@ -81,7 +75,8 @@
     consumer1->setMessageListener( &msgListener1 );
     consumer2->setMessageListener( &msgListener2 );
 
-    injectTextMessage( "This is a Test 1" , *topic1 );
+    injectTextMessage( "This is a Test 1" , *topic1,
+                       *( consumer1->getConsumerInfo()->getConsumerId() ) );
 
     synchronized( &msgListener1.mutex )
     {
@@ -93,7 +88,8 @@
 
     CPPUNIT_ASSERT( msgListener1.messages.size() == 1 );
 
-    injectTextMessage( "This is a Test 2" , *topic2 );
+    injectTextMessage( "This is a Test 2" , *topic2,
+                       *( consumer2->getConsumerInfo()->getConsumerId() ) );
 
     synchronized( &msgListener2.mutex )
     {
@@ -150,10 +146,10 @@
     CPPUNIT_ASSERT( topic2 != NULL );
 
     // Create a consumer
-    cms::MessageConsumer* consumer1 =
-        session->createConsumer( topic1 );
-    cms::MessageConsumer* consumer2 =
-        session->createConsumer( topic2 );
+    ActiveMQConsumer* consumer1 =
+        dynamic_cast<ActiveMQConsumer*>( session->createConsumer( topic1 ) );
+    ActiveMQConsumer* consumer2 =
+        dynamic_cast<ActiveMQConsumer*>( session->createConsumer( topic2 ) );
 
     CPPUNIT_ASSERT( consumer1 != NULL );
     CPPUNIT_ASSERT( consumer2 != NULL );
@@ -169,7 +165,8 @@
     consumer1->setMessageListener( &msgListener1 );
     consumer2->setMessageListener( &msgListener2 );
 
-    injectTextMessage( "This is a Test 1" , *topic1 );
+    injectTextMessage( "This is a Test 1" , *topic1,
+                       *( consumer1->getConsumerInfo()->getConsumerId() ) );
 
     synchronized( &msgListener1.mutex )
     {
@@ -183,7 +180,8 @@
 
     msgListener1.messages[0]->acknowledge();
 
-    injectTextMessage( "This is a Test 2" , *topic2 );
+    injectTextMessage( "This is a Test 2" , *topic2,
+                       *( consumer2->getConsumerInfo()->getConsumerId() ) );
 
     synchronized( &msgListener2.mutex )
     {
@@ -242,10 +240,10 @@
     CPPUNIT_ASSERT( topic2 != NULL );
 
     // Create a consumer
-    cms::MessageConsumer* consumer1 =
-        session->createConsumer( topic1 );
-    cms::MessageConsumer* consumer2 =
-        session->createConsumer( topic2 );
+    ActiveMQConsumer* consumer1 =
+        dynamic_cast<ActiveMQConsumer*>( session->createConsumer( topic1 ) );
+    ActiveMQConsumer* consumer2 =
+        dynamic_cast<ActiveMQConsumer*>( session->createConsumer( topic2 ) );
 
     CPPUNIT_ASSERT( consumer1 != NULL );
     CPPUNIT_ASSERT( consumer2 != NULL );
@@ -261,7 +259,8 @@
     consumer1->setMessageListener( &msgListener1 );
     consumer2->setMessageListener( &msgListener2 );
 
-    injectTextMessage( "This is a Test 1" , *topic1 );
+    injectTextMessage( "This is a Test 1" , *topic1,
+                       *( consumer1->getConsumerInfo()->getConsumerId() ) );
 
     synchronized( &msgListener1.mutex )
     {
@@ -275,7 +274,8 @@
 
     session->commit();
 
-    injectTextMessage( "This is a Test 2" , *topic2 );
+    injectTextMessage( "This is a Test 2" , *topic2,
+                       *( consumer2->getConsumerInfo()->getConsumerId() ) );
 
     synchronized( &msgListener2.mutex )
     {
@@ -316,7 +316,8 @@
 
         stream << "This is test message #" << i << std::ends;
 
-        injectTextMessage( stream.str() , *topic1 );
+        injectTextMessage( stream.str() , *topic1,
+                           *( consumer1->getConsumerInfo()->getConsumerId() ) );
     }
 
     for( unsigned int i = 0; i < msgCount; ++i )
@@ -325,7 +326,8 @@
 
         stream << "This is test message #" << i << std::ends;
 
-        injectTextMessage( stream.str() , *topic2 );
+        injectTextMessage( stream.str() , *topic2,
+                           *( consumer2->getConsumerInfo()->getConsumerId() ) );
     }
 
     synchronized( &msgListener1.mutex )
@@ -425,10 +427,10 @@
     CPPUNIT_ASSERT( topic2 != NULL );
 
     // Create a consumer
-    cms::MessageConsumer* consumer1 =
-        session->createConsumer( topic1 );
-    cms::MessageConsumer* consumer2 =
-        session->createConsumer( topic2 );
+    ActiveMQConsumer* consumer1 =
+        dynamic_cast<ActiveMQConsumer*>( session->createConsumer( topic1 ) );
+    ActiveMQConsumer* consumer2 =
+        dynamic_cast<ActiveMQConsumer*>( session->createConsumer( topic2 ) );
 
     CPPUNIT_ASSERT( consumer1 != NULL );
     CPPUNIT_ASSERT( consumer2 != NULL );
@@ -438,6 +440,7 @@
 
     injectTextMessage( "This is a Test 1" ,
                        *topic1,
+                       *( consumer1->getConsumerInfo()->getConsumerId() ),
                        decaf::util::Date::getCurrentTimeMilliseconds(),
                        50 );
 
@@ -453,6 +456,7 @@
 
     injectTextMessage( "This is a Test 2" ,
                        *topic2,
+                       *( consumer2->getConsumerInfo()->getConsumerId() ),
                        decaf::util::Date::getCurrentTimeMilliseconds() - 100,
                        1 );
 
@@ -490,7 +494,7 @@
 {
     try
     {
-        ActiveMQConnectionFactory factory("mock://127.0.0.1:12345?wireFormat=stomp");
+        ActiveMQConnectionFactory factory("mock://127.0.0.1:12345?wireFormat=openwire");
 
         connection = dynamic_cast< ActiveMQConnection*>(
             factory.createConnection() );
@@ -511,32 +515,33 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ActiveMQSessionTest::tearDown()
-{
+void ActiveMQSessionTest::tearDown() {
     delete connection;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void ActiveMQSessionTest::injectTextMessage( const std::string message,
                                              const cms::Destination& destination,
+                                             const commands::ConsumerId& id,
                                              const long long timeStamp,
                                              const long long timeToLive )
 {
-    wireformat::stomp::StompFrame* frame =
-        new wireformat::stomp::StompFrame();
-    frame->setCommand( "MESSAGE" );
-    frame->getProperties().setProperty(
-        "destination", destination.toProviderString() );
-    const char* buffer = message.c_str();
-    frame->setBody( (unsigned char*)buffer, 12 );
+    ActiveMQTextMessage* msg = new ActiveMQTextMessage();
 
-    connector::stomp::commands::TextMessageCommand* msg =
-        new connector::stomp::commands::TextMessageCommand( frame );
+    ProducerId* producerId = new ProducerId();
+    producerId->setConnectionId( id.getConnectionId() );
+    producerId->setSessionId( id.getSessionId() );
+    producerId->setValue( 1 );
+
+    MessageId* messageId = new MessageId();
+    messageId->setProducerId( producerId );
+    messageId->setProducerSequenceId( 2 );
 
     // Init Message
     msg->setText( message.c_str() );
     msg->setCMSDestination( &destination );
     msg->setCMSMessageID( "Id: 123456" );
+    msg->setMessageId( messageId );
 
     long long expiration = 0LL;
 
@@ -553,5 +558,9 @@
     // Send the Message
     CPPUNIT_ASSERT( dTransport != NULL );
 
-    dTransport->fireCommand( msg );
+    MessageDispatch* dispatch = new MessageDispatch();
+    dispatch->setMessage( msg );
+    dispatch->setConsumerId( id.cloneDataStructure() );
+
+    dTransport->fireCommand( dispatch );
 }

Modified: activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQSessionTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQSessionTest.h?rev=736842&r1=736841&r2=736842&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQSessionTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/core/ActiveMQSessionTest.h Thu Jan 22 14:55:27 2009
@@ -29,6 +29,7 @@
 #include <activemq/core/ActiveMQConnection.h>
 #include <activemq/transport/mock/MockTransport.h>
 #include <activemq/util/Config.h>
+#include <activemq/commands/ConsumerId.h>
 
 namespace activemq{
 namespace core{
@@ -38,7 +39,7 @@
         CPPUNIT_TEST_SUITE( ActiveMQSessionTest );
         CPPUNIT_TEST( testAutoAcking );
         CPPUNIT_TEST( testClientAck );
-        CPPUNIT_TEST( testTransactional );
+        //CPPUNIT_TEST( testTransactional );
         CPPUNIT_TEST( testExpiration );
         CPPUNIT_TEST_SUITE_END();
 
@@ -118,6 +119,7 @@
         void tearDown();
         void injectTextMessage( const std::string message,
                                 const cms::Destination& destination,
+                                const commands::ConsumerId& id,
                                 const long long timeStamp = -1,
                                 const long long timeToLive = -1 );
 



Mime
View raw message