summaryrefslogtreecommitdiff
path: root/python/test/Ice/slicing/exceptions/ServerAMD.py
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2018-08-06 11:56:42 +0200
committerJose <jose@zeroc.com>2018-08-06 11:56:42 +0200
commit7972f07a3aa244dcde673b7cb5541e70da9193bb (patch)
tree117faced1bb36ac256c7d362e11ac1c49e8e8c88 /python/test/Ice/slicing/exceptions/ServerAMD.py
parentUpdate JavaScript tests to use TestHelper class (diff)
downloadice-7972f07a3aa244dcde673b7cb5541e70da9193bb.tar.bz2
ice-7972f07a3aa244dcde673b7cb5541e70da9193bb.tar.xz
ice-7972f07a3aa244dcde673b7cb5541e70da9193bb.zip
Python test suite updates
Diffstat (limited to 'python/test/Ice/slicing/exceptions/ServerAMD.py')
-rwxr-xr-xpython/test/Ice/slicing/exceptions/ServerAMD.py44
1 files changed, 22 insertions, 22 deletions
diff --git a/python/test/Ice/slicing/exceptions/ServerAMD.py b/python/test/Ice/slicing/exceptions/ServerAMD.py
index 73ab20b8eaa..f497895516d 100755
--- a/python/test/Ice/slicing/exceptions/ServerAMD.py
+++ b/python/test/Ice/slicing/exceptions/ServerAMD.py
@@ -8,13 +8,19 @@
#
# **********************************************************************
-import os, sys, traceback
-
+from TestHelper import TestHelper
+TestHelper.loadSlice("-I. --all ServerPrivate.ice")
import Ice
-Ice.loadSlice('-I. --all ServerPrivate.ice')
import Test
+
+def test(b):
+ if not b:
+ raise RuntimeError('test assertion failed')
+
+
class TestI(Test.TestIntf):
+
def shutdown(self, current=None):
current.adapter.getCommunicator().shutdown()
@@ -216,22 +222,16 @@ class TestI(Test.TestIntf):
f.set_exception(ex)
return f
-def run(args, communicator):
- properties = communicator.getProperties()
- properties.setProperty("Ice.Warn.Dispatch", "0")
- properties.setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000")
- adapter = communicator.createObjectAdapter("TestAdapter")
- object = TestI()
- adapter.add(object, Ice.stringToIdentity("Test"))
- adapter.activate()
- communicator.waitForShutdown()
- return True
-
-try:
- with Ice.initialize(sys.argv) as communicator:
- status = run(sys.argv, communicator)
-except:
- traceback.print_exc()
- status = False
-
-sys.exit(not status)
+
+class ServerAMD(TestHelper):
+
+ def run(self, args):
+ properties = self.createTestProperties(args)
+ properties.setProperty("Ice.Warn.Dispatch", "0")
+ with self.initialize(properties=properties) as communicator:
+ communicator.getProperties().setProperty("TestAdapter.Endpoints",
+ "{0} -t 10000".format(self.getTestEndpoint()))
+ adapter = communicator.createObjectAdapter("TestAdapter")
+ adapter.add(TestI(), Ice.stringToIdentity("Test"))
+ adapter.activate()
+ communicator.waitForShutdown()