summaryrefslogtreecommitdiff
path: root/python/test/Ice/operations/Client.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/operations/Client.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/operations/Client.py')
-rwxr-xr-xpython/test/Ice/operations/Client.py59
1 files changed, 13 insertions, 46 deletions
diff --git a/python/test/Ice/operations/Client.py b/python/test/Ice/operations/Client.py
index 0cec40edbd9..9835a2ccac9 100755
--- a/python/test/Ice/operations/Client.py
+++ b/python/test/Ice/operations/Client.py
@@ -8,54 +8,21 @@
#
# **********************************************************************
-import os, sys, traceback
-import Ice
-
-import Ice
-slice_dir = Ice.getSliceDir()
-if not slice_dir:
- print(sys.argv[0] + ': Slice directory not found.')
- sys.exit(1)
-
-Ice.loadSlice("'-I" + slice_dir + "' Test.ice")
+from TestHelper import TestHelper
+TestHelper.loadSlice("Test.ice")
import AllTests
-def test(b):
- if not b:
- raise RuntimeError('test assertion failed')
-
-def run(args, communicator):
- myClass = AllTests.allTests(communicator)
-
- sys.stdout.write("testing server shutdown... ")
- sys.stdout.flush()
- myClass.shutdown()
- try:
- myClass.ice_timeout(100).ice_ping(); # Use timeout to speed up testing on Windows
- test(False)
- except Ice.LocalException:
- print("ok")
-
- return True
-try:
- #
- # In this test, we need at least two threads in the
- # client side thread pool for nested AMI.
- #
- initData = Ice.InitializationData()
- initData.properties = Ice.createProperties(sys.argv)
- initData.properties.setProperty('Ice.ThreadPool.Client.Size', '2')
- initData.properties.setProperty('Ice.ThreadPool.Client.SizeWarn', '0')
- initData.properties.setProperty("Ice.BatchAutoFlushSize", "100")
+class Client(TestHelper):
- with Ice.initialize(sys.argv, initData) as communicator:
- status = run(sys.argv, communicator)
- # Test multiple destroy calls
- communicator.destroy()
- communicator.destroy()
-except:
- traceback.print_exc()
- status = False
+ def run(self, args):
+ properties = self.createTestProperties(args)
+ properties.setProperty('Ice.ThreadPool.Client.Size', '2')
+ properties.setProperty('Ice.ThreadPool.Client.SizeWarn', '0')
+ properties.setProperty("Ice.BatchAutoFlushSize", "100")
-sys.exit(not status)
+ with self.initialize(properties=properties) as communicator:
+ AllTests.allTests(self, communicator)
+ # Test multiple destroy calls
+ communicator.destroy()
+ communicator.destroy()