Author: tabish
Date: Thu Aug 30 14:54:07 2012
New Revision: 1378973
URL: http://svn.apache.org/viewvc?rev=1378973&view=rev
Log:
Adds to test case to show that when used properly the setReadOnlyProperties
works as advertised.
Modified:
activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/commands/ActiveMQMessageTest.cpp
Modified:
activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/commands/ActiveMQMessageTest.cpp
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/commands/ActiveMQMessageTest.cpp?rev=1378973&r1=1378972&r2=1378973&view=diff
==============================================================================
---
activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/commands/ActiveMQMessageTest.cpp
(original)
+++
activemq/activemq-cpp/trunk/activemq-cpp/src/test/activemq/commands/ActiveMQMessageTest.cpp
Thu Aug 30 14:54:07 2012
@@ -143,18 +143,17 @@ void ActiveMQMessageTest::testSetReadOnl
ActiveMQMessage msg;
msg.setReadOnlyProperties( true );
- bool test = false;
- try {
- msg.setIntProperty( "test", 1 );
- } catch( MessageNotWriteableException& me ) {
- test = true;
- } catch( CMSException& e ) {
- e.printStackTrace();
- test = false;
- }
-
- CPPUNIT_ASSERT( test );
+ CPPUNIT_ASSERT_THROW_MESSAGE(
+ "Should have thrown a MessageNotWriteableException",
+ msg.setIntProperty( "test", 1 ),
+ MessageNotWriteableException);
+
+ msg.setReadOnlyProperties( false );
+
+ CPPUNIT_ASSERT_NO_THROW_MESSAGE(
+ "Should have thrown a MessageNotWriteableException",
+ msg.setIntProperty( "test", 1 ));
}
////////////////////////////////////////////////////////////////////////////////