From cbe92e540a7f02f0bdf93192424bd119189365b7 Mon Sep 17 00:00:00 2001 From: Jose Date: Fri, 1 Jun 2018 17:41:03 +0200 Subject: Do not use Ice::Application for Ice testsuite --- cpp/test/Ice/impl/Server.cpp | 58 ++++++++++++++++---------------------------- 1 file changed, 21 insertions(+), 37 deletions(-) (limited to 'cpp/test/Ice/impl/Server.cpp') diff --git a/cpp/test/Ice/impl/Server.cpp b/cpp/test/Ice/impl/Server.cpp index c84232fa665..a9ea324a433 100644 --- a/cpp/test/Ice/impl/Server.cpp +++ b/cpp/test/Ice/impl/Server.cpp @@ -8,52 +8,36 @@ // ********************************************************************** #include -#include +#include #include -DEFINE_TEST("server") - using namespace std; using namespace Test; -int -run(int, char**, const Ice::CommunicatorPtr& communicator) +class Server : public Test::TestHelper +{ +public: + + void run(int, char**); +}; + +void +Server::run(int argc, char** argv) { - string endpt = getTestEndpoint(communicator, 0); - communicator->getProperties()->setProperty("TestAdapter.Endpoints", endpt); + Ice::PropertiesPtr properties = createTestProperties(argc, argv); + // + // Its possible to have batch oneway requests dispatched after + // the adapter is deactivated due to thread scheduling so we + // supress this warning. + // + properties->setProperty("Ice.Warn.Dispatch", "0"); + Ice::CommunicatorHolder communicator = initialize(argc, argv); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint()); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); adapter->add(ICE_MAKE_SHARED(MyDerivedClassI), Ice::stringToIdentity("test")); adapter->activate(); - TEST_READY + serverReady(); communicator->waitForShutdown(); - return EXIT_SUCCESS; } -int -main(int argc, char* argv[]) -{ -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(false); - Ice::registerIceWS(true); - Ice::registerIceUDP(true); -#endif - - try - { - Ice::InitializationData initData = getTestInitData(argc, argv); - // - // Its possible to have batch oneway requests dispatched after - // the adapter is deactivated due to thread scheduling so we - // supress this warning. - // - initData.properties->setProperty("Ice.Warn.Dispatch", "0"); - - Ice::CommunicatorHolder ich(argc, argv, initData); - return run(argc, argv, ich.communicator()); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - return EXIT_FAILURE; - } -} +DEFINE_TEST(Server) -- cgit v1.2.3