You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by nm...@apache.org on 2008/02/09 19:15:11 UTC
svn commit: r620168 -
/activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/CmsTemplateTest.cpp
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();