activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nmitt...@apache.org
Subject svn commit: r620360 - in /activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp: CmsTemplateTest.cpp CmsTemplateTest.h
Date Mon, 11 Feb 2008 00:40:38 GMT
Author: nmittler
Date: Sun Feb 10 16:40:37 2008
New Revision: 620360

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

Modified:
    activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/CmsTemplateTest.cpp
    activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/CmsTemplateTest.h

Modified: activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/CmsTemplateTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/CmsTemplateTest.cpp?rev=620360&r1=620359&r2=620360&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/CmsTemplateTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/CmsTemplateTest.cpp
Sun Feb 10 16:40:37 2008
@@ -113,3 +113,40 @@
     }
     AMQ_CATCH_RETHROW( ActiveMQException )
 }
+
+////////////////////////////////////////////////////////////////////////////////
+void CmsTemplateTest::testReceiveException()
+{
+    try {
+        
+        activemq::core::ActiveMQConnectionFactory cf("tcp://localhost:61666"); // Invalid
URL (at least by default)
+        activemq::cmsutil::CmsTemplate cmsTemplate(&cf);
+        cmsTemplate.setDefaultDestinationName("hello");
+        cmsTemplate.init();
+        
+        cmsTemplate.receive();
+        CPPUNIT_FAIL("failed to throw expected exception");
+    }
+    catch( ActiveMQException& ex) {
+        // Expected.
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CmsTemplateTest::testSendException()
+{
+    try {
+        
+        activemq::core::ActiveMQConnectionFactory cf("tcp://localhost:61666"); // Invalid
URL (at least by default)
+        activemq::cmsutil::CmsTemplate cmsTemplate(&cf);
+        cmsTemplate.setDefaultDestinationName("hello");
+        cmsTemplate.init();
+        
+        TextMessageCreator msgCreator("hello world");
+        cmsTemplate.send(&msgCreator);
+        CPPUNIT_FAIL("failed to throw expected exception");
+    }
+    catch( ActiveMQException& ex) {
+        // Expected.
+    }
+}

Modified: activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/CmsTemplateTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/CmsTemplateTest.h?rev=620360&r1=620359&r2=620360&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/CmsTemplateTest.h
(original)
+++ activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/CmsTemplateTest.h
Sun Feb 10 16:40:37 2008
@@ -34,6 +34,8 @@
     {
         CPPUNIT_TEST_SUITE( CmsTemplateTest );
         CPPUNIT_TEST( testBasics );
+        CPPUNIT_TEST( testReceiveException );
+        CPPUNIT_TEST( testSendException );
         CPPUNIT_TEST_SUITE_END();
         
         class TextMessageCreator : public activemq::cmsutil::MessageCreator {
@@ -140,6 +142,8 @@
         virtual void tearDown();
                 
         virtual void testBasics();
+        virtual void testReceiveException();
+        virtual void testSendException();
 
     };
 



Mime
View raw message