summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/impl/Server.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2018-06-01 17:41:03 +0200
committerJose <jose@zeroc.com>2018-06-01 17:41:03 +0200
commitcbe92e540a7f02f0bdf93192424bd119189365b7 (patch)
tree411c50dc0ae9c669d31a940b1b4903b5deac4f12 /cpp/test/Ice/impl/Server.cpp
parentFixed Util.py check for binary installation directory on Windows (diff)
downloadice-cbe92e540a7f02f0bdf93192424bd119189365b7.tar.bz2
ice-cbe92e540a7f02f0bdf93192424bd119189365b7.tar.xz
ice-cbe92e540a7f02f0bdf93192424bd119189365b7.zip
Do not use Ice::Application for Ice testsuite
Diffstat (limited to 'cpp/test/Ice/impl/Server.cpp')
-rw-r--r--cpp/test/Ice/impl/Server.cpp58
1 files changed, 21 insertions, 37 deletions
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 <Ice/Ice.h>
-#include <TestCommon.h>
+#include <TestHelper.h>
#include <TestI.h>
-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)