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/ami/Collocated.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/ami/Collocated.py')
-rwxr-xr-x | python/test/Ice/ami/Collocated.py | 63 |
1 files changed, 25 insertions, 38 deletions
diff --git a/python/test/Ice/ami/Collocated.py b/python/test/Ice/ami/Collocated.py index e87e3ac7ea5..0b449be5866 100755 --- a/python/test/Ice/ami/Collocated.py +++ b/python/test/Ice/ami/Collocated.py @@ -8,53 +8,40 @@ # # ********************************************************************** -import os, sys, traceback - +from TestHelper import TestHelper +TestHelper.loadSlice("Test.ice") +import AllTests +import TestI 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') -import Test, TestI, AllTests - -def run(args, communicator): - communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010") - communicator.getProperties().setProperty("ControllerAdapter.Endpoints", "default -p 12011") - communicator.getProperties().setProperty("ControllerAdapter.ThreadPool.Size", "1") - adapter = communicator.createObjectAdapter("TestAdapter") - adapter2 = communicator.createObjectAdapter("ControllerAdapter") - testController = TestI.TestIntfControllerI(adapter) +class Collocated(TestHelper): - adapter.add(TestI.TestIntfI(), Ice.stringToIdentity("test")) - adapter.add(TestI.TestIntfII(), Ice.stringToIdentity("test2")) - #adapter.activate() # Collocated test doesn't need to active the OA + def run(self, args): - adapter2.add(testController, Ice.stringToIdentity("testController")) - #adapter2.activate() # Collocated test doesn't need to active the OA + properties = self.createTestProperties(args) + properties.setProperty("Ice.Warn.AMICallback", "0") + # + # This test kills connections, so we don't want warnings. + # + properties.setProperty("Ice.Warn.Connections", "0") - AllTests.allTests(communicator, True) + with self.initialize(properties=properties) as communicator: - return True + communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010") + communicator.getProperties().setProperty("ControllerAdapter.Endpoints", "default -p 12011") + communicator.getProperties().setProperty("ControllerAdapter.ThreadPool.Size", "1") -try: - initData = Ice.InitializationData() - initData.properties = Ice.createProperties(sys.argv) + adapter = communicator.createObjectAdapter("TestAdapter") + adapter2 = communicator.createObjectAdapter("ControllerAdapter") - initData.properties.setProperty("Ice.Warn.AMICallback", "0"); + testController = TestI.TestIntfControllerI(adapter) - # - # This test kills connections, so we don't want warnings. - # - initData.properties.setProperty("Ice.Warn.Connections", "0"); + adapter.add(TestI.TestIntfI(), Ice.stringToIdentity("test")) + adapter.add(TestI.TestIntfII(), Ice.stringToIdentity("test2")) + # adapter.activate() # Collocated test doesn't need to active the OA - with Ice.initialize(sys.argv, initData) as communicator: - status = run(sys.argv, communicator) -except: - traceback.print_exc() - status = False + adapter2.add(testController, Ice.stringToIdentity("testController")) + # adapter2.activate() # Collocated test doesn't need to active the OA -sys.exit(not status) + AllTests.allTests(self, communicator, True) |