summaryrefslogtreecommitdiff
path: root/python/test/Glacier2/application/Server.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/test/Glacier2/application/Server.py')
-rw-r--r--python/test/Glacier2/application/Server.py31
1 files changed, 15 insertions, 16 deletions
diff --git a/python/test/Glacier2/application/Server.py b/python/test/Glacier2/application/Server.py
index 4de00da98b2..7b32c1689b9 100644
--- a/python/test/Glacier2/application/Server.py
+++ b/python/test/Glacier2/application/Server.py
@@ -8,10 +8,12 @@
#
# **********************************************************************
-import os, sys, traceback, Ice
-Ice.loadSlice('Callback.ice')
+from TestHelper import TestHelper
+TestHelper.loadSlice('Callback.ice')
+import Ice
import Test
+
class CallbackI(Test.Callback):
def initiateCallback(self, proxy, current):
@@ -20,19 +22,16 @@ class CallbackI(Test.Callback):
def shutdown(self, current):
current.adapter.getCommunicator().shutdown()
-class Server(Ice.Application):
+
+class Server(TestHelper):
def run(self, args):
- self.communicator().getProperties().setProperty("DeactivatedAdapter.Endpoints", "default -p 12011")
- self.communicator().createObjectAdapter("DeactivatedAdapter")
-
- self.communicator().getProperties().setProperty("CallbackAdapter.Endpoints", "default -p 12010")
- adapter = self.communicator().createObjectAdapter("CallbackAdapter")
- adapter.add(CallbackI(), Ice.stringToIdentity("callback"))
- adapter.activate()
- self.communicator().waitForShutdown()
- return 0
-
-app = Server()
-status = app.main(sys.argv)
-sys.exit(status)
+ with self.initialize(args=args) as communicator:
+ communicator.getProperties().setProperty("DeactivatedAdapter.Endpoints", "default -p 12011")
+ communicator.createObjectAdapter("DeactivatedAdapter")
+
+ communicator.getProperties().setProperty("CallbackAdapter.Endpoints", "default -p 12010")
+ adapter = communicator.createObjectAdapter("CallbackAdapter")
+ adapter.add(CallbackI(), Ice.stringToIdentity("callback"))
+ adapter.activate()
+ communicator.waitForShutdown()