diff options
author | Bernard Normier <bernard@zeroc.com> | 2018-11-13 15:52:14 -0500 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2018-11-13 15:52:14 -0500 |
commit | a5854cfd05fa6aa5b7cc50ecbfcc9336fb32412c (patch) | |
tree | 58b9f74f2132985fe15913f1a7f65e82121b8eba /java-compat/test | |
parent | Fix failure related to Slice Scanner fixes (diff) | |
download | ice-a5854cfd05fa6aa5b7cc50ecbfcc9336fb32412c.tar.bz2 ice-a5854cfd05fa6aa5b7cc50ecbfcc9336fb32412c.tar.xz ice-a5854cfd05fa6aa5b7cc50ecbfcc9336fb32412c.zip |
More bidir tests. Fixes #51.
Diffstat (limited to 'java-compat/test')
3 files changed, 39 insertions, 3 deletions
diff --git a/java-compat/test/lambda/src/main/java/Ice/ami/lambda/AMI.java b/java-compat/test/lambda/src/main/java/Ice/ami/lambda/AMI.java index e2d18f23939..b1606c063f3 100644 --- a/java-compat/test/lambda/src/main/java/Ice/ami/lambda/AMI.java +++ b/java-compat/test/lambda/src/main/java/Ice/ami/lambda/AMI.java @@ -15,6 +15,8 @@ import test.Ice.ami.Test.TestIntfPrx; import test.Ice.ami.Test.TestIntfPrxHelper; import test.Ice.ami.Test.TestIntfControllerPrx; import test.Ice.ami.Test.TestIntfControllerPrxHelper; +import test.Ice.ami.Test.PingReplyPrx; +import test.Ice.ami.Test.PingReplyPrxHelper; import test.Ice.ami.Test.TestIntfException; import test.Ice.ami.Test.Callback_TestIntf_op; import test.Ice.ami.Test.Callback_TestIntf_opWithResult; @@ -32,6 +34,22 @@ public class AMI } } + public static class PingReplyI extends test.Ice.ami.Test._PingReplyDisp + { + @Override + public void reply(Ice.Current current) + { + _received = true; + } + + public boolean checkReceived() + { + return _received; + } + + private boolean _received = false; + } + private static class CallbackBase { CallbackBase() @@ -1151,5 +1169,20 @@ public class AMI // Excepted when response and exception callback are both null. } out.println("ok"); + + if(!collocated) + { + out.print("testing bidir..."); + Ice.ObjectAdapter adapter = communicator.createObjectAdapter(""); + PingReplyI replyI = new PingReplyI(); + PingReplyPrx reply = PingReplyPrxHelper.uncheckedCast(adapter.addWithUUID(replyI)); + adapter.activate(); + + p.ice_getConnection().setAdapter(adapter); + p.pingBiDir(reply); + test(replyI.checkReceived()); + adapter.destroy(); + out.println("ok"); + } } } diff --git a/java-compat/test/src/main/java/test/Ice/ami/Test.ice b/java-compat/test/src/main/java/test/Ice/ami/Test.ice index 37ba5fc14c4..00374df0262 100644 --- a/java-compat/test/src/main/java/test/Ice/ami/Test.ice +++ b/java-compat/test/src/main/java/test/Ice/ami/Test.ice @@ -58,7 +58,7 @@ interface TestIntf float opFloat(float f); double opDouble(double d); - void pingBiDir(Ice::Identity id); + void pingBiDir(PingReply* reply); } interface TestIntfController diff --git a/java-compat/test/src/main/java/test/Ice/ami/TestI.java b/java-compat/test/src/main/java/test/Ice/ami/TestI.java index 61f23cf8696..1ea1830d665 100644 --- a/java-compat/test/src/main/java/test/Ice/ami/TestI.java +++ b/java-compat/test/src/main/java/test/Ice/ami/TestI.java @@ -13,6 +13,7 @@ import test.Ice.ami.Test._TestIntfDisp; import test.Ice.ami.Test.AMD_TestIntf_startDispatch; import test.Ice.ami.Test.CloseMode; import test.Ice.ami.Test.TestIntfException; +import test.Ice.ami.Test.PingReplyPrx; import test.Ice.ami.Test.PingReplyPrxHelper; public class TestI extends _TestIntfDisp @@ -118,9 +119,11 @@ public class TestI extends _TestIntfDisp } @Override - public void pingBiDir(Ice.Identity id, Ice.Current current) + public void pingBiDir(PingReplyPrx reply, Ice.Current current) { - PingReplyPrxHelper.uncheckedCast(current.con.createProxy(id)).reply(); + reply = PingReplyPrxHelper.uncheckedCast(reply.ice_fixed(current.con)); + Ice.AsyncResult result = reply.begin_reply(); + reply.end_reply(result); } @Override |