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/Ice/ami/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/Ice/ami/Server.cpp')
-rw-r--r-- | cpp/test/Ice/ami/Server.cpp | 69 |
1 files changed, 28 insertions, 41 deletions
diff --git a/cpp/test/Ice/ami/Server.cpp b/cpp/test/Ice/ami/Server.cpp index 1e477a22831..abeaed2d6d5 100644 --- a/cpp/test/Ice/ami/Server.cpp +++ b/cpp/test/Ice/ami/Server.cpp @@ -8,18 +8,37 @@ // ********************************************************************** #include <Ice/Ice.h> -#include <TestCommon.h> +#include <TestHelper.h> #include <TestI.h> -DEFINE_TEST("server") - using namespace std; -int -run(int, char**, const Ice::CommunicatorPtr& communicator) +class Server : public Test::TestHelper { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); - communicator->getProperties()->setProperty("ControllerAdapter.Endpoints", getTestEndpoint(communicator, 1)); +public: + + void run(int, char**); +}; + +void +Server::run(int argc, char** argv) +{ + Ice::PropertiesPtr properties = createTestProperties(argc, argv); + // + // This test kills connections, so we don't want warnings. + // + properties->setProperty("Ice.Warn.Connections", "0"); + + // + // Limit the recv buffer size, this test relies on the socket + // send() blocking after sending a given amount of data. + // + properties->setProperty("Ice.TCP.RcvSize", "50000"); + + Ice::CommunicatorHolder communicator = initialize(argc, argv, properties); + + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint()); + communicator->getProperties()->setProperty("ControllerAdapter.Endpoints", getTestEndpoint(1)); communicator->getProperties()->setProperty("ControllerAdapter.ThreadPool.Size", "1"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); @@ -34,41 +53,9 @@ run(int, char**, const Ice::CommunicatorPtr& communicator) adapter2->add(testController, Ice::stringToIdentity("testController")); adapter2->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); -#endif - - try - { - Ice::InitializationData initData = getTestInitData(argc, argv); - - // - // This test kills connections, so we don't want warnings. - // - initData.properties->setProperty("Ice.Warn.Connections", "0"); - - // - // Limit the recv buffer size, this test relies on the socket - // send() blocking after sending a given amount of data. - // - initData.properties->setProperty("Ice.TCP.RcvSize", "50000"); - - 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) |