From 633c33f224f3196f3f9bd80bd2e418d8143fea06 Mon Sep 17 00:00:00 2001 From: Kim van der Riet Date: Fri, 4 May 2012 15:39:19 +0000 Subject: QPID-3858: Updated branch - merged from trunk r.1333987 git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1334037 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/tests/qpid-ping.cpp | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'cpp/src/tests/qpid-ping.cpp') diff --git a/cpp/src/tests/qpid-ping.cpp b/cpp/src/tests/qpid-ping.cpp index 0cb4afa0ee..52331499e7 100644 --- a/cpp/src/tests/qpid-ping.cpp +++ b/cpp/src/tests/qpid-ping.cpp @@ -32,11 +32,20 @@ #include #include -using namespace std; -using namespace qpid::sys; -using namespace qpid::framing; -using namespace qpid::client; -using namespace qpid; +using std::cerr; +using std::cout; +using std::endl; +using std::exception; +using std::string; +using namespace qpid::client::arg; // For keyword args +using qpid::client::AsyncSession; +using qpid::client::Connection; +using qpid::client::Message; +using qpid::client::SubscriptionManager; +using qpid::framing::Uuid; + +namespace qpid { +namespace tests { struct PingOptions : public qpid::TestOptions { int timeout; // Timeout in seconds. @@ -48,9 +57,11 @@ struct PingOptions : public qpid::TestOptions { } }; +}} // namespace qpid::tests + int main(int argc, char** argv) { try { - PingOptions opts; + qpid::tests::PingOptions opts; opts.parse(argc, argv); opts.con.heartbeat = (opts.timeout+1)/2; Connection connection; @@ -58,8 +69,8 @@ int main(int argc, char** argv) { if (!opts.quiet) cout << "Opened connection." << endl; AsyncSession s = connection.newSession(); string qname(Uuid(true).str()); - s.queueDeclare(arg::queue=qname,arg::autoDelete=true,arg::exclusive=true); - s.messageTransfer(arg::content=Message("hello", qname)); + s.queueDeclare(queue=qname, autoDelete=true, exclusive=true); + s.messageTransfer(content=Message("hello", qname)); if (!opts.quiet) cout << "Sent message." << endl; SubscriptionManager subs(s); subs.get(qname); -- cgit v1.2.1