diff options
author | Jose <jose@zeroc.com> | 2019-07-30 12:45:29 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2019-07-31 13:13:40 +0200 |
commit | 3e71d9e1a29bc8169452b039bb723406ff8ef0fe (patch) | |
tree | cfde39529b1a21d6f4c4e87b2a92a366eafc9993 /java | |
parent | Update .npmignore to ignore .tgz files (diff) | |
download | ice-3e71d9e1a29bc8169452b039bb723406ff8ef0fe.tar.bz2 ice-3e71d9e1a29bc8169452b039bb723406ff8ef0fe.tar.xz ice-3e71d9e1a29bc8169452b039bb723406ff8ef0fe.zip |
Fixes for C++ & Swift generated code - Close #458
Diffstat (limited to 'java')
-rw-r--r-- | java/test/src/main/java/test/Ice/scope/AllTests.java | 18 | ||||
-rw-r--r-- | java/test/src/main/java/test/Ice/scope/Client.java | 2 | ||||
-rw-r--r-- | java/test/src/main/java/test/Ice/scope/Server.java | 18 | ||||
-rw-r--r-- | java/test/src/main/java/test/Ice/scope/Test.ice | 35 |
4 files changed, 72 insertions, 1 deletions
diff --git a/java/test/src/main/java/test/Ice/scope/AllTests.java b/java/test/src/main/java/test/Ice/scope/AllTests.java index 04f2b728cb0..da912190a85 100644 --- a/java/test/src/main/java/test/Ice/scope/AllTests.java +++ b/java/test/src/main/java/test/Ice/scope/AllTests.java @@ -56,6 +56,15 @@ public class AllTests test.Ice.scope.Test.I.OpCMapResult opCMapResult = i.opCMap(cmap1); test(opCMapResult.returnValue.get("a").s.equals(s1)); test(opCMapResult.c2.get("a").s.equals(s1)); + + test.Ice.scope.Test.E1 e = i.opE1(test.Ice.scope.Test.E1.v1); + test(e == test.Ice.scope.Test.E1.v1); + + test.Ice.scope.Test.S1 s = i.opS1(new test.Ice.scope.Test.S1("S1")); + test(s.s.equals("S1")); + + test.Ice.scope.Test.C1 c = i.opC1(new test.Ice.scope.Test.C1("C1")); + test(c.s.equals("C1")); } { @@ -93,6 +102,15 @@ public class AllTests test.Ice.scope.Test.I.OpCMapResult opCMapResult = i.opCMapAsync(cmap1).join(); test(opCMapResult.returnValue.get("a").s.equals(s1)); test(opCMapResult.c2.get("a").s.equals(s1)); + + test.Ice.scope.Test.E1 e = i.opE1Async(test.Ice.scope.Test.E1.v1).join(); + test(e == test.Ice.scope.Test.E1.v1); + + test.Ice.scope.Test.S1 s = i.opS1Async(new test.Ice.scope.Test.S1("S1")).join(); + test(s.s.equals("S1")); + + test.Ice.scope.Test.C1 c = i.opC1Async(new test.Ice.scope.Test.C1("C1")).join(); + test(c.s.equals("C1")); } { diff --git a/java/test/src/main/java/test/Ice/scope/Client.java b/java/test/src/main/java/test/Ice/scope/Client.java index 8bb082f5f2f..f05187ebd4b 100644 --- a/java/test/src/main/java/test/Ice/scope/Client.java +++ b/java/test/src/main/java/test/Ice/scope/Client.java @@ -13,7 +13,7 @@ public class Client extends test.TestHelper java.io.PrintWriter out = getWriter(); try(com.zeroc.Ice.Communicator communicator = initialize(properties)) { - out.print("test same Slice type name in different scopes... "); + out.print("test using same type name in different Slice modules... "); out.flush(); AllTests.allTests(this); out.println("ok"); diff --git a/java/test/src/main/java/test/Ice/scope/Server.java b/java/test/src/main/java/test/Ice/scope/Server.java index 516f4bd4160..149ca6bf597 100644 --- a/java/test/src/main/java/test/Ice/scope/Server.java +++ b/java/test/src/main/java/test/Ice/scope/Server.java @@ -62,6 +62,24 @@ public class Server extends test.TestHelper return result; } + public test.Ice.scope.Test.E1 + opE1(test.Ice.scope.Test.E1 e1, com.zeroc.Ice.Current current) + { + return e1; + } + + public test.Ice.scope.Test.S1 + opS1(test.Ice.scope.Test.S1 s1, com.zeroc.Ice.Current current) + { + return s1; + } + + public test.Ice.scope.Test.C1 + opC1(test.Ice.scope.Test.C1 e1, com.zeroc.Ice.Current current) + { + return e1; + } + public void shutdown(com.zeroc.Ice.Current current) { current.adapter.getCommunicator().shutdown(); diff --git a/java/test/src/main/java/test/Ice/scope/Test.ice b/java/test/src/main/java/test/Ice/scope/Test.ice index 98e620d0e8f..8eb753f9977 100644 --- a/java/test/src/main/java/test/Ice/scope/Test.ice +++ b/java/test/src/main/java/test/Ice/scope/Test.ice @@ -23,6 +23,37 @@ module Test dictionary<string, C> CMap; sequence<C> CSeq; + enum E1 + { + v1, + v2, + v3 + } + + struct S1 + { + string s; + } + + class C1 + { + string s; + } + + struct S2 + { + E1 E1; + S1 S1; + C1 C1; + } + + class C2 + { + E1 E1; + S1 S1; + C1 C1; + } + interface I { S opS(S s1, out S s2); @@ -33,6 +64,10 @@ module Test CSeq opCSeq(CSeq c1, out CSeq c2); CMap opCMap(CMap c1, out CMap c2); + E1 opE1(E1 E1); + S1 opS1(S1 S1); + C1 opC1(C1 C1); + void shutdown(); } |