diff options
Diffstat (limited to 'python/test/Ice/operations/Client.py')
-rwxr-xr-x | python/test/Ice/operations/Client.py | 59 |
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() |