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 /python/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 'python/test')
-rw-r--r-- | python/test/Ice/ami/AllTests.py | 26 | ||||
-rw-r--r-- | python/test/Ice/ami/Test.ice | 2 | ||||
-rw-r--r-- | python/test/Ice/ami/TestI.py | 5 |
3 files changed, 30 insertions, 3 deletions
diff --git a/python/test/Ice/ami/AllTests.py b/python/test/Ice/ami/AllTests.py index a85a640dab5..9624bc6c786 100644 --- a/python/test/Ice/ami/AllTests.py +++ b/python/test/Ice/ami/AllTests.py @@ -13,6 +13,17 @@ def test(b): if not b: raise RuntimeError('test assertion failed') +class PingReplyI(Test.PingReply): + def __init__(self): + self._received = False + + def reply(self, current=None): + self._received = True + + def checkReceived(self): + return self._received + + class CallbackBase: def __init__(self): self._called = False @@ -1399,6 +1410,21 @@ def allTestsFuture(helper, communicator, collocated): p.opWithUEAsync(ctx).add_done_callback(cb.opWithUE) cb.check() + # + # TODO: test add_done_callback_async + # + + if not collocated: + adapter = communicator.createObjectAdapter("") + replyI = PingReplyI() + reply = Test.PingReplyPrx.uncheckedCast(adapter.addWithUUID(replyI)) + adapter.activate() + + p.ice_getConnection().setAdapter(adapter) + p.pingBiDir(reply) + test(replyI.checkReceived()) + adapter.destroy() + print("ok") sys.stdout.write("testing local exceptions... ") diff --git a/python/test/Ice/ami/Test.ice b/python/test/Ice/ami/Test.ice index 6ddfca74b25..c614fe5cf27 100644 --- a/python/test/Ice/ami/Test.ice +++ b/python/test/Ice/ami/Test.ice @@ -50,7 +50,7 @@ interface TestIntf bool supportsAMD(); bool supportsFunctionalTests(); - void pingBiDir(Ice::Identity id); + void pingBiDir(PingReply* reply); } interface TestIntfController diff --git a/python/test/Ice/ami/TestI.py b/python/test/Ice/ami/TestI.py index 757a9afa598..fe89da38c6f 100644 --- a/python/test/Ice/ami/TestI.py +++ b/python/test/Ice/ami/TestI.py @@ -86,8 +86,9 @@ class TestIntfI(Test.TestIntf): def supportsFunctionalTests(self, current=None): return False - def pingBiDir(self, id, current = None): - Test.PingReplyPrx.uncheckedCast(current.con.createProxy(id)).reply() + def pingBiDir(self, reply, current=None): + # TODO: verify correct thread with add_done_callback_async + reply.ice_fixed(current.con).replyAsync().result() class TestIntfII(Test.Outer.Inner.TestIntf): def op(self, i, current): |