summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/echo/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/echo/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/echo/Server.cpp')
-rw-r--r--cpp/test/Ice/echo/Server.cpp49
1 files changed, 14 insertions, 35 deletions
diff --git a/cpp/test/Ice/echo/Server.cpp b/cpp/test/Ice/echo/Server.cpp
index 6ff9d6e8466..b701a9ab055 100644
--- a/cpp/test/Ice/echo/Server.cpp
+++ b/cpp/test/Ice/echo/Server.cpp
@@ -8,12 +8,10 @@
// **********************************************************************
#include <Ice/Ice.h>
-#include <TestCommon.h>
+#include <TestHelper.h>
#include <BlobjectI.h>
#include <Test.h>
-DEFINE_TEST("server")
-
using namespace std;
class EchoI : public Test::Echo
@@ -50,44 +48,25 @@ private:
BlobjectIPtr _blob;
};
-int
-run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
+class Server : public Test::TestHelper
+{
+public:
+
+ void run(int, char**);
+};
+
+void
+Server::run(int argc, char** argv)
{
- communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0));
+ Ice::CommunicatorHolder communicator = initialize(argc, argv);
+ communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint());
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
BlobjectIPtr blob = ICE_MAKE_SHARED(BlobjectI);
adapter->addDefaultServant(blob, "");
adapter->add(ICE_MAKE_SHARED(EchoI, blob), Ice::stringToIdentity("__echo"));
adapter->activate();
-
- TEST_READY
-
+ serverReady();
communicator->waitForShutdown();
- return EXIT_SUCCESS;
}
-int
-main(int argc, char* argv[])
-{
- int status;
- Ice::CommunicatorPtr communicator;
-
- try
- {
- Ice::InitializationData initData = getTestInitData(argc, argv);
- communicator = Ice::initialize(argc, argv, initData);
- status = run(argc, argv, communicator);
- }
- catch(const Ice::Exception& ex)
- {
- cerr << ex << endl;
- status = EXIT_FAILURE;
- }
-
- if(communicator)
- {
- communicator->destroy();
- }
-
- return status;
-}
+DEFINE_TEST(Server)