diff options
66 files changed, 161 insertions, 177 deletions
diff --git a/js/test/Common/TestHelper.js b/js/test/Common/TestHelper.js index 7f51e743fb3..b577c9ad2a6 100644 --- a/js/test/Common/TestHelper.js +++ b/js/test/Common/TestHelper.js @@ -109,8 +109,8 @@ createTestProperties(args = []) { const properties = Ice.createProperties(args); - properties.parseCommandLineOptions("Test", args); - return properties; + args = properties.parseCommandLineOptions("Test", args); + return [properties, args]; } initialize(...args) @@ -129,7 +129,7 @@ } else { - initData.properties = this.createTestProperties(args[0]); + [initData.properties, args[0]] = this.createTestProperties(args[0]); } } @@ -138,7 +138,7 @@ { this._communicator = communicator; } - return communicator; + return [communicator, args[0]]; } communicator() diff --git a/js/test/Glacier2/router/Client.js b/js/test/Glacier2/router/Client.js index bc12efb97ce..e970b909118 100644 --- a/js/test/Glacier2/router/Client.js +++ b/js/test/Glacier2/router/Client.js @@ -317,10 +317,10 @@ let communicator; try { - const properties = this.createTestProperties(args); + const [properties] = this.createTestProperties(args); properties.setProperty("Ice.Warn.Dispatch", "1"); properties.setProperty("Ice.Warn.Connections", "0"); - communicator = this.initialize(properties); + [communicator] = this.initialize(properties); await this.allTests(args.indexOf("--shutdown") > -1); } finally diff --git a/js/test/Ice/acm/Client.js b/js/test/Ice/acm/Client.js index a24d0b5ae88..03186ac81ad 100644 --- a/js/test/Ice/acm/Client.js +++ b/js/test/Ice/acm/Client.js @@ -510,7 +510,7 @@ let communicator; try { - communicator = this.initialize(args); + [communicator, args] = this.initialize(args); await this.allTests(); } finally diff --git a/js/test/Ice/adapterDeactivation/Client.js b/js/test/Ice/adapterDeactivation/Client.js index dd738edcf10..acb5a4a48d2 100644 --- a/js/test/Ice/adapterDeactivation/Client.js +++ b/js/test/Ice/adapterDeactivation/Client.js @@ -227,7 +227,7 @@ let communicator; try { - communicator = this.initialize(args); + [communicator, args] = this.initialize(args); await this.allTests(); } finally diff --git a/js/test/Ice/ami/Client.js b/js/test/Ice/ami/Client.js index cd85473b836..f86ce217baa 100644 --- a/js/test/Ice/ami/Client.js +++ b/js/test/Ice/ami/Client.js @@ -326,7 +326,7 @@ let communicator; try { - communicator = this.initialize(args); + [communicator, args] = this.initialize(args); await this.allTests(); } finally diff --git a/js/test/Ice/binding/Client.js b/js/test/Ice/binding/Client.js index ed7a881c98f..a5950a242ef 100644 --- a/js/test/Ice/binding/Client.js +++ b/js/test/Ice/binding/Client.js @@ -90,7 +90,7 @@ out.writeLine("ok"); await communicator.destroy(); - communicator = this.initialize(properties); + [communicator] = this.initialize(properties); com = Test.RemoteCommunicatorPrx.uncheckedCast(communicator.stringToProxy(ref)); out.write("testing binding with multiple endpoints... "); @@ -198,7 +198,7 @@ out.writeLine("ok"); await communicator.destroy(); - communicator = this.initialize(properties); + [communicator] = this.initialize(properties); com = Test.RemoteCommunicatorPrx.uncheckedCast(communicator.stringToProxy(ref)); // @@ -297,7 +297,7 @@ } await communicator.destroy(); - communicator = this.initialize(properties); + [communicator] = this.initialize(properties); com = Test.RemoteCommunicatorPrx.uncheckedCast(communicator.stringToProxy(ref)); out.write("testing random endpoint selection... "); @@ -344,7 +344,7 @@ out.writeLine("ok"); await communicator.destroy(); - communicator = this.initialize(properties); + [communicator] = this.initialize(properties); com = Test.RemoteCommunicatorPrx.uncheckedCast(communicator.stringToProxy(ref)); out.write("testing ordered endpoint selection... "); @@ -417,7 +417,7 @@ out.writeLine("ok"); await communicator.destroy(); - communicator = this.initialize(properties); + [communicator] = this.initialize(properties); com = Test.RemoteCommunicatorPrx.uncheckedCast(communicator.stringToProxy(ref)); out.write("testing per request binding with single endpoint... "); @@ -449,7 +449,7 @@ out.writeLine("ok"); await communicator.destroy(); - communicator = this.initialize(properties); + [communicator] = this.initialize(properties); com = Test.RemoteCommunicatorPrx.uncheckedCast(communicator.stringToProxy(ref)); out.write("testing per request binding with multiple endpoints... "); @@ -509,7 +509,7 @@ // await communicator.destroy(); - communicator = this.initialize(properties); + [communicator] = this.initialize(properties); com = Test.RemoteCommunicatorPrx.uncheckedCast(communicator.stringToProxy(ref)); out.write("testing per request binding and ordered endpoint selection... "); @@ -586,7 +586,7 @@ try { const out = this.getWriter(); - communicator = this.initialize(args); + [communicator, args] = this.initialize(args); if(typeof navigator !== 'undefined' && isSafari() && isWorker()) { // diff --git a/js/test/Ice/enums/Client.js b/js/test/Ice/enums/Client.js index 7fdf6b6eece..f892bf166c4 100644 --- a/js/test/Ice/enums/Client.js +++ b/js/test/Ice/enums/Client.js @@ -174,7 +174,7 @@ let communicator; try { - communicator = this.initialize(args); + [communicator] = this.initialize(args); await this.allTests(); } finally diff --git a/js/test/Ice/exceptions/Client.js b/js/test/Ice/exceptions/Client.js index 3673e14c484..b4b85ddfafa 100644 --- a/js/test/Ice/exceptions/Client.js +++ b/js/test/Ice/exceptions/Client.js @@ -475,11 +475,11 @@ let communicator; try { - const properties = this.createTestProperties(args); + const [properties] = this.createTestProperties(args); properties.setProperty("Ice.MessageSizeMax", "10"); properties.setProperty("Ice.Warn.Connections", "0"); properties.setProperty("Ice.PrintStackTraces", "1"); - communicator = this.initialize(properties); + [communicator] = this.initialize(properties); await this.allTests(Test); } finally diff --git a/js/test/Ice/exceptions/Server.js b/js/test/Ice/exceptions/Server.js index 026774227e1..ee85f27d912 100644 --- a/js/test/Ice/exceptions/Server.js +++ b/js/test/Ice/exceptions/Server.js @@ -22,11 +22,11 @@ let echo; try { - const properties = this.createTestProperties(args); + const [properties] = this.createTestProperties(args); properties.setProperty("Ice.MessageSizeMax", "10"); properties.setProperty("Ice.Warn.Dispatch", "0"); properties.setProperty("Ice.Warn.Connections", "0"); - communicator = this.initialize(properties); + [communicator] = this.initialize(properties); echo = await Test.EchoPrx.checkedCast(communicator.stringToProxy("__echo:" + this.getTestEndpoint())); const adapter = await communicator.createObjectAdapter(""); diff --git a/js/test/Ice/exceptions/ServerAMD.js b/js/test/Ice/exceptions/ServerAMD.js index c70113f1fd7..952b50be20f 100644 --- a/js/test/Ice/exceptions/ServerAMD.js +++ b/js/test/Ice/exceptions/ServerAMD.js @@ -22,11 +22,11 @@ let echo; try { - const properties = this.createTestProperties(args); + const [properties] = this.createTestProperties(args); properties.setProperty("Ice.MessageSizeMax", "10"); properties.setProperty("Ice.Warn.Dispatch", "0"); properties.setProperty("Ice.Warn.Connections", "0"); - communicator = this.initialize(properties); + [communicator] = this.initialize(properties); echo = await Test.EchoPrx.checkedCast(communicator.stringToProxy("__echo:" + this.getTestEndpoint())); const adapter = await communicator.createObjectAdapter(""); adapter.add(new AMDThrowerI(), Ice.stringToIdentity("thrower")); diff --git a/js/test/Ice/facets/Client.js b/js/test/Ice/facets/Client.js index 9af9d5d4290..62a36d7258d 100644 --- a/js/test/Ice/facets/Client.js +++ b/js/test/Ice/facets/Client.js @@ -111,7 +111,7 @@ let communicator; try { - communicator = this.initialize(args); + [communicator] = this.initialize(args); await this.allTests(); } finally diff --git a/js/test/Ice/facets/Server.js b/js/test/Ice/facets/Server.js index 5e5877f1527..81e01dc1e15 100644 --- a/js/test/Ice/facets/Server.js +++ b/js/test/Ice/facets/Server.js @@ -28,7 +28,7 @@ let echo; try { - communicator = this.initialize(args); + [communicator] = this.initialize(args); const out = this.getWriter(); echo = await Test.EchoPrx.checkedCast(communicator.stringToProxy("__echo:" + this.getTestEndpoint())); diff --git a/js/test/Ice/hold/Client.js b/js/test/Ice/hold/Client.js index 133fb333edb..07a02389cd7 100644 --- a/js/test/Ice/hold/Client.js +++ b/js/test/Ice/hold/Client.js @@ -258,7 +258,7 @@ let communicator; try { - const properties = this.createTestProperties(args); + const [properties] = this.createTestProperties(args); // // For this test, we want to disable retries. // @@ -269,7 +269,7 @@ // properties.setProperty("Ice.Warn.Connections", "0"); - communicator = this.initialize(properties); + [communicator] = this.initialize(properties); await this.allTests(); } finally diff --git a/js/test/Ice/info/Client.js b/js/test/Ice/info/Client.js index c1da5777340..2b4a0a33d45 100644 --- a/js/test/Ice/info/Client.js +++ b/js/test/Ice/info/Client.js @@ -141,7 +141,7 @@ let communicator; try { - communicator = this.initialize(args); + [communicator] = this.initialize(args); await this.allTests(); } finally diff --git a/js/test/Ice/inheritance/Client.js b/js/test/Ice/inheritance/Client.js index 9665a8f7bc7..2ac84214515 100644 --- a/js/test/Ice/inheritance/Client.js +++ b/js/test/Ice/inheritance/Client.js @@ -223,7 +223,7 @@ let communicator; try { - communicator = this.initialize(args); + [communicator] = this.initialize(args); await this.allTests(); } finally diff --git a/js/test/Ice/inheritance/Server.js b/js/test/Ice/inheritance/Server.js index c74e388d445..a17f9190a37 100644 --- a/js/test/Ice/inheritance/Server.js +++ b/js/test/Ice/inheritance/Server.js @@ -22,7 +22,7 @@ let echo; try { - communicator = this.initialize(args); + [communicator] = this.initialize(args); echo = await Test.EchoPrx.checkedCast(communicator.stringToProxy("__echo:" + this.getTestEndpoint())); const adapter = await communicator.createObjectAdapter(""); const base = communicator.stringToProxy("initial:" + this.getTestEndpoint()); diff --git a/js/test/Ice/location/Client.js b/js/test/Ice/location/Client.js index 7931ceccf8d..077bced868d 100644 --- a/js/test/Ice/location/Client.js +++ b/js/test/Ice/location/Client.js @@ -503,9 +503,9 @@ let communicator; try { - const properties = this.createTestProperties(args); + const [properties] = this.createTestProperties(args); properties.setProperty("Ice.Default.Locator", "locator:" + this.getTestEndpoint(properties)); - communicator = this.initialize(properties); + [communicator] = this.initialize(properties); await this.allTests(); } finally diff --git a/js/test/Ice/objects/Client.js b/js/test/Ice/objects/Client.js index 3303879e122..593824b8529 100644 --- a/js/test/Ice/objects/Client.js +++ b/js/test/Ice/objects/Client.js @@ -432,9 +432,9 @@ let communicator; try { - const properties = this.createTestProperties(args); + const [properties] = this.createTestProperties(args); properties.setProperty("Ice.Warn.Connections", "0"); - communicator = this.initialize(properties); + [communicator] = this.initialize(properties); await this.allTests(); } finally diff --git a/js/test/Ice/objects/Server.js b/js/test/Ice/objects/Server.js index 16c6a5dbd75..89f601489d0 100644 --- a/js/test/Ice/objects/Server.js +++ b/js/test/Ice/objects/Server.js @@ -30,10 +30,10 @@ let echo; try { - const properties = this.createTestProperties(args); + const [properties] = this.createTestProperties(args); properties.setProperty("Ice.Warn.Dispatch", "0"); properties.setProperty("Ice.Warn.Connections", "0"); - communicator = this.initialize(properties); + [communicator] = this.initialize(properties); echo = await Test.EchoPrx.checkedCast(communicator.stringToProxy("__echo:" + this.getTestEndpoint())); const adapter = await communicator.createObjectAdapter(""); adapter.add(new InitialI(communicator), Ice.stringToIdentity("initial")); diff --git a/js/test/Ice/operations/Client.js b/js/test/Ice/operations/Client.js index dd9840d4e9c..65d955bfd1b 100644 --- a/js/test/Ice/operations/Client.js +++ b/js/test/Ice/operations/Client.js @@ -65,9 +65,9 @@ let communicator; try { - const properties = this.createTestProperties(args); + const [properties] = this.createTestProperties(args); properties.setProperty("Ice.BatchAutoFlushSize", "100"); - communicator = this.initialize(properties); + [communicator] = this.initialize(properties); await this.allTests(Test, false); } finally diff --git a/js/test/Ice/operations/Server.js b/js/test/Ice/operations/Server.js index 86c4af3217e..d4d9c5eaeb2 100644 --- a/js/test/Ice/operations/Server.js +++ b/js/test/Ice/operations/Server.js @@ -22,9 +22,9 @@ let echo; try { - const properties = this.createTestProperties(args); + const [properties] = this.createTestProperties(args); properties.setProperty("Ice.BatchAutoFlushSize", "100"); - communicator = this.initialize(properties); + [communicator] = this.initialize(properties); echo = await Test.EchoPrx.checkedCast(communicator.stringToProxy("__echo:" + this.getTestEndpoint())); const adapter = await communicator.createObjectAdapter(""); adapter.add(new MyDerivedClassI(echo.ice_getEndpoints()), Ice.stringToIdentity("test")); diff --git a/js/test/Ice/operations/ServerAMD.js b/js/test/Ice/operations/ServerAMD.js index d16db6da5b5..9f738bf09b6 100644 --- a/js/test/Ice/operations/ServerAMD.js +++ b/js/test/Ice/operations/ServerAMD.js @@ -22,9 +22,9 @@ let echo; try { - const properties = this.createTestProperties(args); + const [properties] = this.createTestProperties(args); properties.setProperty("Ice.BatchAutoFlushSize", "100"); - communicator = this.initialize(properties); + [communicator] = this.initialize(properties); echo = await Test.EchoPrx.checkedCast(communicator.stringToProxy("__echo:" + this.getTestEndpoint())); const adapter = await communicator.createObjectAdapter(""); adapter.add(new AMDMyDerivedClassI(echo.ice_getEndpoints()), Ice.stringToIdentity("test")); diff --git a/js/test/Ice/optional/Client.js b/js/test/Ice/optional/Client.js index 90ac782f2d9..74eff0b5b28 100644 --- a/js/test/Ice/optional/Client.js +++ b/js/test/Ice/optional/Client.js @@ -793,7 +793,7 @@ let communicator; try { - communicator = this.initialize(args); + [communicator] = this.initialize(args); await this.allTests(Test); } finally diff --git a/js/test/Ice/optional/Server.js b/js/test/Ice/optional/Server.js index c720ffdebe8..07bec470976 100644 --- a/js/test/Ice/optional/Server.js +++ b/js/test/Ice/optional/Server.js @@ -22,7 +22,7 @@ let echo; try { - communicator = this.initialize(args); + [communicator] = this.initialize(args); echo = await Test.EchoPrx.checkedCast(communicator.stringToProxy("__echo:" + this.getTestEndpoint())); const adapter = await communicator.createObjectAdapter(""); adapter.add(new InitialI(), Ice.stringToIdentity("initial")); diff --git a/js/test/Ice/optional/ServerAMD.js b/js/test/Ice/optional/ServerAMD.js index 6892c387a76..399d757db41 100644 --- a/js/test/Ice/optional/ServerAMD.js +++ b/js/test/Ice/optional/ServerAMD.js @@ -22,7 +22,7 @@ let echo; try { - communicator = this.initialize(args); + [communicator] = this.initialize(args); echo = await Test.EchoPrx.checkedCast(communicator.stringToProxy("__echo:" + this.getTestEndpoint())); const adapter = await communicator.createObjectAdapter(""); adapter.add(new AMDInitialI(), Ice.stringToIdentity("initial")); diff --git a/js/test/Ice/properties/Client.js b/js/test/Ice/properties/Client.js index b0faa9461c4..82db61c00da 100644 --- a/js/test/Ice/properties/Client.js +++ b/js/test/Ice/properties/Client.js @@ -95,7 +95,7 @@ let communicator; try { - communicator = this.initialize(args); + [communicator, args] = this.initialize(args); await this.allTests(args); } finally diff --git a/js/test/Ice/proxy/Client.js b/js/test/Ice/proxy/Client.js index 188cc88333e..7e2d9d0249b 100644 --- a/js/test/Ice/proxy/Client.js +++ b/js/test/Ice/proxy/Client.js @@ -1157,7 +1157,7 @@ let communicator; try { - communicator = this.initialize(args); + [communicator] = this.initialize(args); await this.allTests(); } finally diff --git a/js/test/Ice/retry/Client.js b/js/test/Ice/retry/Client.js index 046774a258a..77985661253 100644 --- a/js/test/Ice/retry/Client.js +++ b/js/test/Ice/retry/Client.js @@ -104,7 +104,7 @@ let communicator2; try { - let properties = this.createTestProperties(args); + let [properties] = this.createTestProperties(args); // // For this test, we want to disable retries. @@ -116,7 +116,7 @@ // properties.setProperty("Ice.Warn.Connections", "0"); - communicator = this.initialize(properties); + [communicator] = this.initialize(properties); // // Configure a second communicator for the invocation timeout @@ -125,7 +125,7 @@ // properties = communicator.getProperties().clone(); properties.setProperty("Ice.RetryIntervals", "0 1 10000"); - communicator2 = this.initialize(properties); + [communicator2] = this.initialize(properties); await this.allTests(communicator, communicator2); } diff --git a/js/test/Ice/scope/Client.js b/js/test/Ice/scope/Client.js index 2cb6f8e69b8..097b6acc494 100644 --- a/js/test/Ice/scope/Client.js +++ b/js/test/Ice/scope/Client.js @@ -171,7 +171,7 @@ let communicator; try { - communicator = this.initialize(args); + [communicator] = this.initialize(args); await this.allTests(); } finally diff --git a/js/test/Ice/servantLocator/Client.js b/js/test/Ice/servantLocator/Client.js index b91df3fd0da..ed6f30c3bc4 100644 --- a/js/test/Ice/servantLocator/Client.js +++ b/js/test/Ice/servantLocator/Client.js @@ -297,7 +297,7 @@ let communicator; try { - communicator = this.initialize(args); + [communicator] = this.initialize(args); await this.allTests(); } finally diff --git a/js/test/Ice/servantLocator/Server.js b/js/test/Ice/servantLocator/Server.js index b7fca96235c..926f6acfdfa 100644 --- a/js/test/Ice/servantLocator/Server.js +++ b/js/test/Ice/servantLocator/Server.js @@ -24,11 +24,11 @@ let echo; try { - const properties = this.createTestProperties(args); + const [properties] = this.createTestProperties(args); properties.setProperty("Ice.MessageSizeMax", "10"); properties.setProperty("Ice.Warn.Dispatch", "0"); properties.setProperty("Ice.Warn.Connections", "0"); - communicator = this.initialize(properties); + [communicator] = this.initialize(properties); echo = await Test.EchoPrx.checkedCast(communicator.stringToProxy("__echo:" + this.getTestEndpoint())); const adapter = await communicator.createObjectAdapter(""); diff --git a/js/test/Ice/slicing/exceptions/Client.js b/js/test/Ice/slicing/exceptions/Client.js index 28a07dd0908..14e298164f1 100644 --- a/js/test/Ice/slicing/exceptions/Client.js +++ b/js/test/Ice/slicing/exceptions/Client.js @@ -315,7 +315,7 @@ let communicator; try { - communicator = this.initialize(args); + [communicator] = this.initialize(args); await this.allTests(); } finally diff --git a/js/test/Ice/slicing/objects/Client.js b/js/test/Ice/slicing/objects/Client.js index d60d27da3a4..97cb9b7a45f 100644 --- a/js/test/Ice/slicing/objects/Client.js +++ b/js/test/Ice/slicing/objects/Client.js @@ -772,7 +772,7 @@ let communicator; try { - communicator = this.initialize(args); + [communicator] = this.initialize(args); await this.allTests(); } finally diff --git a/js/test/Ice/stream/Client.js b/js/test/Ice/stream/Client.js index eacfcc39e4b..8a59dd534e1 100644 --- a/js/test/Ice/stream/Client.js +++ b/js/test/Ice/stream/Client.js @@ -622,7 +622,7 @@ let communicator; try { - communicator = this.initialize(args); + [communicator] = this.initialize(args); this.allTests(); } finally diff --git a/js/test/Ice/timeout/Client.js b/js/test/Ice/timeout/Client.js index 67f2687a2cb..3ec1a54d59c 100644 --- a/js/test/Ice/timeout/Client.js +++ b/js/test/Ice/timeout/Client.js @@ -354,7 +354,7 @@ let communicator; try { - const properties = this.createTestProperties(args); + const [properties] = this.createTestProperties(args); // // For this test, we want to disable retries. // @@ -366,7 +366,7 @@ properties.setProperty("Ice.Warn.Connections", "0"); properties.setProperty("Ice.PrintStackTraces", "1"); - communicator = this.initialize(properties); + [communicator] = this.initialize(properties); await this.allTests(); } finally diff --git a/js/test/Slice/escape/Client.js b/js/test/Slice/escape/Client.js index 0e2d14f998e..8a777396ea0 100644 --- a/js/test/Slice/escape/Client.js +++ b/js/test/Slice/escape/Client.js @@ -91,7 +91,7 @@ let communicator; try { - communicator = this.initialize(args); + [communicator] = this.initialize(args); await this.allTests(); } finally diff --git a/python/test/Glacier2/application/Client.py b/python/test/Glacier2/application/Client.py index dac74edf696..aa8ab6177b3 100644 --- a/python/test/Glacier2/application/Client.py +++ b/python/test/Glacier2/application/Client.py @@ -43,11 +43,12 @@ class CallbackReceiverI(Test.CallbackReceiver): class Application(Glacier2.Application): - def __init__(self): + def __init__(self, helper): Glacier2.Application.__init__(self) self._restart = 0 self._destroyed = False self._receiver = CallbackReceiverI() + self._helper = helper def createSession(self): return Glacier2.SessionPrx.uncheckedCast(self.router().createSession("userid", "abc123")) @@ -62,7 +63,8 @@ class Application(Glacier2.Application): sys.stdout.write("testing Glacier2::Application restart... ") sys.stdout.flush() - base = self.communicator().stringToProxy("callback:default -p 12010"); + base = self.communicator().stringToProxy("callback:{0}".format( + self._helper.getTestEndpoint(properties=self.communicator().getProperties()))); callback = Test.CallbackPrx.uncheckedCast(base) self._restart += 1 if self._restart < 5: @@ -87,10 +89,11 @@ class Client(TestHelper): def run(self, args): initData = Ice.InitializationData() - initData.properties = self.createTestProperties(sys.argv) - initData.properties.setProperty("Ice.Default.Router", "Glacier2/router:default -p 12060") + initData.properties = self.createTestProperties(args) + initData.properties.setProperty("Ice.Default.Router", "Glacier2/router:{0}".format( + self.getTestEndpoint(properties=initData.properties, num=50))) - app = Application() + app = Application(self) status = app.main(sys.argv, initData=initData) test(status == 0) test(app._restart == 5) @@ -100,7 +103,8 @@ class Client(TestHelper): with self.initialize(initData=initData) as communicator: sys.stdout.write("testing stringToProxy for process object... ") sys.stdout.flush() - processBase = communicator.stringToProxy("Glacier2/admin -f Process:default -p 12061") + processBase = communicator.stringToProxy("Glacier2/admin -f Process:{0}".format( + self.getTestEndpoint(properties=initData.properties, num=51))) print("ok") sys.stdout.write("testing checked cast for admin object... ") diff --git a/python/test/Glacier2/application/Server.py b/python/test/Glacier2/application/Server.py index 7b32c1689b9..25c69c16ff7 100644 --- a/python/test/Glacier2/application/Server.py +++ b/python/test/Glacier2/application/Server.py @@ -27,10 +27,10 @@ class Server(TestHelper): def run(self, args): with self.initialize(args=args) as communicator: - communicator.getProperties().setProperty("DeactivatedAdapter.Endpoints", "default -p 12011") + communicator.getProperties().setProperty("DeactivatedAdapter.Endpoints", self.getTestEndpoint(num=1)) communicator.createObjectAdapter("DeactivatedAdapter") - communicator.getProperties().setProperty("CallbackAdapter.Endpoints", "default -p 12010") + communicator.getProperties().setProperty("CallbackAdapter.Endpoints", self.getTestEndpoint()) adapter = communicator.createObjectAdapter("CallbackAdapter") adapter.add(CallbackI(), Ice.stringToIdentity("callback")) adapter.activate() diff --git a/python/test/Ice/acm/Server.py b/python/test/Ice/acm/Server.py index fe276128ffc..1ad6aefb346 100755 --- a/python/test/Ice/acm/Server.py +++ b/python/test/Ice/acm/Server.py @@ -22,7 +22,7 @@ class Server(TestHelper): properties.setProperty("Ice.Warn.Connections", "0") properties.setProperty("Ice.ACM.Timeout", "1") with self.initialize(properties=properties) as communicator: - communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010") + communicator.getProperties().setProperty("TestAdapter.Endpoints", self.getTestEndpoint()) communicator.getProperties().setProperty("TestAdapter.ACM.Timeout", "0") adapter = communicator.createObjectAdapter("TestAdapter") adapter.add(TestI.RemoteCommunicatorI(), Ice.stringToIdentity("communicator")) diff --git a/python/test/Ice/ami/Collocated.py b/python/test/Ice/ami/Collocated.py index 0b449be5866..b34af35d6f2 100755 --- a/python/test/Ice/ami/Collocated.py +++ b/python/test/Ice/ami/Collocated.py @@ -28,8 +28,8 @@ class Collocated(TestHelper): with self.initialize(properties=properties) as communicator: - communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010") - communicator.getProperties().setProperty("ControllerAdapter.Endpoints", "default -p 12011") + communicator.getProperties().setProperty("TestAdapter.Endpoints", self.getTestEndpoint()) + communicator.getProperties().setProperty("ControllerAdapter.Endpoints", self.getTestEndpoint(num=1)) communicator.getProperties().setProperty("ControllerAdapter.ThreadPool.Size", "1") adapter = communicator.createObjectAdapter("TestAdapter") diff --git a/python/test/Ice/blobject/Client.py b/python/test/Ice/blobject/Client.py index 64846c2702f..e6378f7aba7 100755 --- a/python/test/Ice/blobject/Client.py +++ b/python/test/Ice/blobject/Client.py @@ -24,7 +24,7 @@ def test(b): class Client(TestHelper): def allTests(self, communicator, sync): - hello = Test.HelloPrx.checkedCast(communicator.stringToProxy("test:default -p 12010")) + hello = Test.HelloPrx.checkedCast(communicator.stringToProxy("test:{0}".format(self.getTestEndpoint()))) hello.sayHello(False) hello.sayHello(False, {"_fwd": "o"}) test(hello.add(10, 20) == 30) @@ -35,7 +35,7 @@ class Client(TestHelper): pass try: - Test.HelloPrx.checkedCast(communicator.stringToProxy("unknown:default -p 12010 -t 10000")) + Test.HelloPrx.checkedCast(communicator.stringToProxy("unknown:{0} -t 10000".format(self.getTestEndpoint()))) test(False) except Ice.ObjectNotExistException: pass diff --git a/python/test/Ice/blobject/Server.py b/python/test/Ice/blobject/Server.py index b1bd3095f81..cc8dc28440a 100755 --- a/python/test/Ice/blobject/Server.py +++ b/python/test/Ice/blobject/Server.py @@ -41,7 +41,7 @@ class Server(TestHelper): # properties.setProperty("Ice.Warn.Dispatch", "0") with self.initialize(properties=properties) as communicator: - communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010") + communicator.getProperties().setProperty("TestAdapter.Endpoints", self.getTestEndpoint()) adapter = communicator.createObjectAdapter("TestAdapter") adapter.add(TestI(), Ice.stringToIdentity("test")) adapter.activate() diff --git a/python/test/Ice/exceptions/ServerAMD.py b/python/test/Ice/exceptions/ServerAMD.py index 3c229492356..2a94ecf057d 100755 --- a/python/test/Ice/exceptions/ServerAMD.py +++ b/python/test/Ice/exceptions/ServerAMD.py @@ -150,10 +150,10 @@ class ServerAMD(TestHelper): properties.setProperty("Ice.Warn.Connections", "0") properties.setProperty("Ice.MessageSizeMax", "10") with self.initialize(properties=properties) as communicator: - communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010") - communicator.getProperties().setProperty("TestAdapter2.Endpoints", "default -p 12011") + communicator.getProperties().setProperty("TestAdapter.Endpoints", self.getTestEndpoint()) + communicator.getProperties().setProperty("TestAdapter2.Endpoints", self.getTestEndpoint(num=1)) communicator.getProperties().setProperty("TestAdapter2.MessageSizeMax", "0") - communicator.getProperties().setProperty("TestAdapter3.Endpoints", "default -p 12012") + communicator.getProperties().setProperty("TestAdapter3.Endpoints", self.getTestEndpoint(num=2)) communicator.getProperties().setProperty("TestAdapter3.MessageSizeMax", "1") adapter = communicator.createObjectAdapter("TestAdapter") diff --git a/python/test/Ice/facets/Client.py b/python/test/Ice/facets/Client.py index 2a378682942..e68dd08a3f8 100755 --- a/python/test/Ice/facets/Client.py +++ b/python/test/Ice/facets/Client.py @@ -16,7 +16,6 @@ import AllTests class Client(TestHelper): def run(self, args): - - with self.initialize(args) as communicator: + with self.initialize(args=args) as communicator: g = AllTests.allTests(self, communicator) g.shutdown() diff --git a/python/test/Ice/facets/Server.py b/python/test/Ice/facets/Server.py index b0ac848d50c..547c631e98f 100755 --- a/python/test/Ice/facets/Server.py +++ b/python/test/Ice/facets/Server.py @@ -17,7 +17,7 @@ import TestI class Server(TestHelper): def run(self, args): - with self.initialize(args) as communicator: + with self.initialize(args=args) as communicator: communicator.getProperties().setProperty("TestAdapter.Endpoints", self.getTestEndpoint()) adapter = communicator.createObjectAdapter("TestAdapter") adapter.add(TestI.DI(), Ice.stringToIdentity("d")) diff --git a/python/test/Ice/faultTolerance/Client.py b/python/test/Ice/faultTolerance/Client.py index b1f9d8cb981..d7fe484e12f 100755 --- a/python/test/Ice/faultTolerance/Client.py +++ b/python/test/Ice/faultTolerance/Client.py @@ -27,7 +27,7 @@ class Client(TestHelper): ports = [] for arg in args: if arg[0] == '-': - raise RuntimeError("unknown option `" + arg + "'") + continue ports.append(int(arg)) if len(ports) == 0: diff --git a/python/test/Ice/faultTolerance/Server.py b/python/test/Ice/faultTolerance/Server.py index 3da4d0fdd4f..90634469ec0 100755 --- a/python/test/Ice/faultTolerance/Server.py +++ b/python/test/Ice/faultTolerance/Server.py @@ -46,7 +46,7 @@ class Server(TestHelper): for arg in args: if arg[0] == '-': - raise RuntimeError("unknown option `" + arg + "'") + continue if port > 0: raise RuntimeError("only one port can be specified") diff --git a/python/test/Ice/info/AllTests.py b/python/test/Ice/info/AllTests.py index 9bec16441f3..e7d4f14054a 100644 --- a/python/test/Ice/info/AllTests.py +++ b/python/test/Ice/info/AllTests.py @@ -148,7 +148,7 @@ def allTests(helper, communicator): test(port > 0) udp = base.ice_datagram().ice_getConnection().getEndpoint().getInfo() - test(udp.port == 12010) + test(udp.port == port) test(udp.host == defaultHost) print("ok") @@ -163,7 +163,7 @@ def allTests(helper, communicator): tcpinfo = getTCPConnectionInfo(info) test(not info.incoming) test(len(info.adapterName) == 0) - test(tcpinfo.remotePort == 12010) + test(tcpinfo.remotePort == port) if defaultHost == '127.0.0.1': test(tcpinfo.remoteAddress == defaultHost) test(tcpinfo.localAddress == defaultHost) diff --git a/python/test/Ice/location/Server.py b/python/test/Ice/location/Server.py index 52475e42314..a9c6c10d78f 100755 --- a/python/test/Ice/location/Server.py +++ b/python/test/Ice/location/Server.py @@ -75,11 +75,12 @@ class ServerLocator(Test.TestLocator): class ServerManagerI(Test.ServerManager): - def __init__(self, registry, initData): + def __init__(self, registry, initData, helper): self._registry = registry self._communicators = [] self._initData = initData self._nextPort = 1 + self._helper = helper; self._initData.properties.setProperty("TestAdapter.AdapterId", "TestAdapter") self._initData.properties.setProperty("TestAdapter.ReplicaGroupId", "ReplicatedAdapter") self._initData.properties.setProperty("TestAdapter2.AdapterId", "TestAdapter2") @@ -97,22 +98,22 @@ class ServerManagerI(Test.ServerManager): serverCommunicator = Ice.initialize(self._initData) self._communicators.append(serverCommunicator) - def getTestEndpoint(): - self._nextPort += 1 - return "default -p {}".format(12010 + self._nextPort) - nRetry = 10 while --nRetry > 0: adapter = None adapter2 = None try: - serverCommunicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint()) - serverCommunicator.getProperties().setProperty("TestAdapter2.Endpoints", getTestEndpoint()) + serverCommunicator.getProperties().setProperty("TestAdapter.Endpoints", + self._helper.getTestEndpoint(num=self._nextPort)) + self._nextPort += 1 + serverCommunicator.getProperties().setProperty("TestAdapter2.Endpoints", + self._helper.getTestEndpoint(num=self._nextPort)) + self._nextPort += 1 adapter = serverCommunicator.createObjectAdapter("TestAdapter") adapter2 = serverCommunicator.createObjectAdapter("TestAdapter2") - locator = serverCommunicator.stringToProxy("locator:default -p 12010") + locator = serverCommunicator.stringToProxy("locator:{0}".format(self._helper.getTestEndpoint())) adapter.setLocator(Ice.LocatorPrx.uncheckedCast(locator)) adapter2.setLocator(Ice.LocatorPrx.uncheckedCast(locator)) @@ -195,7 +196,7 @@ class Server(TestHelper): # registry = ServerLocatorRegistry() registry.addObject(adapter.createProxy(Ice.stringToIdentity("ServerManager"))) - adapter.add(ServerManagerI(registry, initData), Ice.stringToIdentity("ServerManager")) + adapter.add(ServerManagerI(registry, initData, self), Ice.stringToIdentity("ServerManager")) registryPrx = Ice.LocatorRegistryPrx.uncheckedCast(adapter.add(registry, Ice.stringToIdentity("registry"))) diff --git a/python/test/Ice/objects/AllTests.py b/python/test/Ice/objects/AllTests.py index 5c254de44de..b8dde23b1b4 100644 --- a/python/test/Ice/objects/AllTests.py +++ b/python/test/Ice/objects/AllTests.py @@ -269,7 +269,7 @@ def allTests(helper, communicator): if initial.ice_getConnection(): sys.stdout.write("testing UnexpectedObjectException... ") sys.stdout.flush() - ref = "uoet:default -p 12010" + ref = "uoet:{0}".format(helper.getTestEndpoint()) base = communicator.stringToProxy(ref) test(base) uoet = Test.UnexpectedObjectExceptionTestPrx.uncheckedCast(base) diff --git a/python/test/Ice/operations/AllTests.py b/python/test/Ice/operations/AllTests.py index b63362ff341..8be399def8e 100644 --- a/python/test/Ice/operations/AllTests.py +++ b/python/test/Ice/operations/AllTests.py @@ -16,40 +16,41 @@ def test(b): def allTests(helper, communicator): ref = "test:{0}".format(helper.getTestEndpoint()) + print("Client endpoint: {}".format(ref)) base = communicator.stringToProxy(ref) cl = Test.MyClassPrx.checkedCast(base) derived = Test.MyDerivedClassPrx.checkedCast(cl) sys.stdout.write("testing twoway operations... ") sys.stdout.flush() - Twoways.twoways(communicator, cl) - Twoways.twoways(communicator, derived) + Twoways.twoways(helper, cl) + Twoways.twoways(helper, derived) derived.opDerived() print("ok") sys.stdout.write("testing oneway operations... ") sys.stdout.flush() - Oneways.oneways(communicator, cl) + Oneways.oneways(helper, cl) print("ok") sys.stdout.write("testing twoway operations with futures... ") sys.stdout.flush() - TwowaysFuture.twowaysFuture(communicator, cl) + TwowaysFuture.twowaysFuture(helper, cl) print("ok") sys.stdout.write("testing twoway operations with AMI... ") sys.stdout.flush() - TwowaysAMI.twowaysAMI(communicator, cl) + TwowaysAMI.twowaysAMI(helper, cl) print("ok") sys.stdout.write("testing oneway operations with futures... ") sys.stdout.flush() - OnewaysFuture.onewaysFuture(communicator, cl) + OnewaysFuture.onewaysFuture(helper, cl) print("ok") sys.stdout.write("testing oneway operations with AMI... ") sys.stdout.flush() - OnewaysAMI.onewaysAMI(communicator, cl) + OnewaysAMI.onewaysAMI(helper, cl) print("ok") sys.stdout.write("testing batch oneway operations... ") diff --git a/python/test/Ice/operations/Oneways.py b/python/test/Ice/operations/Oneways.py index 74cbd93ff4f..7d87c1eb718 100644 --- a/python/test/Ice/operations/Oneways.py +++ b/python/test/Ice/operations/Oneways.py @@ -13,8 +13,8 @@ def test(b): if not b: raise RuntimeError('test assertion failed') -def oneways(communicator, p): - +def oneways(helper, p): + communicator = helper.communicator() p = Test.MyClassPrx.uncheckedCast(p.ice_oneway()) # diff --git a/python/test/Ice/operations/OnewaysAMI.py b/python/test/Ice/operations/OnewaysAMI.py index 5c5a134be0d..05e00f8a89f 100644 --- a/python/test/Ice/operations/OnewaysAMI.py +++ b/python/test/Ice/operations/OnewaysAMI.py @@ -36,8 +36,8 @@ class Callback(CallbackBase): def noException(self, ex): test(False) -def onewaysAMI(communicator, proxy): - +def onewaysAMI(helper, proxy): + communicator = helper.communicator() p = Test.MyClassPrx.uncheckedCast(proxy.ice_oneway()) cb = Callback() diff --git a/python/test/Ice/operations/OnewaysFuture.py b/python/test/Ice/operations/OnewaysFuture.py index c17d0e04624..f6ab5aaaebe 100644 --- a/python/test/Ice/operations/OnewaysFuture.py +++ b/python/test/Ice/operations/OnewaysFuture.py @@ -13,8 +13,8 @@ def test(b): if not b: raise RuntimeError('test assertion failed') -def onewaysFuture(communicator, proxy): - +def onewaysFuture(helper, proxy): + communicator = helper.communicator() p = Test.MyClassPrx.uncheckedCast(proxy.ice_oneway()) f = p.ice_pingAsync() diff --git a/python/test/Ice/operations/Server.py b/python/test/Ice/operations/Server.py index f5de973acb6..de09f31ba7e 100755 --- a/python/test/Ice/operations/Server.py +++ b/python/test/Ice/operations/Server.py @@ -26,6 +26,7 @@ class Server(TestHelper): properties.setProperty("Ice.Warn.Dispatch", "0") with self.initialize(properties=properties) as communicator: + print("Server endpoint: {}".format(self.getTestEndpoint())) communicator.getProperties().setProperty("TestAdapter.Endpoints", self.getTestEndpoint()) adapter = communicator.createObjectAdapter("TestAdapter") adapter.add(TestI.MyDerivedClassI(), Ice.stringToIdentity("test")) diff --git a/python/test/Ice/operations/Twoways.py b/python/test/Ice/operations/Twoways.py index a441ee9ef6a..5eb179f33e9 100644 --- a/python/test/Ice/operations/Twoways.py +++ b/python/test/Ice/operations/Twoways.py @@ -14,8 +14,9 @@ def test(b): if not b: raise RuntimeError('test assertion failed') -def twoways(communicator, p): +def twoways(helper, p): + communicator = helper.communicator() literals = p.opStringLiterals() test(Test.s0 == "\\") @@ -1341,7 +1342,7 @@ def twoways(communicator, p): ctx = {'one': 'ONE', 'two': 'TWO', 'three': 'THREE'} - p1 = Test.MyClassPrx.uncheckedCast(ic.stringToProxy('test:default -p 12010')) + p1 = Test.MyClassPrx.uncheckedCast(ic.stringToProxy('test:{0}'.format(helper.getTestEndpoint()))) ic.getImplicitContext().setContext(ctx) test(ic.getImplicitContext().getContext() == ctx) diff --git a/python/test/Ice/operations/TwowaysAMI.py b/python/test/Ice/operations/TwowaysAMI.py index 1c6de0274e5..6189d5255ff 100644 --- a/python/test/Ice/operations/TwowaysAMI.py +++ b/python/test/Ice/operations/TwowaysAMI.py @@ -751,7 +751,8 @@ class Callback(CallbackBase): def exCB(self, ex): test(False) -def twowaysAMI(communicator, p): +def twowaysAMI(helper, p): + communicator = helper.communicator() cb = Callback() p.begin_ice_ping(cb.ping, cb.exCB) cb.check() @@ -1128,7 +1129,7 @@ def twowaysAMI(communicator, p): ctx = {'one': 'ONE', 'two': 'TWO', 'three': 'THREE'} - p3 = Test.MyClassPrx.uncheckedCast(ic.stringToProxy("test:default -p 12010")) + p3 = Test.MyClassPrx.uncheckedCast(ic.stringToProxy("test:{0}".format(helper.getTestEndpoint()))) ic.getImplicitContext().setContext(ctx) test(ic.getImplicitContext().getContext() == ctx) diff --git a/python/test/Ice/operations/TwowaysFuture.py b/python/test/Ice/operations/TwowaysFuture.py index 86e4c86077c..70279725bb1 100644 --- a/python/test/Ice/operations/TwowaysFuture.py +++ b/python/test/Ice/operations/TwowaysFuture.py @@ -898,7 +898,8 @@ class Callback(CallbackBase): def opDerived(self, f): self.called() -def twowaysFuture(communicator, p): +def twowaysFuture(helper, p): + communicator = helper.communicator() f = p.ice_pingAsync() test(f.result() is None) @@ -1271,7 +1272,7 @@ def twowaysFuture(communicator, p): ctx = {'one': 'ONE', 'two': 'TWO', 'three': 'THREE'} - p3 = Test.MyClassPrx.uncheckedCast(ic.stringToProxy("test:default -p 12010")) + p3 = Test.MyClassPrx.uncheckedCast(ic.stringToProxy("test:{0}".format(helper.getTestEndpoint()))) ic.getImplicitContext().setContext(ctx) test(ic.getImplicitContext().getContext() == ctx) diff --git a/python/test/Ice/proxy/AllTests.py b/python/test/Ice/proxy/AllTests.py index 20a2a7176ae..0b84e30993c 100644 --- a/python/test/Ice/proxy/AllTests.py +++ b/python/test/Ice/proxy/AllTests.py @@ -241,7 +241,7 @@ def allTests(helper, communicator, collocated): #test(b1.ice_getLocatorCacheTimeout() == 60) #prop.setProperty("Ice.Default.LocatorCacheTimeout", "") - prop.setProperty(propertyPrefix, "test:default -p 12010") + prop.setProperty(propertyPrefix, "test:{0}".format(helper.getTestEndpoint())) property = propertyPrefix + ".Router" test(not b1.ice_getRouter()) @@ -810,8 +810,6 @@ def allTests(helper, communicator, collocated): # Working? ssl = communicator.getProperties().getProperty("Ice.Default.Protocol") == "ssl" tcp = communicator.getProperties().getProperty("Ice.Default.Protocol") == "tcp" - if tcp: - p1.ice_encodingVersion(Ice.Encoding_1_0).ice_ping() # Two legal TCP endpoints expressed as opaque endpoints p1 = communicator.stringToProxy("test -e 1.0:opaque -t 1 -e 1.0 -v CTEyNy4wLjAuMeouAAAQJwAAAA==:opaque -t 1 -e 1.0 -v CTEyNy4wLjAuMusuAAAQJwAAAA==") diff --git a/python/test/Ice/proxy/Client.py b/python/test/Ice/proxy/Client.py index 1bde5dc2a0e..6ea11c0de81 100755 --- a/python/test/Ice/proxy/Client.py +++ b/python/test/Ice/proxy/Client.py @@ -16,6 +16,6 @@ import AllTests class Client(TestHelper): def run(self, args): - with self.initialize(args) as communicator: + with self.initialize(args=args) as communicator: myClass = AllTests.allTests(self, communicator, False) myClass.shutdown() diff --git a/python/test/Ice/proxy/Server.py b/python/test/Ice/proxy/Server.py index df82bf7bb87..c36572d2a4d 100755 --- a/python/test/Ice/proxy/Server.py +++ b/python/test/Ice/proxy/Server.py @@ -8,34 +8,24 @@ # # ********************************************************************** -import os, sys, traceback import Ice -slice_dir = Ice.getSliceDir() -if not slice_dir: - print(sys.argv[0] + ': Slice directory not found.') - sys.exit(1) +from TestHelper import TestHelper +TestHelper.loadSlice("Test.ice") +import Test +import TestI -Ice.loadSlice("'-I" + slice_dir + "' Test.ice") -import Test, TestI +class Server(TestHelper): -def run(args, communicator): - communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010") - adapter = communicator.createObjectAdapter("TestAdapter") + def run(self, args): + properties = self.createTestProperties(args) + properties.setProperty("Ice.Warn.Dispatch", "0") + properties.setProperty("Ice.Warn.Connections", "0") + with self.initialize(properties=properties) as communicator: + communicator.getProperties().setProperty("TestAdapter.Endpoints", self.getTestEndpoint()) + adapter = communicator.createObjectAdapter("TestAdapter") - adapter.add(TestI.MyDerivedClassI(), Ice.stringToIdentity("test")) - adapter.activate() - communicator.waitForShutdown() - return True + adapter.add(TestI.MyDerivedClassI(), Ice.stringToIdentity("test")) + adapter.activate() + communicator.waitForShutdown() -try: - initData = Ice.InitializationData() - initData.properties = Ice.createProperties(sys.argv) - initData.properties.setProperty("Ice.Warn.Dispatch", "0") - with Ice.initialize(sys.argv, initData) as communicator: - status = run(sys.argv, communicator) -except: - traceback.print_exc() - status = False - -sys.exit(not status) diff --git a/python/test/Ice/proxy/ServerAMD.py b/python/test/Ice/proxy/ServerAMD.py index 2d130fa9aa8..b6fa4715d09 100755 --- a/python/test/Ice/proxy/ServerAMD.py +++ b/python/test/Ice/proxy/ServerAMD.py @@ -8,16 +8,11 @@ # # ********************************************************************** -import os, sys, traceback, time - 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 Test +import TestI class MyDerivedClassI(Test.MyDerivedClass): def __init__(self): @@ -36,23 +31,15 @@ class MyDerivedClassI(Test.MyDerivedClass): self.ctx = current.ctx return Test.MyDerivedClass.ice_isA(self, s, current) -def run(args, communicator): - communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010") - adapter = communicator.createObjectAdapter("TestAdapter") - adapter.add(MyDerivedClassI(), Ice.stringToIdentity("test")) - adapter.activate() - communicator.waitForShutdown() - return True - -try: - initData = Ice.InitializationData() - initData.properties = Ice.createProperties(sys.argv) - initData.properties.setProperty("Ice.Warn.Connections", "0") - initData.properties.setProperty("Ice.Warn.Dispatch", "0") - with Ice.initialize(sys.argv, initData) 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.Connections", "0") + properties.setProperty("Ice.Warn.Dispatch", "0") + with self.initialize(properties=properties) as communicator: + communicator.getProperties().setProperty("TestAdapter.Endpoints", self.getTestEndpoint()) + adapter = communicator.createObjectAdapter("TestAdapter") + adapter.add(MyDerivedClassI(), Ice.stringToIdentity("test")) + adapter.activate() + communicator.waitForShutdown() diff --git a/python/test/Ice/scope/Server.py b/python/test/Ice/scope/Server.py index 9d708d843d4..529b8c42ac3 100755 --- a/python/test/Ice/scope/Server.py +++ b/python/test/Ice/scope/Server.py @@ -114,7 +114,7 @@ class I4(Inner.Test.Inner2.I): class Server(TestHelper): def run(self, args): - with self.initialize(args) as communicator: + with self.initialize(args=args) as communicator: communicator.getProperties().setProperty("TestAdapter.Endpoints", self.getTestEndpoint()) adapter = communicator.createObjectAdapter("TestAdapter") adapter.add(I1(), Ice.stringToIdentity("i1")) diff --git a/python/test/Ice/servantLocator/AllTests.py b/python/test/Ice/servantLocator/AllTests.py index 4c860a80c31..58b4b9d9b74 100644 --- a/python/test/Ice/servantLocator/AllTests.py +++ b/python/test/Ice/servantLocator/AllTests.py @@ -174,7 +174,7 @@ def allTests(helper, communicator): sys.stdout.flush() base = communicator.stringToProxy("anothercat/locate:{0}".format(helper.getTestEndpoint())) obj = Test.TestIntfPrx.checkedCast(base) - base = communicator.stringToProxy("locate:default -p 12010") + base = communicator.stringToProxy("locate:{0}".format(helper.getTestEndpoint())) obj = Test.TestIntfPrx.checkedCast(base) try: Test.TestIntfPrx.checkedCast( diff --git a/python/test/TestHelper.py b/python/test/TestHelper.py index c4ffb17f32a..8fd35ad9d4b 100644 --- a/python/test/TestHelper.py +++ b/python/test/TestHelper.py @@ -55,7 +55,7 @@ class TestHelper: def createTestProperties(self, args=[]): properties = Ice.createProperties(args) - properties.parseCommandLineOptions("Test", args) + args = properties.parseCommandLineOptions("Test", args) return properties def initialize(self, initData=None, properties=None, args=[]): diff --git a/scripts/Util.py b/scripts/Util.py index ce3d3a17958..201c2343c90 100644 --- a/scripts/Util.py +++ b/scripts/Util.py @@ -541,7 +541,7 @@ class Mapping(object): # check the configuration type) self.uwp = False self.openssl = False - + self.browser = False self.device = "" self.avd = "" self.androidemulator = False @@ -1825,12 +1825,12 @@ class TestSuite(object): for m in [XamarinUWPMapping, AndroidMappingMixin, XamarinIOSMapping]: if isinstance(self.mapping, m): return True - for m in [CppMapping, JavaMapping, CSharpMapping]: + for m in [CppMapping, JavaMapping, CSharpMapping, PythonMapping, JavaScriptMapping]: if component.isMainThreadOnly(self.id): return True elif isinstance(self.mapping, m): config = driver.configs[self.mapping] - if "iphone" in config.buildPlatform or config.uwp: + if "iphone" in config.buildPlatform or config.uwp or config.browser: return True # Not supported yet for tests that require a remote process controller return self.runOnMainThread else: |