diff options
author | Gordon Sim <gsim@apache.org> | 2008-04-29 20:15:18 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2008-04-29 20:15:18 +0000 |
commit | acc0dee435e1fa22e3b1e7cdfecf6913bf88988e (patch) | |
tree | 729f7a03543acf23380e68897f8788a3e6b45e2e /cpp/src/tests/TestOptions.h | |
parent | a19ce3b1863f80c1232ec2690cd920325a39d71a (diff) | |
download | qpid-python-acc0dee435e1fa22e3b1e7cdfecf6913bf88988e.tar.gz |
QPID-974: allow the size of the queue of outgoing frames to be restricted
QPID-544: tidy up configuration (ensuring desired settings are used correctly,
allowing tcp socket options to be set etc)
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@652083 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/TestOptions.h')
-rw-r--r-- | cpp/src/tests/TestOptions.h | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/cpp/src/tests/TestOptions.h b/cpp/src/tests/TestOptions.h index 87710964d6..b34acaec4e 100644 --- a/cpp/src/tests/TestOptions.h +++ b/cpp/src/tests/TestOptions.h @@ -26,6 +26,7 @@ #include "qpid/Url.h" #include "qpid/log/Logger.h" #include "qpid/client/Connection.h" +#include "qpid/client/ConnectionSettings.h" #include <iostream> #include <exception> @@ -35,22 +36,11 @@ namespace qpid { struct TestOptions : public qpid::Options { TestOptions(const std::string& helpText_=std::string()) : - Options("Test Options"), - host("localhost"), port(TcpAddress::DEFAULT_PORT), - clientid("cpp"), username("guest"), password("guest"), - help(false), helpText(helpText_) + Options("Test Options"), help(false), helpText(helpText_) { addOptions() - ("host,h", optValue(host, "HOST"), "Broker host to connect to") - // TODO aconway 2007-06-26: broker is synonym for host. Drop broker? - ("broker,b", optValue(host, "HOST"), "Broker host to connect to") - ("port,p", optValue(port, "PORT"), "Broker port to connect to") - ("virtualhost,v", optValue(virtualhost, "VHOST"), "virtual host") - ("clientname,n", optValue(clientid, "ID"), "unique client identifier") - ("username", optValue(username, "USER"), "user name for broker log in.") - ("password", optValue(password, "USER"), "password for broker log in.") ("help", optValue(help), "print this usage statement"); - add(log); + add(con); } /** As well as parsing, throw help message if requested. */ @@ -62,8 +52,7 @@ struct TestOptions : public qpid::Options msg << *this << std::endl << std::endl << e.what() << std::endl; throw qpid::Options::Exception(msg.str()); } - trace = log.trace; - qpid::log::Logger::instance().configure(log, argv[0]); + qpid::log::Logger::instance().configure(con.log, argv[0]); if (help) { std::ostringstream msg; msg << *this << std::endl << std::endl << helpText << std::endl; @@ -73,19 +62,12 @@ struct TestOptions : public qpid::Options /** Open a connection using option values */ void open(qpid::client::Connection& connection) { - connection.open(host, port, username, password, virtualhost); + connection.open(con); } - std::string host; - uint16_t port; - std::string virtualhost; - std::string clientid; - std::string username; - std::string password; - bool trace; bool help; - log::Options log; + client::ConnectionSettings con; std::string helpText; }; |