summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/exceptions/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/exceptions/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/exceptions/Server.cpp')
-rw-r--r--cpp/test/Ice/exceptions/Server.cpp57
1 files changed, 22 insertions, 35 deletions
diff --git a/cpp/test/Ice/exceptions/Server.cpp b/cpp/test/Ice/exceptions/Server.cpp
index 2bc9ddc2fbc..e70f58f0c93 100644
--- a/cpp/test/Ice/exceptions/Server.cpp
+++ b/cpp/test/Ice/exceptions/Server.cpp
@@ -8,20 +8,32 @@
// **********************************************************************
#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("TestAdapter2.Endpoints", getTestEndpoint(communicator, 1));
+public:
+
+ void run(int, char**);
+};
+
+void
+Server::run(int argc, char** argv)
+{
+ Ice::PropertiesPtr properties = createTestProperties(argc, argv);
+ properties->setProperty("Ice.Warn.Dispatch", "0");
+ properties->setProperty("Ice.Warn.Connections", "0");
+ properties->setProperty("Ice.MessageSizeMax", "10"); // 10KB max
+
+ Ice::CommunicatorHolder communicator = initialize(argc, argv, properties);
+
+ communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint());
+ communicator->getProperties()->setProperty("TestAdapter2.Endpoints", getTestEndpoint(1));
communicator->getProperties()->setProperty("TestAdapter2.MessageSizeMax", "0");
- communicator->getProperties()->setProperty("TestAdapter3.Endpoints", getTestEndpoint(communicator, 2));
+ communicator->getProperties()->setProperty("TestAdapter3.Endpoints", getTestEndpoint(2));
communicator->getProperties()->setProperty("TestAdapter3.MessageSizeMax", "1");
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
Ice::ObjectAdapterPtr adapter2 = communicator->createObjectAdapter("TestAdapter2");
@@ -33,33 +45,8 @@ run(int, char**, const Ice::CommunicatorPtr& communicator)
adapter->activate();
adapter2->activate();
adapter3->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);
- initData.properties->setProperty("Ice.Warn.Dispatch", "0");
- initData.properties->setProperty("Ice.Warn.Connections", "0");
- initData.properties->setProperty("Ice.MessageSizeMax", "10"); // 10KB max
-
- 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)