activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nmitt...@apache.org
Subject svn commit: r620168 - /activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/CmsTemplateTest.cpp
Date Sat, 09 Feb 2008 18:15:11 GMT
Author: nmittler
Date: Sat Feb  9 10:15:11 2008
New Revision: 620168

URL: http://svn.apache.org/viewvc?rev=620168&view=rev
Log:
AMQCPP-152 - Adding unit tests for CmsTemplate

Modified:
    activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/CmsTemplateTest.cpp

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=620168&r1=620167&r2=620168&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/CmsTemplateTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/CmsTemplateTest.cpp Sat Feb  9 10:15:11
2008
@@ -159,7 +159,19 @@
         CPPUNIT_ASSERT(listener.message != NULL);
         CPPUNIT_ASSERT_EQUAL(5, listener.priority);
         CPPUNIT_ASSERT_EQUAL(10LL, listener.ttl);
-        CPPUNIT_ASSERT_EQUAL(0, listener.deliveryMode);              
+        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);  
+        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);  
+        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();



Mime
View raw message