diff options
Diffstat (limited to 'cpp/test/Ice/impl/ServerAMD.cpp')
-rw-r--r-- | cpp/test/Ice/impl/ServerAMD.cpp | 58 |
1 files changed, 21 insertions, 37 deletions
diff --git a/cpp/test/Ice/impl/ServerAMD.cpp b/cpp/test/Ice/impl/ServerAMD.cpp index 20a515955f2..b114fb11e85 100644 --- a/cpp/test/Ice/impl/ServerAMD.cpp +++ b/cpp/test/Ice/impl/ServerAMD.cpp @@ -8,52 +8,36 @@ // ********************************************************************** #include <Ice/Ice.h> -#include <TestCommon.h> +#include <TestHelper.h> #include <TestAMDI.h> -DEFINE_TEST("serveramd") - using namespace std; using namespace Test; -int -run(int, char**, const Ice::CommunicatorPtr& communicator) +class ServerAMD : public Test::TestHelper +{ +public: + + void run(int, char**); +}; + +void +ServerAMD::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(ServerAMD) |