diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/test/Common/TestSuites.json | 2 | ||||
-rw-r--r-- | js/test/Ice/operations/AMDBI.js | 24 | ||||
-rw-r--r-- | js/test/Ice/operations/BI.js | 24 | ||||
-rw-r--r-- | js/test/Ice/operations/Client.js | 5 | ||||
-rw-r--r-- | js/test/Ice/operations/Server.js | 2 | ||||
-rw-r--r-- | js/test/Ice/operations/ServerAMD.js | 2 | ||||
-rw-r--r-- | js/test/Ice/operations/Test.ice | 25 | ||||
-rw-r--r-- | js/test/Ice/operations/Twoways.js | 8 |
8 files changed, 88 insertions, 4 deletions
diff --git a/js/test/Common/TestSuites.json b/js/test/Common/TestSuites.json index 4e1989179db..652d6c792f4 100644 --- a/js/test/Common/TestSuites.json +++ b/js/test/Common/TestSuites.json @@ -70,7 +70,7 @@ "Ice/operations": { "files": ["Test.js", "Twoways.js", "Oneways.js", "BatchOneways.js", "Client.js", - "MyDerivedClassI.js", "AMDMyDerivedClassI.js", "Server.js", "ServerAMD.js"] + "AMDBI.js", "BI.js", "MyDerivedClassI.js", "AMDMyDerivedClassI.js", "Server.js", "ServerAMD.js"] }, "Ice/objects": { diff --git a/js/test/Ice/operations/AMDBI.js b/js/test/Ice/operations/AMDBI.js new file mode 100644 index 00000000000..5aa44793d9b --- /dev/null +++ b/js/test/Ice/operations/AMDBI.js @@ -0,0 +1,24 @@ +// +// Copyright (c) ZeroC, Inc. All rights reserved. +// + +(function(module, require, exports) +{ + const M = require("Test").M; + + class AMDBI extends M.BDisp + { + opB() + { + } + + opIntf() + { + } + } + exports.AMDBI = AMDBI; +}(typeof global !== "undefined" && typeof global.process !== "undefined" ? module : undefined, + typeof global !== "undefined" && typeof global.process !== "undefined" ? require : + (typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope) ? self.Ice._require : window.Ice._require, + typeof global !== "undefined" && typeof global.process !== "undefined" ? exports : + (typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope) ? self : window)); diff --git a/js/test/Ice/operations/BI.js b/js/test/Ice/operations/BI.js new file mode 100644 index 00000000000..18e484decc1 --- /dev/null +++ b/js/test/Ice/operations/BI.js @@ -0,0 +1,24 @@ +// +// Copyright (c) ZeroC, Inc. All rights reserved. +// + +(function(module, require, exports) +{ + const M = require("Test").M; + + class BI extends M.BDisp + { + opB() + { + } + + opIntf() + { + } + } + exports.BI = BI; +}(typeof global !== "undefined" && typeof global.process !== "undefined" ? module : undefined, + typeof global !== "undefined" && typeof global.process !== "undefined" ? require : + (typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope) ? self.Ice._require : window.Ice._require, + typeof global !== "undefined" && typeof global.process !== "undefined" ? exports : + (typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope) ? self : window)); diff --git a/js/test/Ice/operations/Client.js b/js/test/Ice/operations/Client.js index 7b3e91e1b0e..d6e55f75fd5 100644 --- a/js/test/Ice/operations/Client.js +++ b/js/test/Ice/operations/Client.js @@ -6,6 +6,7 @@ { const Ice = require("ice").Ice; const Test = require("Test").Test; + const M = require("Test").M; const TestHelper = require("TestHelper").TestHelper; const Twoways = require("Twoways").Twoways; const Oneways = require("Oneways").Oneways; @@ -23,8 +24,8 @@ const cl = await Test.MyClassPrx.checkedCast(base); const derived = await Test.MyDerivedClassPrx.checkedCast(cl); - await Twoways.run(communicator, cl, Test, bidir, this); - await Twoways.run(communicator, derived, Test, bidir, this); + await Twoways.run(communicator, cl, Test, M, bidir, this); + await Twoways.run(communicator, derived, Test, M, bidir, this); out.writeLine("ok"); out.write("testing oneway operations... "); diff --git a/js/test/Ice/operations/Server.js b/js/test/Ice/operations/Server.js index 6a1a45e95d9..fc023090ba9 100644 --- a/js/test/Ice/operations/Server.js +++ b/js/test/Ice/operations/Server.js @@ -8,6 +8,7 @@ const Test = require("Test").Test; const TestHelper = require("TestHelper").TestHelper; const MyDerivedClassI = require("MyDerivedClassI").MyDerivedClassI; + const BI = require("BI").BI; class Server extends TestHelper { @@ -23,6 +24,7 @@ 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")); + adapter.add(new BI(), Ice.stringToIdentity("b")); await echo.setConnection(); echo.ice_getCachedConnection().setAdapter(adapter); this.serverReady(); diff --git a/js/test/Ice/operations/ServerAMD.js b/js/test/Ice/operations/ServerAMD.js index 1260960957b..6995ff1c08c 100644 --- a/js/test/Ice/operations/ServerAMD.js +++ b/js/test/Ice/operations/ServerAMD.js @@ -8,6 +8,7 @@ const Test = require("Test").Test; const TestHelper = require("TestHelper").TestHelper; const AMDMyDerivedClassI = require("AMDMyDerivedClassI").AMDMyDerivedClassI; + const AMDBI = require("AMDBI").AMDBI; class ServerAMD extends TestHelper { @@ -23,6 +24,7 @@ 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")); + adapter.add(new AMDBI(), Ice.stringToIdentity("b")); await echo.setConnection(); echo.ice_getCachedConnection().setAdapter(adapter); this.serverReady(); diff --git a/js/test/Ice/operations/Test.ice b/js/test/Ice/operations/Test.ice index 2f2810c9dca..153e9bc699a 100644 --- a/js/test/Ice/operations/Test.ice +++ b/js/test/Ice/operations/Test.ice @@ -6,6 +6,8 @@ #include <Ice/Current.ice> +[["suppress-warning:deprecated"]] // For classes with operations + module Test { @@ -372,3 +374,26 @@ interface MyDerivedClass extends Test::MyClass } } + +// +// Test proxy inheritance for class with operations +// see: https://github.com/zeroc-ice/ice/issues/406 +// +module M +{ + class A + { + int x; + // void opA(); + } + + interface Intf + { + void opIntf(); + } + + class B extends A implements Intf + { + void opB(); + } +} diff --git a/js/test/Ice/operations/Twoways.js b/js/test/Ice/operations/Twoways.js index 4bc92fd8b40..d0822052ceb 100644 --- a/js/test/Ice/operations/Twoways.js +++ b/js/test/Ice/operations/Twoways.js @@ -7,7 +7,7 @@ const Ice = require("ice").Ice; const test = require("TestHelper").TestHelper.test; - async function run(communicator, prx, Test, bidir, helper) + async function run(communicator, prx, Test, M, bidir, helper) { const literals = await prx.opStringLiterals(); @@ -1472,6 +1472,12 @@ } await prx.opDoubleMarshaling(1278312346.0 / 13.0, ds); } + + { + const b = M.BPrx.uncheckedCast(communicator.stringToProxy("b:" + helper.getTestEndpoint())); + await b.opB(); + await b.opIntf(); + } } exports.Twoways = {run: run}; |