Clean up a bit
diff --git a/activemq-cpp/src/test-integration/activemq/util/CMSListener.cpp b/activemq-cpp/src/test-integration/activemq/util/CMSListener.cpp
index 126b64c..af91d8e 100644
--- a/activemq-cpp/src/test-integration/activemq/util/CMSListener.cpp
+++ b/activemq-cpp/src/test-integration/activemq/util/CMSListener.cpp
@@ -43,42 +43,41 @@
}
////////////////////////////////////////////////////////////////////////////////
-void CMSListener::asyncWaitForMessages( unsigned int count ) {
+void CMSListener::asyncWaitForMessages(unsigned int count) {
try {
synchronized( &mutex ) {
int stopAtZero = count + 5;
- while( numReceived < count ) {
- mutex.wait( 500 );
+ while (numReceived < count) {
+ mutex.wait(500);
- if( --stopAtZero == 0 ) {
+ if (--stopAtZero == 0) {
break;
}
}
}
}
- AMQ_CATCH_RETHROW( activemq::exceptions::ActiveMQException )
- AMQ_CATCHALL_THROW( activemq::exceptions::ActiveMQException )
+ AMQ_CATCH_RETHROW(activemq::exceptions::ActiveMQException)
+ AMQ_CATCHALL_THROW(activemq::exceptions::ActiveMQException)
}
////////////////////////////////////////////////////////////////////////////////
-void CMSListener::onMessage( const cms::Message* message ) {
+void CMSListener::onMessage(const cms::Message* message) {
- if( session->getAcknowledgeMode() == cms::Session::CLIENT_ACKNOWLEDGE ) {
+ if (session->getAcknowledgeMode() == cms::Session::CLIENT_ACKNOWLEDGE) {
try {
message->acknowledge();
- } catch( CMSException& ex ) {
- CPPUNIT_ASSERT_MESSAGE(ex.getStackTraceString(), false );
+ } catch (CMSException& ex) {
+ CPPUNIT_ASSERT_MESSAGE(ex.getStackTraceString(), false);
}
}
// Got a text message.
- const cms::TextMessage* txtMsg =
- dynamic_cast<const cms::TextMessage*>( message );
+ const cms::TextMessage* txtMsg = dynamic_cast<const cms::TextMessage*>(message);
- if( txtMsg != NULL ) {
+ if (txtMsg != NULL) {
numReceived++;
// Signal that we got one
@@ -90,10 +89,9 @@
}
// Got a bytes msg.
- const cms::BytesMessage* bytesMsg =
- dynamic_cast<const cms::BytesMessage*>( message );
+ const cms::BytesMessage* bytesMsg = dynamic_cast<const cms::BytesMessage*>(message);
- if( bytesMsg != NULL ) {
+ if (bytesMsg != NULL) {
numReceived++;
@@ -107,6 +105,6 @@
}
////////////////////////////////////////////////////////////////////////////////
-void CMSListener::onException( const cms::CMSException& error ) {
- CPPUNIT_ASSERT_MESSAGE( error.getStackTraceString(), false );
+void CMSListener::onException(const cms::CMSException& error) {
+ CPPUNIT_ASSERT_MESSAGE(error.getStackTraceString(), false);
}
diff --git a/activemq-cpp/src/test-integration/activemq/util/CMSListener.h b/activemq-cpp/src/test-integration/activemq/util/CMSListener.h
index 2cb8764..7e62fbf 100644
--- a/activemq-cpp/src/test-integration/activemq/util/CMSListener.h
+++ b/activemq-cpp/src/test-integration/activemq/util/CMSListener.h
@@ -42,7 +42,7 @@
public:
- CMSListener( cms::Session* session );
+ CMSListener(cms::Session* session);
virtual ~CMSListener();
unsigned int getNumReceived() const {
@@ -51,10 +51,10 @@
virtual void reset();
- virtual void asyncWaitForMessages( unsigned int count );
+ virtual void asyncWaitForMessages(unsigned int count);
- virtual void onException( const cms::CMSException& error );
- virtual void onMessage( const cms::Message* message );
+ virtual void onException(const cms::CMSException& error);
+ virtual void onMessage(const cms::Message* message);
};
diff --git a/activemq-cpp/src/test-integration/activemq/util/CMSProvider.cpp b/activemq-cpp/src/test-integration/activemq/util/CMSProvider.cpp
index 4e4c23b..d7a7657 100644
--- a/activemq-cpp/src/test-integration/activemq/util/CMSProvider.cpp
+++ b/activemq-cpp/src/test-integration/activemq/util/CMSProvider.cpp
@@ -155,8 +155,8 @@
// Force a new session to be created.
reconnectSession();
}
- AMQ_CATCH_RETHROW( activemq::exceptions::ActiveMQException )
- AMQ_CATCHALL_THROW( activemq::exceptions::ActiveMQException )
+ AMQ_CATCH_RETHROW(activemq::exceptions::ActiveMQException)
+ AMQ_CATCHALL_THROW(activemq::exceptions::ActiveMQException)
}
////////////////////////////////////////////////////////////////////////////////
@@ -175,8 +175,8 @@
reconnectSession();
}
}
- AMQ_CATCH_RETHROW( activemq::exceptions::ActiveMQException )
- AMQ_CATCHALL_THROW( activemq::exceptions::ActiveMQException )
+ AMQ_CATCH_RETHROW(activemq::exceptions::ActiveMQException)
+ AMQ_CATCHALL_THROW(activemq::exceptions::ActiveMQException)
}
////////////////////////////////////////////////////////////////////////////////
@@ -210,8 +210,8 @@
// destroyed.
this->session.reset( this->connection->createSession( this->ackMode ) );
}
- AMQ_CATCH_RETHROW( activemq::exceptions::ActiveMQException )
- AMQ_CATCHALL_THROW( activemq::exceptions::ActiveMQException )
+ AMQ_CATCH_RETHROW(activemq::exceptions::ActiveMQException)
+ AMQ_CATCHALL_THROW(activemq::exceptions::ActiveMQException)
}
////////////////////////////////////////////////////////////////////////////////
@@ -233,24 +233,23 @@
this->session->unsubscribe(this->subscription);
}
}
- AMQ_CATCH_RETHROW( activemq::exceptions::ActiveMQException )
- AMQ_CATCHALL_THROW( activemq::exceptions::ActiveMQException )
+ AMQ_CATCH_RETHROW(activemq::exceptions::ActiveMQException)
+ AMQ_CATCHALL_THROW(activemq::exceptions::ActiveMQException)
}
////////////////////////////////////////////////////////////////////////////////
cms::ConnectionFactory* CMSProvider::getConnectionFactory() {
try {
- if( this->connectionFactory.get() == NULL ) {
+ if (this->connectionFactory.get() == NULL) {
throw decaf::lang::exceptions::IllegalStateException(
- __FILE__, __LINE__,
- "CMSProvider has not been Initialized or is closed." );
+ __FILE__, __LINE__, "CMSProvider has not been Initialized or is closed.");
}
return this->connectionFactory.get();
}
- AMQ_CATCH_RETHROW( activemq::exceptions::ActiveMQException )
- AMQ_CATCHALL_THROW( activemq::exceptions::ActiveMQException )
+ AMQ_CATCH_RETHROW(activemq::exceptions::ActiveMQException)
+ AMQ_CATCHALL_THROW(activemq::exceptions::ActiveMQException)
}
////////////////////////////////////////////////////////////////////////////////
@@ -258,16 +257,15 @@
try {
- if( this->connection.get() == NULL ) {
+ if (this->connection.get() == NULL) {
throw decaf::lang::exceptions::IllegalStateException(
- __FILE__, __LINE__,
- "CMSProvider has not been Initialized or is closed." );
+ __FILE__, __LINE__, "CMSProvider has not been Initialized or is closed.");
}
return this->connection.get();
}
- AMQ_CATCH_RETHROW( activemq::exceptions::ActiveMQException )
- AMQ_CATCHALL_THROW( activemq::exceptions::ActiveMQException )
+ AMQ_CATCH_RETHROW(activemq::exceptions::ActiveMQException)
+ AMQ_CATCHALL_THROW(activemq::exceptions::ActiveMQException)
}
////////////////////////////////////////////////////////////////////////////////
@@ -275,16 +273,15 @@
try {
- if( this->connection.get() == NULL ) {
+ if (this->connection.get() == NULL) {
throw decaf::lang::exceptions::IllegalStateException(
- __FILE__, __LINE__,
- "CMSProvider has not been Initialized or is closed." );
+ __FILE__, __LINE__, "CMSProvider has not been Initialized or is closed.");
}
return this->session.get();
}
- AMQ_CATCH_RETHROW( activemq::exceptions::ActiveMQException )
- AMQ_CATCHALL_THROW( activemq::exceptions::ActiveMQException )
+ AMQ_CATCH_RETHROW(activemq::exceptions::ActiveMQException)
+ AMQ_CATCHALL_THROW(activemq::exceptions::ActiveMQException)
}
////////////////////////////////////////////////////////////////////////////////
@@ -292,21 +289,19 @@
try {
- if( this->connection.get() == NULL ) {
+ if (this->connection.get() == NULL) {
throw decaf::lang::exceptions::IllegalStateException(
- __FILE__, __LINE__,
- "CMSProvider has not been Initialized or is closed." );
+ __FILE__, __LINE__, "CMSProvider has not been Initialized or is closed.");
}
- if( this->producer.get() == NULL ) {
- this->producer.reset(
- this->getSession()->createProducer( this->getDestination() ) );
+ if (this->producer.get() == NULL) {
+ this->producer.reset(this->getSession()->createProducer(this->getDestination()));
}
return this->producer.get();
}
- AMQ_CATCH_RETHROW( activemq::exceptions::ActiveMQException )
- AMQ_CATCHALL_THROW( activemq::exceptions::ActiveMQException )
+ AMQ_CATCH_RETHROW(activemq::exceptions::ActiveMQException)
+ AMQ_CATCHALL_THROW(activemq::exceptions::ActiveMQException)
}
////////////////////////////////////////////////////////////////////////////////
@@ -325,8 +320,8 @@
return this->noDestProducer.get();
}
- AMQ_CATCH_RETHROW( activemq::exceptions::ActiveMQException )
- AMQ_CATCHALL_THROW( activemq::exceptions::ActiveMQException )
+ AMQ_CATCH_RETHROW(activemq::exceptions::ActiveMQException)
+ AMQ_CATCHALL_THROW(activemq::exceptions::ActiveMQException)
}
////////////////////////////////////////////////////////////////////////////////
@@ -341,8 +336,9 @@
if (this->consumer.get() == NULL) {
if (this->durable && this->topic) {
- this->consumer.reset(this->getSession()->createDurableConsumer(
- dynamic_cast<cms::Topic*> (this->getDestination()), this->subscription, ""));
+ this->consumer.reset(
+ this->getSession()->createDurableConsumer(dynamic_cast<cms::Topic*>(this->getDestination()),
+ this->subscription, ""));
} else {
this->consumer.reset(this->getSession()->createConsumer(this->getDestination()));
}
@@ -350,8 +346,8 @@
return this->consumer.get();
}
- AMQ_CATCH_RETHROW( activemq::exceptions::ActiveMQException )
- AMQ_CATCHALL_THROW( activemq::exceptions::ActiveMQException )
+ AMQ_CATCH_RETHROW(activemq::exceptions::ActiveMQException)
+ AMQ_CATCHALL_THROW(activemq::exceptions::ActiveMQException)
}
////////////////////////////////////////////////////////////////////////////////
@@ -374,8 +370,8 @@
return this->destination.get();
}
- AMQ_CATCH_RETHROW( activemq::exceptions::ActiveMQException )
- AMQ_CATCHALL_THROW( activemq::exceptions::ActiveMQException )
+ AMQ_CATCH_RETHROW(activemq::exceptions::ActiveMQException)
+ AMQ_CATCHALL_THROW(activemq::exceptions::ActiveMQException)
}
////////////////////////////////////////////////////////////////////////////////
@@ -398,8 +394,8 @@
return this->tempDestination.get();
}
- AMQ_CATCH_RETHROW( activemq::exceptions::ActiveMQException )
- AMQ_CATCHALL_THROW( activemq::exceptions::ActiveMQException )
+ AMQ_CATCH_RETHROW(activemq::exceptions::ActiveMQException)
+ AMQ_CATCHALL_THROW(activemq::exceptions::ActiveMQException)
}
////////////////////////////////////////////////////////////////////////////////
@@ -412,7 +408,7 @@
__FILE__, __LINE__, "CMSProvider has not been Initialized or is closed.");
}
- ActiveMQConnection* amqConnection = dynamic_cast<ActiveMQConnection*> (this->connection.get());
+ ActiveMQConnection* amqConnection = dynamic_cast<ActiveMQConnection*>(this->connection.get());
try {
amqConnection->destroyDestination(destination);
@@ -423,6 +419,6 @@
} catch (...) {
}
}
- AMQ_CATCH_RETHROW( activemq::exceptions::ActiveMQException )
- AMQ_CATCHALL_THROW( activemq::exceptions::ActiveMQException )
+ AMQ_CATCH_RETHROW(activemq::exceptions::ActiveMQException)
+ AMQ_CATCHALL_THROW(activemq::exceptions::ActiveMQException)
}