diff options
author | Jose <jose@zeroc.com> | 2018-06-01 17:41:03 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2018-06-01 17:41:03 +0200 |
commit | cbe92e540a7f02f0bdf93192424bd119189365b7 (patch) | |
tree | 411c50dc0ae9c669d31a940b1b4903b5deac4f12 /cpp/test/IceGrid/distribution/Server.cpp | |
parent | Fixed Util.py check for binary installation directory on Windows (diff) | |
download | ice-cbe92e540a7f02f0bdf93192424bd119189365b7.tar.bz2 ice-cbe92e540a7f02f0bdf93192424bd119189365b7.tar.xz ice-cbe92e540a7f02f0bdf93192424bd119189365b7.zip |
Do not use Ice::Application for Ice testsuite
Diffstat (limited to 'cpp/test/IceGrid/distribution/Server.cpp')
-rw-r--r-- | cpp/test/IceGrid/distribution/Server.cpp | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/cpp/test/IceGrid/distribution/Server.cpp b/cpp/test/IceGrid/distribution/Server.cpp index 4d4c26923d0..da0d90a9430 100644 --- a/cpp/test/IceGrid/distribution/Server.cpp +++ b/cpp/test/IceGrid/distribution/Server.cpp @@ -9,33 +9,27 @@ #include <Ice/Ice.h> #include <TestI.h> -#include <TestCommon.h> +#include <TestHelper.h> using namespace std; -class Server : public Ice::Application +class Server : public Test::TestHelper { public: - virtual int run(int argc, char* argv[]); + void run(int, char**); }; -int -Server::run(int argc, char* argv[]) +void +Server::run(int argc, char** argv) { - Ice::PropertiesPtr properties = communicator()->getProperties(); - - Ice::StringSeq args = Ice::argsToStringSeq(argc, argv); - args = properties->parseCommandLineOptions("Test", args); - Ice::stringSeqToArgs(args, argc, argv); - + Ice::CommunicatorHolder communicator = initialize(argc, argv); + Ice::PropertiesPtr properties = communicator->getProperties(); string name = properties->getProperty("Ice.ProgramName"); - - Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Server"); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("Server"); Ice::ObjectPtr object = new TestI(properties); adapter->add(object, Ice::stringToIdentity(name)); - shutdownOnInterrupt(); try { adapter->activate(); @@ -43,15 +37,7 @@ Server::run(int argc, char* argv[]) catch(const Ice::ObjectAdapterDeactivatedException&) { } - communicator()->waitForShutdown(); - ignoreInterrupt(); - return EXIT_SUCCESS; + communicator->waitForShutdown(); } -int -main(int argc, char* argv[]) -{ - Server app; - int rc = app.main(argc, argv); - return rc; -} +DEFINE_TEST(Server) |