summaryrefslogtreecommitdiff
path: root/python/test/Ice/packagemd/Server.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/test/Ice/packagemd/Server.py')
-rwxr-xr-xpython/test/Ice/packagemd/Server.py34
1 files changed, 15 insertions, 19 deletions
diff --git a/python/test/Ice/packagemd/Server.py b/python/test/Ice/packagemd/Server.py
index 324c881ae58..04aae06b2f0 100755
--- a/python/test/Ice/packagemd/Server.py
+++ b/python/test/Ice/packagemd/Server.py
@@ -8,11 +8,14 @@
#
# **********************************************************************
-import os, sys, traceback
-
+from TestHelper import TestHelper
+TestHelper.loadSlice('--all -I. Test.ice')
+import Test
+import Test1
+import testpkg
+import modpkg
import Ice
-Ice.loadSlice('--all -I. Test.ice')
-import Test, Test1, testpkg, modpkg
+
class InitialI(Test.Initial):
@@ -67,21 +70,14 @@ class InitialI(Test.Initial):
def shutdown(self, current):
current.adapter.getCommunicator().shutdown()
-def run(args, communicator):
- communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010")
- adapter = communicator.createObjectAdapter("TestAdapter")
- initial = InitialI()
- adapter.add(initial, Ice.stringToIdentity("initial"))
- adapter.activate()
- communicator.waitForShutdown()
- return True
+class Server(TestHelper):
-try:
- with Ice.initialize(sys.argv) as communicator:
- status = run(sys.argv, communicator)
-except:
- traceback.print_exc()
- status = False
+ def run(self, args):
-sys.exit(not status)
+ with self.initialize(args=args) as communicator:
+ communicator.getProperties().setProperty("TestAdapter.Endpoints", self.getTestEndpoint())
+ adapter = communicator.createObjectAdapter("TestAdapter")
+ adapter.add(InitialI(), Ice.stringToIdentity("initial"))
+ adapter.activate()
+ communicator.waitForShutdown()