summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2019-06-06 19:24:20 +0200
committerJose <jose@zeroc.com>2019-06-06 19:24:20 +0200
commit2dc0a8799e913bb37db8c5895f00f4dda920df62 (patch)
tree6dd9fe720314d92fecedb703132c5cf73082ca3f /js
parentDo not set WindowsTargetPlatformVersion, use the default (diff)
downloadice-2dc0a8799e913bb37db8c5895f00f4dda920df62.tar.bz2
ice-2dc0a8799e913bb37db8c5895f00f4dda920df62.tar.xz
ice-2dc0a8799e913bb37db8c5895f00f4dda920df62.zip
Fix Incorrect generated code for class implements interface
Close #406
Diffstat (limited to 'js')
-rw-r--r--js/test/Ice/operations/AMDBI.js25
-rw-r--r--js/test/Ice/operations/BI.js25
-rw-r--r--js/test/Ice/operations/Client.js5
-rw-r--r--js/test/Ice/operations/Server.js2
-rw-r--r--js/test/Ice/operations/ServerAMD.js2
-rw-r--r--js/test/Ice/operations/Test.ice25
-rw-r--r--js/test/Ice/operations/Twoways.js8
7 files changed, 89 insertions, 3 deletions
diff --git a/js/test/Ice/operations/AMDBI.js b/js/test/Ice/operations/AMDBI.js
new file mode 100644
index 00000000000..bed043ea383
--- /dev/null
+++ b/js/test/Ice/operations/AMDBI.js
@@ -0,0 +1,25 @@
+//
+// Copyright (c) ZeroC, Inc. All rights reserved.
+//
+
+(function(module, require, exports)
+{
+ const Ice = require("ice").Ice;
+ 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..a68ea03ccae
--- /dev/null
+++ b/js/test/Ice/operations/BI.js
@@ -0,0 +1,25 @@
+//
+// Copyright (c) ZeroC, Inc. All rights reserved.
+//
+
+(function(module, require, exports)
+{
+ const Ice = require("ice").Ice;
+ 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};