diff options
author | Kenneth Anthony Giusti <kgiusti@apache.org> | 2012-03-22 13:39:14 +0000 |
---|---|---|
committer | Kenneth Anthony Giusti <kgiusti@apache.org> | 2012-03-22 13:39:14 +0000 |
commit | 3c2954782cc6d27bacf8865cfaea9c71c2bfec2b (patch) | |
tree | 2f319b97e0c6d9e0052a8606f0e29d2b643834c2 /qpid/cpp/src/tests/qpid-ping.cpp | |
parent | b51489127365952db902579438294a587a7acf47 (diff) | |
download | qpid-python-qpid-3890.tar.gz |
QPID-3890: resync this branch to latest trunkqpid-3890
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/qpid-3890@1303774 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/qpid-ping.cpp')
-rw-r--r-- | qpid/cpp/src/tests/qpid-ping.cpp | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/qpid/cpp/src/tests/qpid-ping.cpp b/qpid/cpp/src/tests/qpid-ping.cpp index 0cb4afa0ee..52331499e7 100644 --- a/qpid/cpp/src/tests/qpid-ping.cpp +++ b/qpid/cpp/src/tests/qpid-ping.cpp @@ -32,11 +32,20 @@ #include <string> #include <iostream> -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); |