diff options
author | Jose <jose@zeroc.com> | 2018-08-06 11:56:42 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2018-08-06 11:56:42 +0200 |
commit | 7972f07a3aa244dcde673b7cb5541e70da9193bb (patch) | |
tree | 117faced1bb36ac256c7d362e11ac1c49e8e8c88 /python/test/Ice/optional/Server.py | |
parent | Update JavaScript tests to use TestHelper class (diff) | |
download | ice-7972f07a3aa244dcde673b7cb5541e70da9193bb.tar.bz2 ice-7972f07a3aa244dcde673b7cb5541e70da9193bb.tar.xz ice-7972f07a3aa244dcde673b7cb5541e70da9193bb.zip |
Python test suite updates
Diffstat (limited to 'python/test/Ice/optional/Server.py')
-rwxr-xr-x | python/test/Ice/optional/Server.py | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/python/test/Ice/optional/Server.py b/python/test/Ice/optional/Server.py index e97ec1b44bc..b6856bed6f6 100755 --- a/python/test/Ice/optional/Server.py +++ b/python/test/Ice/optional/Server.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): @@ -186,21 +186,15 @@ class InitialI(Test.Initial): def supportsNullOptional(self, current=None): return 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 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): + 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() |