Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 5342 invoked from network); 9 Feb 2008 19:54:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Feb 2008 19:54:39 -0000 Received: (qmail 30945 invoked by uid 500); 9 Feb 2008 19:54:32 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 30918 invoked by uid 500); 9 Feb 2008 19:54:32 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 30909 invoked by uid 99); 9 Feb 2008 19:54:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Feb 2008 11:54:32 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Feb 2008 19:54:10 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 636441A9832; Sat, 9 Feb 2008 11:54:18 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r620180 - /activemq/activemq-cpp/trunk/src/test/activemq/cmsutil/CmsTemplateTest.cpp Date: Sat, 09 Feb 2008 19:54:18 -0000 To: commits@activemq.apache.org From: nmittler@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080209195418.636441A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: nmittler Date: Sat Feb 9 11:54:17 2008 New Revision: 620180 URL: http://svn.apache.org/viewvc?rev=620180&view=rev Log: AMQCPP-152 - Adding addition 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=620180&r1=620179&r2=620180&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 11:54:17 2008 @@ -104,6 +104,30 @@ cmsTemplate->execute(&callback4); CPPUNIT_ASSERT(callback4.session == callback.session); CPPUNIT_ASSERT(callback4.producer != callback3.producer); + + // Now try without a valid default destination and make sure + // we get an exception. + try { + cmsTemplate->setDefaultDestinationName(""); + MyProducerCallback callback5; + cmsTemplate->execute(&callback5); + CPPUNIT_FAIL("failed to throw expected exception"); + } catch( cms::CMSException& ex) { + // expected. + } + + // Now try an explicit destination + MyProducerCallback callback6; + activemq::connector::stomp::StompTopic myTopic("anothertopic"); + cmsTemplate->execute(&myTopic, &callback6); + CPPUNIT_ASSERT(callback6.session == callback.session); + CPPUNIT_ASSERT(callback6.producer != callback4.producer); + + // Now try an explicitly named destination + MyProducerCallback callback7; + cmsTemplate->execute("fred", &callback7); + CPPUNIT_ASSERT(callback7.session == callback.session); + CPPUNIT_ASSERT(callback7.producer != callback6.producer); } catch( cms::CMSException& e) { e.printStackTrace();