diff options
Diffstat (limited to 'python/test/Ice/optional/ServerAMD.py')
-rwxr-xr-x | python/test/Ice/optional/ServerAMD.py | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/python/test/Ice/optional/ServerAMD.py b/python/test/Ice/optional/ServerAMD.py index c09a6843f42..f154cce322b 100755 --- a/python/test/Ice/optional/ServerAMD.py +++ b/python/test/Ice/optional/ServerAMD.py @@ -8,12 +8,12 @@ # # ********************************************************************** -import os, sys, traceback - +from TestHelper import TestHelper +TestHelper.loadSlice("Test.ice") import Ice -Ice.loadSlice('Test.ice') import Test + class InitialI(Test.Initial): def shutdown(self, current=None): @@ -192,21 +192,15 @@ class InitialI(Test.Initial): def supportsNullOptional(self, current=None): return Ice.Future.completed(True) -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 ServerAMD(TestHelper): -try: - with Ice.initialize(sys.argv) as communicator: - status = run(sys.argv, communicator) -except: - traceback.print_exc() - status = False + def run(self, args): + with self.initialize(args=args) as communicator: + communicator.getProperties().setProperty("TestAdapter.Endpoints", self.getTestEndpoint()) + adapter = communicator.createObjectAdapter("TestAdapter") + initial = InitialI() + adapter.add(initial, Ice.stringToIdentity("initial")) + adapter.activate() -sys.exit(not status) + communicator.waitForShutdown() |