summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/threadPoolPriority/ServerCustomThreadPool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/test/Ice/threadPoolPriority/ServerCustomThreadPool.cpp')
-rw-r--r--cpp/test/Ice/threadPoolPriority/ServerCustomThreadPool.cpp48
1 files changed, 13 insertions, 35 deletions
diff --git a/cpp/test/Ice/threadPoolPriority/ServerCustomThreadPool.cpp b/cpp/test/Ice/threadPoolPriority/ServerCustomThreadPool.cpp
index 6bc8672c32d..863c4e3e391 100644
--- a/cpp/test/Ice/threadPoolPriority/ServerCustomThreadPool.cpp
+++ b/cpp/test/Ice/threadPoolPriority/ServerCustomThreadPool.cpp
@@ -9,16 +9,24 @@
#include <Ice/Ice.h>
#include <TestI.h>
-#include <TestCommon.h>
+#include <TestHelper.h>
using namespace std;
-int
-run(int, char**, const Ice::CommunicatorPtr& communicator)
+class ServerCustomThreadPool : public Test::TestHelper
{
+public:
+
+ void run(int, char**);
+};
+
+void
+ServerCustomThreadPool::run(int argc, char** argv)
+{
+ Ice::CommunicatorHolder communicator = initialize(argc, argv);
Ice::PropertiesPtr properties = communicator->getProperties();
properties->setProperty("Ice.Warn.Dispatch", "0");
- communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0) + " -t 10000");
+ communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint() + " -t 10000");
communicator->getProperties()->setProperty("TestAdapter.ThreadPool.Size", "1");
//
@@ -55,36 +63,6 @@ run(int, char**, const Ice::CommunicatorPtr& communicator)
adapter->add(object, Ice::stringToIdentity("test"));
adapter->activate();
communicator->waitForShutdown();
- return EXIT_SUCCESS;
}
-int
-main(int argc, char* argv[])
-{
-#ifdef ICE_STATIC_LIBS
- Ice::registerIceSSL(false);
- Ice::registerIceWS(true);
-#endif
-
- 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(ServerCustomThreadPool)