diff options
Diffstat (limited to 'cpp/src/tests/client_test.cpp')
-rw-r--r-- | cpp/src/tests/client_test.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cpp/src/tests/client_test.cpp b/cpp/src/tests/client_test.cpp index bd2a541c92..011dcd4678 100644 --- a/cpp/src/tests/client_test.cpp +++ b/cpp/src/tests/client_test.cpp @@ -33,12 +33,11 @@ #include "qpid/client/Message.h" #include "qpid/client/Session.h" #include "qpid/framing/FrameSet.h" -#include "qpid/framing/MessageTransferBody.h" +#include "qpid/framing/all_method_bodies.h" using namespace qpid; using namespace qpid::client; -using qpid::framing::FrameSet; -using qpid::framing::MessageTransferBody; +using namespace qpid::framing; using std::string; struct Args : public qpid::TestOptions { @@ -104,14 +103,14 @@ int main(int argc, char** argv) if (opts.trace) std::cout << "Declared queue." << std::endl; //now bind the queue to the exchange - session.queueBind(arg::exchange="MyExchange", arg::queue="MyQueue", arg::routingKey="MyKey"); + session.exchangeBind(arg::exchange="MyExchange", arg::queue="MyQueue", arg::bindingKey="MyKey"); if (opts.trace) std::cout << "Bound queue to exchange." << std::endl; //create and send a message to the exchange using the routing //key we bound our queue with: Message msgOut(generateData(opts.msgSize)); msgOut.getDeliveryProperties().setRoutingKey("MyKey"); - session.messageTransfer(arg::destination="MyExchange", arg::content=msgOut); + session.messageTransfer(arg::destination="MyExchange", arg::content=msgOut, arg::acceptMode=1); if (opts.trace) print("Published message: ", msgOut); //subscribe to the queue, add sufficient credit and then get @@ -132,6 +131,8 @@ int main(int argc, char** argv) } else { print("Received an unexepected message: ", msgIn); } + } else { + throw Exception("Unexpected command received"); } //close the session & connection |