summaryrefslogtreecommitdiff
path: root/java-compat
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2019-07-30 12:45:29 +0200
committerJose <jose@zeroc.com>2019-07-31 13:13:40 +0200
commit3e71d9e1a29bc8169452b039bb723406ff8ef0fe (patch)
treecfde39529b1a21d6f4c4e87b2a92a366eafc9993 /java-compat
parentUpdate .npmignore to ignore .tgz files (diff)
downloadice-3e71d9e1a29bc8169452b039bb723406ff8ef0fe.tar.bz2
ice-3e71d9e1a29bc8169452b039bb723406ff8ef0fe.tar.xz
ice-3e71d9e1a29bc8169452b039bb723406ff8ef0fe.zip
Fixes for C++ & Swift generated code - Close #458
Diffstat (limited to 'java-compat')
-rw-r--r--java-compat/test/src/main/java/test/Ice/scope/AllTests.java18
-rw-r--r--java-compat/test/src/main/java/test/Ice/scope/Client.java2
-rw-r--r--java-compat/test/src/main/java/test/Ice/scope/Server.java18
-rw-r--r--java-compat/test/src/main/java/test/Ice/scope/Test.ice35
4 files changed, 72 insertions, 1 deletions
diff --git a/java-compat/test/src/main/java/test/Ice/scope/AllTests.java b/java-compat/test/src/main/java/test/Ice/scope/AllTests.java
index 79233bf445a..8c3ce3a5b07 100644
--- a/java-compat/test/src/main/java/test/Ice/scope/AllTests.java
+++ b/java-compat/test/src/main/java/test/Ice/scope/AllTests.java
@@ -95,6 +95,15 @@ public class AllTests
java.util.Map<String, test.Ice.scope.Test.C> cmap3 = i.opCMap(cmap1, cmap2);
test(cmap2.value.get("a").s.equals(s1));
test(cmap3.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"));
}
{
@@ -138,6 +147,15 @@ public class AllTests
java.util.Map<String, test.Ice.scope.Test.C> cmap3 = i.end_opCMap(cmap2, i.begin_opCMap(cmap1));
test(cmap2.value.get("a").s.equals(s1));
test(cmap3.get("a").s.equals(s1));
+
+ test.Ice.scope.Test.E1 e = i.end_opE1(i.begin_opE1(test.Ice.scope.Test.E1.v1));
+ test(e == test.Ice.scope.Test.E1.v1);
+
+ test.Ice.scope.Test.S1 s = i.end_opS1(i.begin_opS1(new test.Ice.scope.Test.S1("S1")));
+ test(s.s.equals("S1"));
+
+ test.Ice.scope.Test.C1 c = i.end_opC1(i.begin_opC1(new test.Ice.scope.Test.C1("C1")));
+ test(c.s.equals("C1"));
}
{
diff --git a/java-compat/test/src/main/java/test/Ice/scope/Client.java b/java-compat/test/src/main/java/test/Ice/scope/Client.java
index 6d3c86d6e70..6706fe08afb 100644
--- a/java-compat/test/src/main/java/test/Ice/scope/Client.java
+++ b/java-compat/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(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-compat/test/src/main/java/test/Ice/scope/Server.java b/java-compat/test/src/main/java/test/Ice/scope/Server.java
index bc78df4abf6..43b3bf6284e 100644
--- a/java-compat/test/src/main/java/test/Ice/scope/Server.java
+++ b/java-compat/test/src/main/java/test/Ice/scope/Server.java
@@ -55,6 +55,24 @@ public class Server extends test.TestHelper
return c1;
}
+ public test.Ice.scope.Test.E1
+ opE1(test.Ice.scope.Test.E1 e1, Ice.Current current)
+ {
+ return e1;
+ }
+
+ public test.Ice.scope.Test.S1
+ opS1(test.Ice.scope.Test.S1 s1, Ice.Current current)
+ {
+ return s1;
+ }
+
+ public test.Ice.scope.Test.C1
+ opC1(test.Ice.scope.Test.C1 c1, Ice.Current current)
+ {
+ return c1;
+ }
+
public void shutdown(Ice.Current current)
{
current.adapter.getCommunicator().shutdown();
diff --git a/java-compat/test/src/main/java/test/Ice/scope/Test.ice b/java-compat/test/src/main/java/test/Ice/scope/Test.ice
index 98e620d0e8f..8eb753f9977 100644
--- a/java-compat/test/src/main/java/test/Ice/scope/Test.ice
+++ b/java-compat/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();
}