summaryrefslogtreecommitdiff
path: root/cpp/test/IceGrid/allocation/Server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/test/IceGrid/allocation/Server.cpp')
-rw-r--r--cpp/test/IceGrid/allocation/Server.cpp32
1 files changed, 10 insertions, 22 deletions
diff --git a/cpp/test/IceGrid/allocation/Server.cpp b/cpp/test/IceGrid/allocation/Server.cpp
index 7c2f72c1b22..b4dee3f13b1 100644
--- a/cpp/test/IceGrid/allocation/Server.cpp
+++ b/cpp/test/IceGrid/allocation/Server.cpp
@@ -9,29 +9,26 @@
#include <Ice/Ice.h>
#include <TestI.h>
-#include <TestCommon.h>
+#include <TestHelper.h>
using namespace std;
-class Server : public Ice::Application
+class Server : public Test::TestHelper
{
public:
- virtual int run(int argc, char* argv[]);
+ void run(int, char**);
};
-int
-Server::run(int argc, char* argv[])
+void
+Server::run(int argc, char** argv)
{
- Ice::PropertiesPtr properties = communicator()->getProperties();
-
- Ice::StringSeq args = Ice::argsToStringSeq(argc, argv);
- args = properties->parseCommandLineOptions("Test", args);
- Ice::stringSeqToArgs(args, argc, argv);
+ Ice::CommunicatorHolder communicator = initialize(argc, argv);
+ Ice::PropertiesPtr properties = communicator->getProperties();
string name = properties->getProperty("Ice.ProgramName");
- Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Server");
+ Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("Server");
adapter->add(new TestI(properties), Ice::stringToIdentity("allocatable"));
adapter->add(new TestI(properties), Ice::stringToIdentity("nonallocatable"));
adapter->add(new TestI(properties), Ice::stringToIdentity("allocatable1"));
@@ -43,7 +40,6 @@ Server::run(int argc, char* argv[])
adapter->add(new TestI(properties), Ice::stringToIdentity("allocatable31"));
adapter->add(new TestI(properties), Ice::stringToIdentity("allocatable41"));
- shutdownOnInterrupt();
try
{
adapter->activate();
@@ -51,15 +47,7 @@ Server::run(int argc, char* argv[])
catch(const Ice::ObjectAdapterDeactivatedException&)
{
}
- communicator()->waitForShutdown();
- ignoreInterrupt();
- return EXIT_SUCCESS;
+ communicator->waitForShutdown();
}
-int
-main(int argc, char* argv[])
-{
- Server app;
- int rc = app.main(argc, argv);
- return rc;
-}
+DEFINE_TEST(Server)