diff options
| author | Alan Conway <aconway@apache.org> | 2007-06-27 00:12:26 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2007-06-27 00:12:26 +0000 |
| commit | d032f5584b0f1de890844a2796d6ba158b011fca (patch) | |
| tree | 7ffc500423a1cee3c39d2a5e27d301057fbcd0e9 /cpp/src/tests/TestOptions.h | |
| parent | 2e15ee024a7f47bda7bd6ea5991657a820bd0714 (diff) | |
| download | qpid-python-d032f5584b0f1de890844a2796d6ba158b011fca.tar.gz | |
Make check now starts a broker on a dynamically assigned port, so
multiple qpid builds on one host will not conflict.
* src/tests/run_test, start_broker, kill_broker:
Broker writes port to file, run_test sets QPID_PORT
in environment of all tests.
* src/tests/topic_publisher.cpp, topic_listener.cpp, client_test.cpp:
All test clients use TestOptions to parse options from args and env.
* src/qpid/Options.h: Renamed from CommonOptions.h
Simplified use of Options class.
* src/qpid/Url.h: Renamed defaultPort constant.
* src/tests/logging.cpp:
* src/tests/interop_runner.cpp:
* src/tests/TestOptions.h:
* src/qpidd.cpp:
* src/qpid/log/Options.cpp:
* src/qpid/log/Logger.cpp:
* src/qpid/broker/Broker.cpp:
Updated for changes to Options.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@550993 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/TestOptions.h')
| -rw-r--r-- | cpp/src/tests/TestOptions.h | 51 |
1 files changed, 20 insertions, 31 deletions
diff --git a/cpp/src/tests/TestOptions.h b/cpp/src/tests/TestOptions.h index 45575ba450..ee3af0873a 100644 --- a/cpp/src/tests/TestOptions.h +++ b/cpp/src/tests/TestOptions.h @@ -21,46 +21,35 @@ * */ -#include "qpid/CommonOptions.h" +#include "qpid/Options.h" +#include "qpid/Url.h" namespace qpid { -struct TestOptions : public qpid::CommonOptions +struct TestOptions : public qpid::Options { - TestOptions() : desc("Options"), broker("localhost"), virtualhost(""), clientid("cpp"), help(false) + TestOptions() : Options("Test Options"), host("localhost"), port(TcpAddress::DEFAULT_PORT), clientid("cpp"), trace(false), help(false) { - using namespace qpid::program_options; - using namespace boost::program_options; - CommonOptions::addTo(desc); - desc.add_options() - ("broker,b", optValue(broker, "HOSTNAME"), "the hostname to connect to") - ("virtualhost,v", optValue(virtualhost, "VIRTUAL_HOST"), "virtual host") + 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") - ("help,h", optValue(help), "print this usage statement"); + ("username", optValue(username, "USER"), "user name for broker log in.") + ("password", optValue(password, "USER"), "password for broker log in.") + ("trace,t", optValue(trace), "Turn on debug tracing.") + ("help", optValue(help), "print this usage statement"); } - void parse(int argc, char** argv) - { - using namespace boost::program_options; - try { - variables_map vm; - store(parse_command_line(argc, argv, desc), vm); - notify(vm); - } catch(const error& e) { - std::cerr << "Error: " << e.what() << std::endl - << "Specify '--help' for usage." << std::endl; - } - } - - void usage() - { - std::cout << desc << std::endl; - } - - boost::program_options::options_description desc; - std::string broker; + std::string host; + uint16_t port; std::string virtualhost; - std::string clientid; + std::string clientid; + std::string username; + std::string password; + bool trace; bool help; }; |
