You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2015/08/05 22:25:21 UTC
activemq-cpp git commit: Fix some more issues found on Mac builds.
Repository: activemq-cpp
Updated Branches:
refs/heads/master 22408e32a -> e74c5f3f4
Fix some more issues found on Mac builds.
Project: http://git-wip-us.apache.org/repos/asf/activemq-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-cpp/commit/e74c5f3f
Tree: http://git-wip-us.apache.org/repos/asf/activemq-cpp/tree/e74c5f3f
Diff: http://git-wip-us.apache.org/repos/asf/activemq-cpp/diff/e74c5f3f
Branch: refs/heads/master
Commit: e74c5f3f4755cb5adf24e1884e81584e13c56c17
Parents: 22408e3
Author: Timothy Bish <ta...@gmail.com>
Authored: Wed Aug 5 16:25:04 2015 -0400
Committer: Timothy Bish <ta...@gmail.com>
Committed: Wed Aug 5 16:25:04 2015 -0400
----------------------------------------------------------------------
.../activemq/commands/ActiveMQDestination.cpp | 2 +-
.../src/main/activemq/util/AdvisorySupport.cpp | 2 +-
.../activemq/util/PrimitiveValueConverter.h | 2 +-
activemq-cpp/src/main/decaf/util/AbstractMap.h | 4 +-
.../decaf/util/concurrent/SynchronousQueue.h | 12 +-
.../correlator/ResponseCorrelatorTest.cpp | 275 +++++++++----------
.../internal/net/URIEncoderDecoderTest.cpp | 45 ++-
7 files changed, 166 insertions(+), 176 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/e74c5f3f/activemq-cpp/src/main/activemq/commands/ActiveMQDestination.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQDestination.cpp b/activemq-cpp/src/main/activemq/commands/ActiveMQDestination.cpp
index 5e25b64..037471e 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQDestination.cpp
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQDestination.cpp
@@ -233,7 +233,7 @@ std::string ActiveMQDestination::getDestinationTypeAsString() const {
return "TempTopic";
default:
throw new IllegalArgumentException(
- __FILE__, __LINE__, "Invalid destination type: " + getDestinationType());
+ __FILE__, __LINE__, "Invalid destination type: %d", (int) getDestinationType());
}
}
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/e74c5f3f/activemq-cpp/src/main/activemq/util/AdvisorySupport.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/util/AdvisorySupport.cpp b/activemq-cpp/src/main/activemq/util/AdvisorySupport.cpp
index ab9694e..4d96bad 100644
--- a/activemq-cpp/src/main/activemq/util/AdvisorySupport.cpp
+++ b/activemq-cpp/src/main/activemq/util/AdvisorySupport.cpp
@@ -593,7 +593,7 @@ ActiveMQDestination* AdvisorySupport::getDestinationAdvisoryTopic(const ActiveMQ
return getTempTopicAdvisoryTopic();
default:
throw new IllegalArgumentException(
- __FILE__, __LINE__, "Unknown destination type: " + destination->getDestinationType());
+ __FILE__, __LINE__, "Unknown destination type: %d", (int) destination->getDestinationType());
}
}
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/e74c5f3f/activemq-cpp/src/main/activemq/util/PrimitiveValueConverter.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/util/PrimitiveValueConverter.h b/activemq-cpp/src/main/activemq/util/PrimitiveValueConverter.h
index d674456..dc1809b 100644
--- a/activemq-cpp/src/main/activemq/util/PrimitiveValueConverter.h
+++ b/activemq-cpp/src/main/activemq/util/PrimitiveValueConverter.h
@@ -58,7 +58,7 @@ namespace util {
virtual ~PrimitiveValueConverter() {}
template<typename TO>
- TO convert(const PrimitiveValueNode& value) const {
+ TO convert(const PrimitiveValueNode& value DECAF_UNUSED) const {
throw decaf::lang::exceptions::UnsupportedOperationException(
__FILE__, __LINE__, "Invalid Conversion");
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/e74c5f3f/activemq-cpp/src/main/decaf/util/AbstractMap.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/decaf/util/AbstractMap.h b/activemq-cpp/src/main/decaf/util/AbstractMap.h
index 407d207..ee73da9 100644
--- a/activemq-cpp/src/main/decaf/util/AbstractMap.h
+++ b/activemq-cpp/src/main/decaf/util/AbstractMap.h
@@ -65,9 +65,9 @@ namespace util {
AbstractMap() : Map<K, V>(), mutex() {}
- AbstractMap(const Map<K, V>& map) : Map<K, V>(), mutex() {}
+ AbstractMap(const Map<K, V>& map DECAF_UNUSED) : Map<K, V>(), mutex() {}
- AbstractMap(const AbstractMap<K, V>& map) : Map<K, V>(), mutex() {}
+ AbstractMap(const AbstractMap<K, V>& map DECAF_UNUSED) : Map<K, V>(), mutex() {}
virtual ~AbstractMap() {}
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/e74c5f3f/activemq-cpp/src/main/decaf/util/concurrent/SynchronousQueue.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/decaf/util/concurrent/SynchronousQueue.h b/activemq-cpp/src/main/decaf/util/concurrent/SynchronousQueue.h
index 1194103..7a6cad1 100644
--- a/activemq-cpp/src/main/decaf/util/concurrent/SynchronousQueue.h
+++ b/activemq-cpp/src/main/decaf/util/concurrent/SynchronousQueue.h
@@ -105,7 +105,7 @@ namespace concurrent {
* @throws NullPointerException {@inheritDoc}
* @throws IllegalArgumentException {@inheritDoc}
*/
- virtual void put(const E& value) {
+ virtual void put(const E& value DECAF_UNUSED) {
//if (o == null) throw new NullPointerException();
//if (transferer.transfer(o, false, 0) == null) {
@@ -125,7 +125,7 @@ namespace concurrent {
* @throws NullPointerException {@inheritDoc}
* @throws IllegalArgumentException {@inheritDoc}
*/
- virtual bool offer(const E& e, long long timeout, const TimeUnit& unit) {
+ virtual bool offer(const E& e DECAF_UNUSED, long long timeout DECAF_UNUSED, const TimeUnit& unit DECAF_UNUSED) {
//if (o == null) throw new NullPointerException();
//if (transferer.transfer(o, true, unit.toNanos(timeout)) != null)
@@ -151,7 +151,7 @@ namespace concurrent {
* @throws IllegalArgumentException if some property of the specified
* element prevents it from being added to this queue
*/
- virtual bool offer(const E& value) {
+ virtual bool offer(const E& value DECAF_UNUSED) {
//if (e == null) throw new NullPointerException();
//return transferer.transfer(e, true, 0) != null;
@@ -190,7 +190,7 @@ namespace concurrent {
* @return true if the head of the Queue was copied to the result param
* or false if no value could be returned.
*/
- virtual bool poll(E& result, long long timeout, const TimeUnit& unit) {
+ virtual bool poll(E& result DECAF_UNUSED, long long timeout DECAF_UNUSED, const TimeUnit& unit DECAF_UNUSED) {
//Object e = transferer.transfer(null, true, unit.toNanos(timeout));
//if (e != null || !Thread.interrupted())
@@ -210,12 +210,12 @@ namespace concurrent {
* @return true if the head of the Queue was copied to the result param
* or false if no value could be returned.
*/
- virtual bool poll(E& result) {
+ virtual bool poll(E& result DECAF_UNUSED) {
return false; // (E)transferer.transfer(null, true, 0);
}
virtual bool equals(const Collection<E>& value) const {
- if( (void*)&value == this ) {
+ if ((void*) &value == this) {
return true;
}
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/e74c5f3f/activemq-cpp/src/test/activemq/transport/correlator/ResponseCorrelatorTest.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/test/activemq/transport/correlator/ResponseCorrelatorTest.cpp b/activemq-cpp/src/test/activemq/transport/correlator/ResponseCorrelatorTest.cpp
index d868dbe..2058b5d 100644
--- a/activemq-cpp/src/test/activemq/transport/correlator/ResponseCorrelatorTest.cpp
+++ b/activemq-cpp/src/test/activemq/transport/correlator/ResponseCorrelatorTest.cpp
@@ -33,36 +33,38 @@ using namespace activemq::transport::correlator;
using namespace decaf::io;
////////////////////////////////////////////////////////////////////////////////
-namespace activemq{
-namespace transport{
-namespace correlator{
-
- class MyCommand : public commands::BaseCommand{
- private:
-
- unsigned int commandId;
+namespace activemq {
+namespace transport {
+namespace correlator {
+ class MyCommand : public commands::BaseCommand {
public:
- MyCommand() : commandId() {}
+ MyCommand() {}
+
virtual ~MyCommand() {}
- virtual std::string toString() const{ return ""; }
+ virtual std::string toString() const {
+ return "";
+ }
- virtual unsigned char getDataStructureType() const { return 1; }
+ virtual unsigned char getDataStructureType() const {
+ return 1;
+ }
- virtual decaf::lang::Pointer<commands::Command> visit( activemq::state::CommandVisitor* visitor )
- { return decaf::lang::Pointer<commands::Command>(); }
+ virtual decaf::lang::Pointer<commands::Command> visit(activemq::state::CommandVisitor* visitor) {
+ return decaf::lang::Pointer<commands::Command>();
+ }
- virtual MyCommand* cloneDataStructure() const{
+ virtual MyCommand* cloneDataStructure() const {
MyCommand* command = new MyCommand;
- command->setCommandId( this->getCommandId() );
- command->setResponseRequired( this->isResponseRequired() );
+ command->setCommandId(this->getCommandId());
+ command->setResponseRequired(this->isResponseRequired());
return command;
}
};
- class MyTransport : public Transport, public decaf::lang::Runnable{
+ class MyTransport : public Transport, public decaf::lang::Runnable {
public:
TransportListener* listener;
@@ -79,18 +81,16 @@ namespace correlator{
public:
- MyTransport() :
- listener(NULL), thread(NULL), mutex(), startedMutex(), done(false), requests() {
+ MyTransport() : listener(NULL), thread(NULL), mutex(), startedMutex(), done(false), requests() {
}
virtual ~MyTransport(){
close();
}
- virtual void oneway( const Pointer<Command> command )
- {
- synchronized( &mutex ){
- requests.push( command );
+ virtual void oneway(const Pointer<Command> command) {
+ synchronized(&mutex) {
+ requests.push(command);
mutex.notifyAll();
}
}
@@ -101,13 +101,13 @@ namespace correlator{
__FILE__, __LINE__, "stuff" );
}
- virtual Pointer<Response> request( const Pointer<Command> command AMQCPP_UNUSED ) {
+ virtual Pointer<Response> request(const Pointer<Command> command AMQCPP_UNUSED ) {
throw decaf::lang::exceptions::UnsupportedOperationException(
__FILE__, __LINE__, "stuff" );
}
- virtual Pointer<Response> request( const Pointer<Command> command AMQCPP_UNUSED,
- unsigned int timeout AMQCPP_UNUSED ) {
+ virtual Pointer<Response> request(const Pointer<Command> command AMQCPP_UNUSED,
+ unsigned int timeout AMQCPP_UNUSED) {
throw decaf::lang::exceptions::UnsupportedOperationException(
__FILE__, __LINE__, "stuff" );
}
@@ -142,8 +142,8 @@ namespace correlator{
done = true;
- if( thread != NULL ){
- synchronized( &mutex ){
+ if (thread != NULL) {
+ synchronized( &mutex ) {
mutex.notifyAll();
}
thread->join();
@@ -152,70 +152,67 @@ namespace correlator{
}
}
- virtual Pointer<Response> createResponse( const Pointer<Command> command ){
-
- Pointer<Response> resp( new commands::Response() );
- resp->setCorrelationId( command->getCommandId() );
- resp->setResponseRequired( false );
+ virtual Pointer<Response> createResponse(const Pointer<Command> command) {
+ Pointer<Response> resp(new commands::Response());
+ resp->setCorrelationId(command->getCommandId());
+ resp->setResponseRequired(false);
return resp;
}
- virtual void run(){
+ virtual void run() {
- try{
+ try {
- synchronized(&startedMutex)
- {
- startedMutex.notifyAll();
+ synchronized(&startedMutex) {
+ startedMutex.notifyAll();
}
- synchronized( &mutex ){
+ synchronized(&mutex) {
- while( !done ){
+ while (!done) {
- if( requests.empty() ){
+ if (requests.empty()) {
mutex.wait();
- }else{
+ } else {
Pointer<Command> cmd = requests.front();
requests.pop();
// Only send a response if one is required.
Pointer<Response> resp;
- if( cmd->isResponseRequired() ){
- resp = createResponse( cmd );
+ if (cmd->isResponseRequired()) {
+ resp = createResponse(cmd);
}
mutex.unlock();
// Send both the response and the original
// command back to the correlator.
- if( listener != NULL ){
- if( resp != NULL ){
- listener->onCommand( resp );
+ if (listener != NULL) {
+ if (resp != NULL) {
+ listener->onCommand(resp);
}
- listener->onCommand( cmd );
+ listener->onCommand(cmd);
}
mutex.lock();
}
}
}
- }catch( exceptions::ActiveMQException& ex ){
- if( listener ){
- listener->onException( ex );
+ } catch (exceptions::ActiveMQException& ex) {
+ if (listener) {
+ listener->onException(ex);
}
- }
- catch( ... ){
- if( listener ){
- exceptions::ActiveMQException ex( __FILE__, __LINE__, "stuff" );
- listener->onException( ex );
+ } catch (...) {
+ if (listener) {
+ exceptions::ActiveMQException ex( __FILE__, __LINE__, "stuff");
+ listener->onException(ex);
}
}
}
- virtual Transport* narrow( const std::type_info& typeId ) {
- if( typeid( *this ) == typeId ) {
+ virtual Transport* narrow(const std::type_info& typeId) {
+ if (typeid( *this ) == typeId) {
return this;
}
@@ -238,7 +235,7 @@ namespace correlator{
return "";
}
- virtual void reconnect( const decaf::net::URI& uri ) {}
+ virtual void reconnect(const decaf::net::URI& uri) {}
virtual bool isReconnectSupported() const {
return false;
@@ -248,22 +245,22 @@ namespace correlator{
return false;
}
- virtual void updateURIs( bool rebalance AMQCPP_UNUSED,
- const decaf::util::List<decaf::net::URI>& uris AMQCPP_UNUSED ) {
+ virtual void updateURIs(bool rebalance AMQCPP_UNUSED,
+ const decaf::util::List<decaf::net::URI>& uris AMQCPP_UNUSED) {
throw decaf::io::IOException();
}
};
- class MyBrokenTransport : public MyTransport{
+ class MyBrokenTransport : public MyTransport {
public:
MyBrokenTransport(){}
virtual ~MyBrokenTransport(){}
- virtual Pointer<Response> createResponse( const Pointer<Command> command ){
- throw exceptions::ActiveMQException( __FILE__, __LINE__,
- "bad stuff" );
+ virtual Pointer<Response> createResponse(const Pointer<Command> command) {
+ throw exceptions::ActiveMQException(
+ __FILE__, __LINE__, "bad stuff");
}
};
@@ -279,23 +276,20 @@ namespace correlator{
MyListener() : exCount(0), commands(), mutex() {}
virtual ~MyListener(){}
- virtual void onCommand( const Pointer<Command> command ){
+ virtual void onCommand(const Pointer<Command> command) {
- synchronized( &mutex ){
- commands.insert( command->getCommandId() );
+ synchronized(&mutex) {
+ commands.insert(command->getCommandId());
mutex.notify();
}
}
- virtual void onException(
- const decaf::lang::Exception& ex AMQCPP_UNUSED)
- {
- synchronized( &mutex ){
+ virtual void onException(const decaf::lang::Exception& ex AMQCPP_UNUSED) {
+ synchronized(&mutex) {
exCount++;
}
}
-
};
class RequestThread : public decaf::lang::Thread {
@@ -321,12 +315,11 @@ namespace correlator{
}
void run() {
-
- try{
+ try {
resp = transport->request(cmd);
Thread::sleep(10);
- }catch( ... ){
- CPPUNIT_ASSERT( false );
+ } catch (...) {
+ CPPUNIT_ASSERT(false);
}
}
};
@@ -337,32 +330,32 @@ namespace correlator{
void ResponseCorrelatorTest::testBasics() {
MyListener listener;
- Pointer<MyTransport> transport( new MyTransport() );
- ResponseCorrelator correlator( transport );
- correlator.setTransportListener( &listener );
- CPPUNIT_ASSERT( transport->listener == &correlator );
+ Pointer<MyTransport> transport(new MyTransport());
+ ResponseCorrelator correlator(transport);
+ correlator.setTransportListener(&listener);
+ CPPUNIT_ASSERT(transport->listener == &correlator);
// Give the thread a little time to get up and running.
- synchronized( &(transport->startedMutex) ) {
+ synchronized(&(transport->startedMutex)) {
// Start the transport.
correlator.start();
transport->startedMutex.wait();
}
// Send one request.
- Pointer<MyCommand> cmd( new MyCommand );
- Pointer<Response> resp = correlator.request( cmd );
- CPPUNIT_ASSERT( resp != NULL );
- CPPUNIT_ASSERT( resp->getCorrelationId() == cmd->getCommandId() );
+ Pointer<MyCommand> cmd(new MyCommand);
+ Pointer<Response> resp = correlator.request(cmd);
+ CPPUNIT_ASSERT(resp != NULL);
+ CPPUNIT_ASSERT(resp->getCorrelationId() == cmd->getCommandId());
// Wait to get the message back asynchronously.
- decaf::lang::Thread::sleep( 100 );
+ decaf::lang::Thread::sleep(100);
// Since our transport relays our original command back at us as a
// non-response message, check to make sure we received it and that
// it is the original command.
- CPPUNIT_ASSERT( listener.commands.size() == 1 );
- CPPUNIT_ASSERT( listener.exCount == 0 );
+ CPPUNIT_ASSERT(listener.commands.size() == 1);
+ CPPUNIT_ASSERT(listener.exCount == 0);
correlator.close();
}
@@ -371,10 +364,10 @@ void ResponseCorrelatorTest::testBasics() {
void ResponseCorrelatorTest::testOneway(){
MyListener listener;
- Pointer<MyTransport> transport( new MyTransport() );
- ResponseCorrelator correlator( transport );
- correlator.setTransportListener( &listener );
- CPPUNIT_ASSERT( transport->listener == &correlator );
+ Pointer<MyTransport> transport(new MyTransport());
+ ResponseCorrelator correlator(transport);
+ correlator.setTransportListener(&listener);
+ CPPUNIT_ASSERT(transport->listener == &correlator);
// Give the thread a little time to get up and running.
synchronized( &(transport->startedMutex) ) {
@@ -387,17 +380,17 @@ void ResponseCorrelatorTest::testOneway(){
// Send many oneway request (we'll get them back asynchronously).
const unsigned int numCommands = 1000;
- for( unsigned int ix = 0; ix < numCommands; ++ix ) {
- Pointer<MyCommand> command( new MyCommand() );
- correlator.oneway( command );
+ for (unsigned int ix = 0; ix < numCommands; ++ix) {
+ Pointer<MyCommand> command(new MyCommand());
+ correlator.oneway(command);
}
// Give the thread a little time to get all the messages back.
- decaf::lang::Thread::sleep( 500 );
+ decaf::lang::Thread::sleep(500);
// Make sure we got them all back.
- CPPUNIT_ASSERT( listener.commands.size() == numCommands );
- CPPUNIT_ASSERT( listener.exCount == 0 );
+ CPPUNIT_ASSERT(listener.commands.size() == numCommands);
+ CPPUNIT_ASSERT(listener.exCount == 0);
correlator.close();
}
@@ -406,10 +399,10 @@ void ResponseCorrelatorTest::testOneway(){
void ResponseCorrelatorTest::testTransportException(){
MyListener listener;
- Pointer<MyBrokenTransport> transport( new MyBrokenTransport() );
- ResponseCorrelator correlator( transport );
- correlator.setTransportListener( &listener );
- CPPUNIT_ASSERT( transport->listener == &correlator );
+ Pointer<MyBrokenTransport> transport(new MyBrokenTransport());
+ ResponseCorrelator correlator(transport);
+ correlator.setTransportListener(&listener);
+ CPPUNIT_ASSERT(transport->listener == &correlator);
// Give the thread a little time to get up and running.
synchronized( &(transport->startedMutex) ) {
@@ -420,21 +413,21 @@ void ResponseCorrelatorTest::testTransportException(){
}
// Send one request.
- Pointer<MyCommand> cmd( new MyCommand );
- try{
- correlator.request( cmd, 1000 );
- }catch( IOException& ex ){
+ Pointer<MyCommand> cmd(new MyCommand);
+ try {
+ correlator.request(cmd, 1000);
+ } catch (IOException& ex) {
CPPUNIT_ASSERT(false);
}
// Wait to make sure we get the asynchronous message back.
- decaf::lang::Thread::sleep( 200 );
+ decaf::lang::Thread::sleep(200);
// Since our transport relays our original command back at us as a
// non-response message, check to make sure we received it and that
// it is the original command.
- CPPUNIT_ASSERT( listener.commands.size() == 0 );
- CPPUNIT_ASSERT( listener.exCount == 1 );
+ CPPUNIT_ASSERT(listener.commands.size() == 0);
+ CPPUNIT_ASSERT(listener.exCount == 1);
correlator.close();
}
@@ -443,16 +436,16 @@ void ResponseCorrelatorTest::testTransportException(){
void ResponseCorrelatorTest::testMultiRequests(){
MyListener listener;
- Pointer<MyTransport> transport( new MyTransport() );
- ResponseCorrelator correlator( transport );
- correlator.setTransportListener( &listener );
- CPPUNIT_ASSERT( transport->listener == &correlator );
+ Pointer<MyTransport> transport(new MyTransport());
+ ResponseCorrelator correlator(transport);
+ correlator.setTransportListener(&listener);
+ CPPUNIT_ASSERT(transport->listener == &correlator);
// Start the transport.
correlator.start();
// Make sure the start command got down to the thread.
- CPPUNIT_ASSERT( transport->thread != NULL );
+ CPPUNIT_ASSERT(transport->thread != NULL);
// Give the thread a little time to get up and running.
synchronized( &(transport->startedMutex) ) {
@@ -462,32 +455,30 @@ void ResponseCorrelatorTest::testMultiRequests(){
// Start all the requester threads.
const unsigned int numRequests = 20;
RequestThread requesters[numRequests];
- for( unsigned int ix=0; ix<numRequests; ++ix ){
- requesters[ix].setTransport( &correlator );
+ for (unsigned int ix = 0; ix < numRequests; ++ix) {
+ requesters[ix].setTransport(&correlator);
requesters[ix].start();
}
// Make sure we got all the responses and that they were all
// what we expected.
- for( unsigned int ix=0; ix<numRequests; ++ix ){
+ for (unsigned int ix = 0; ix < numRequests; ++ix) {
requesters[ix].join();
- CPPUNIT_ASSERT( requesters[ix].resp != NULL );
- CPPUNIT_ASSERT( requesters[ix].cmd->getCommandId() ==
- requesters[ix].resp->getCorrelationId() );
+ CPPUNIT_ASSERT(requesters[ix].resp != NULL);
+ CPPUNIT_ASSERT(requesters[ix].cmd->getCommandId() ==
+ requesters[ix].resp->getCorrelationId());
}
- decaf::lang::Thread::sleep( 60 );
- synchronized( &listener.mutex )
- {
+ decaf::lang::Thread::sleep(60);
+ synchronized(&listener.mutex) {
unsigned int count = 0;
- while( listener.commands.size() != numRequests )
- {
- listener.mutex.wait( 75 );
+ while (listener.commands.size() != numRequests) {
+ listener.mutex.wait(75);
++count;
- if( count == numRequests ) {
+ if (count == numRequests) {
break;
}
}
@@ -496,8 +487,8 @@ void ResponseCorrelatorTest::testMultiRequests(){
// Since our transport relays our original command back at us as a
// non-response message, check to make sure we received it and that
// it is the original command.
- CPPUNIT_ASSERT( listener.commands.size() == numRequests );
- CPPUNIT_ASSERT( listener.exCount == 0 );
+ CPPUNIT_ASSERT(listener.commands.size() == numRequests);
+ CPPUNIT_ASSERT(listener.exCount == 0);
correlator.close();
}
@@ -505,21 +496,21 @@ void ResponseCorrelatorTest::testMultiRequests(){
////////////////////////////////////////////////////////////////////////////////
void ResponseCorrelatorTest::testNarrow(){
- Pointer<MyTransport> transport( new MyTransport() );
- ResponseCorrelator correlator( transport );
+ Pointer<MyTransport> transport(new MyTransport());
+ ResponseCorrelator correlator(transport);
- Transport* narrowed = correlator.narrow( typeid( *transport ) );
- CPPUNIT_ASSERT( narrowed == transport );
+ Transport* narrowed = correlator.narrow(typeid( *transport ));
+ CPPUNIT_ASSERT(narrowed == transport);
- narrowed = correlator.narrow( typeid( std::string() ) );
- CPPUNIT_ASSERT( narrowed == NULL );
+ narrowed = correlator.narrow(typeid(std::string()));
+ CPPUNIT_ASSERT(narrowed == NULL);
- narrowed = correlator.narrow( typeid( MyTransport ) );
- CPPUNIT_ASSERT( narrowed == transport );
+ narrowed = correlator.narrow(typeid(MyTransport));
+ CPPUNIT_ASSERT(narrowed == transport);
- narrowed = correlator.narrow( typeid( transport::correlator::ResponseCorrelator ) );
- CPPUNIT_ASSERT( narrowed == &correlator );
+ narrowed = correlator.narrow(typeid(transport::correlator::ResponseCorrelator));
+ CPPUNIT_ASSERT(narrowed == &correlator);
- narrowed = correlator.narrow( typeid( correlator ) );
- CPPUNIT_ASSERT( narrowed == &correlator );
+ narrowed = correlator.narrow(typeid( correlator ));
+ CPPUNIT_ASSERT(narrowed == &correlator);
}
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/e74c5f3f/activemq-cpp/src/test/decaf/internal/net/URIEncoderDecoderTest.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/test/decaf/internal/net/URIEncoderDecoderTest.cpp b/activemq-cpp/src/test/decaf/internal/net/URIEncoderDecoderTest.cpp
index b54b09e..6d95d27 100644
--- a/activemq-cpp/src/test/decaf/internal/net/URIEncoderDecoderTest.cpp
+++ b/activemq-cpp/src/test/decaf/internal/net/URIEncoderDecoderTest.cpp
@@ -38,17 +38,16 @@ void URIEncoderDecoderTest::testValidate() {
CPPUNIT_ASSERT_NO_THROW_MESSAGE(
"1. String should Validate:",
- URIEncoderDecoder::validate( str1, legalSet1 ) );
+ URIEncoderDecoder::validate(str1, legalSet1));
CPPUNIT_ASSERT_NO_THROW_MESSAGE(
"2. String should Validate:",
- URIEncoderDecoder::validate( str2, "" ) );
+ URIEncoderDecoder::validate(str2, ""));
CPPUNIT_ASSERT_THROW_MESSAGE(
"1. String should not Validate:",
- URIEncoderDecoder::validate( str1, "" ),
- URISyntaxException );
-
+ URIEncoderDecoder::validate(str1, ""),
+ URISyntaxException);
}
////////////////////////////////////////////////////////////////////////////////
@@ -61,16 +60,16 @@ void URIEncoderDecoderTest::testValidateSimple() {
CPPUNIT_ASSERT_NO_THROW_MESSAGE(
"1. String should Validate:",
- URIEncoderDecoder::validate( str1, legalSet1 ) );
+ URIEncoderDecoder::validate(str1, legalSet1));
CPPUNIT_ASSERT_NO_THROW_MESSAGE(
"2. String should Validate:",
- URIEncoderDecoder::validate( str2, "" ) );
+ URIEncoderDecoder::validate(str2, ""));
CPPUNIT_ASSERT_THROW_MESSAGE(
"1. String should not Validate:",
- URIEncoderDecoder::validate( str1, "" ),
- URISyntaxException );
+ URIEncoderDecoder::validate(str1, ""),
+ URISyntaxException);
}
////////////////////////////////////////////////////////////////////////////////
@@ -81,21 +80,21 @@ void URIEncoderDecoderTest::testQuoteIllegal() {
std::string pound3 = "A#*"; // A%23*
std::string legal = "A"; // A
- CPPUNIT_ASSERT_NO_THROW_MESSAGE(
+ CPPUNIT_ASSERT_MESSAGE(
"1. Result not equal to: %23",
- URIEncoderDecoder::quoteIllegal( pound1, "" ) == "%23" );
+ URIEncoderDecoder::quoteIllegal(pound1, "") == "%23");
- CPPUNIT_ASSERT_NO_THROW_MESSAGE(
+ CPPUNIT_ASSERT_MESSAGE(
"2. Result not equal to: %23%23",
- URIEncoderDecoder::quoteIllegal( pound2, "" ) == "%23%23" );
+ URIEncoderDecoder::quoteIllegal(pound2, "") == "%23%23");
- CPPUNIT_ASSERT_NO_THROW_MESSAGE(
+ CPPUNIT_ASSERT_MESSAGE(
"3. Result not equal to: A%23*",
- URIEncoderDecoder::quoteIllegal( pound3, "*" ) == "A%23*" );
+ URIEncoderDecoder::quoteIllegal(pound3, "*") == "A%23*");
- CPPUNIT_ASSERT_NO_THROW_MESSAGE(
+ CPPUNIT_ASSERT_MESSAGE(
"4. Result not equal to: A",
- URIEncoderDecoder::quoteIllegal( legal, "" ) == "A" );
+ URIEncoderDecoder::quoteIllegal(legal, "") == "A");
}
////////////////////////////////////////////////////////////////////////////////
@@ -107,13 +106,13 @@ void URIEncoderDecoderTest::testEncodeOthers() {
test1 += (char)156;
test2 += 'A';
- CPPUNIT_ASSERT_NO_THROW_MESSAGE(
+ CPPUNIT_ASSERT_MESSAGE(
"1. Result not equal to: %9C",
- URIEncoderDecoder::encodeOthers( test1 ) == "%9C" );
+ URIEncoderDecoder::encodeOthers(test1) == "%9C");
- CPPUNIT_ASSERT_NO_THROW_MESSAGE(
+ CPPUNIT_ASSERT_MESSAGE(
"2. Result not equal to: A",
- URIEncoderDecoder::encodeOthers( test2 ) == "A" );
+ URIEncoderDecoder::encodeOthers(test2) == "A");
}
@@ -122,7 +121,7 @@ void URIEncoderDecoderTest::testDecode() {
string test = "A%20B%20C %24%25";
- CPPUNIT_ASSERT_NO_THROW_MESSAGE(
+ CPPUNIT_ASSERT_MESSAGE(
"1. Result not equal to: 'A B C $%",
- URIEncoderDecoder::decode( test ) == "A B C $%" );
+ URIEncoderDecoder::decode(test) == "A B C $%");
}