Author: tabish
Date: Sun Nov 11 13:08:58 2007
New Revision: 593957
URL: http://svn.apache.org/viewvc?rev=593957&view=rev
Log:
http://issues.apache.org/activemq/browse/AMQCPP-103
Modified:
activemq/activemq-cpp/trunk/src/test/activemq/transport/IOTransportTest.h
Modified:
activemq/activemq-cpp/trunk/src/test/activemq/transport/IOTransportTest.h
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/transport/IOTransportTest.h?rev=593957&r1=593956&r2=593957&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/transport/IOTransportTest.h
(original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/transport/IOTransportTest.h
Sun Nov 11 13:08:58 2007
@@ -41,10 +41,10 @@
class IOTransportTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE( IOTransportTest );
- //CPPUNIT_TEST( testStartClose );
- //CPPUNIT_TEST( testRead );
- //CPPUNIT_TEST( testWrite );
- //CPPUNIT_TEST( testException );
+ CPPUNIT_TEST( testStartClose );
+ CPPUNIT_TEST( testRead );
+ CPPUNIT_TEST( testWrite );
+ CPPUNIT_TEST( testException );
CPPUNIT_TEST_SUITE_END();
public:
@@ -104,7 +104,7 @@
return inputStream;
}
- virtual Command* readCommand( void ) throw (CommandIOException){
+ virtual Command* readCommand( void ) throw ( CommandIOException ){
try{
if( throwException ){
@@ -121,7 +121,12 @@
delete command;
ex.setMark( __FILE__, __LINE__ );
- throw CommandIOException( ex );
+ throw CommandIOException();
+ } catch( ... ) {
+ // Free the memory.
+ delete command;
+
+ throw CommandIOException( __FILE__, __LINE__,
"Catch all" );
}
return command;
@@ -130,7 +135,12 @@
assert(false);
return NULL;
}catch( decaf::lang::Exception& ex ){
- CommandIOException cx( ex );
+ CommandIOException cx;
+ cx.setMark( __FILE__, __LINE__ );
+ throw cx;
+ }
+ catch( ... ){
+ CommandIOException cx;
cx.setMark( __FILE__, __LINE__ );
throw cx;
}
@@ -179,6 +189,10 @@
}catch( decaf::lang::Exception& ex ){
CommandIOException cx( ex );
cx.setMark( __FILE__, __LINE__ );
+ throw cx;
+ }
+ catch( ... ){
+ CommandIOException cx( __FILE__, __LINE__, "writeCommand");
throw cx;
}
}