diff options
author | Joe George <joe@zeroc.com> | 2015-12-23 14:48:40 -0500 |
---|---|---|
committer | Joe George <joe@zeroc.com> | 2015-12-24 10:01:11 -0500 |
commit | e84da5f580821cae8dab292e19cc1296c07a8ed5 (patch) | |
tree | 1e8783c55c7dccd5adda2b87b47b8a7c118a1147 /python/test/Ice/acm | |
parent | Fixes related to EnableSharedFromThis (diff) | |
download | ice-e84da5f580821cae8dab292e19cc1296c07a8ed5.tar.bz2 ice-e84da5f580821cae8dab292e19cc1296c07a8ed5.tar.xz ice-e84da5f580821cae8dab292e19cc1296c07a8ed5.zip |
ICE-6898 - "Delegate" functions for ACM callbacks
- Add delegate local interfaces CloseCallback and HeartbeatCallback and
remove ConnectionCallback.
- Replace setCallback by setCloseCallback and setHeartbeatCallback
Diffstat (limited to 'python/test/Ice/acm')
-rw-r--r-- | python/test/Ice/acm/AllTests.py | 6 | ||||
-rw-r--r-- | python/test/Ice/acm/TestI.py | 7 |
2 files changed, 6 insertions, 7 deletions
diff --git a/python/test/Ice/acm/AllTests.py b/python/test/Ice/acm/AllTests.py index 60844870090..816c9b94ab4 100644 --- a/python/test/Ice/acm/AllTests.py +++ b/python/test/Ice/acm/AllTests.py @@ -74,7 +74,7 @@ class LoggerI(Ice.Logger): print(p) self._messages = [] -class TestCase(threading.Thread, Ice.ConnectionCallback): +class TestCase(threading.Thread): def __init__(self, name, com): threading.Thread.__init__(self) self._name = name @@ -128,7 +128,9 @@ class TestCase(threading.Thread, Ice.ConnectionCallback): proxy = Test.TestIntfPrx.uncheckedCast(self._communicator.stringToProxy( self._adapter.getTestIntf().ice_toString())) try: - proxy.ice_getConnection().setCallback(self) + proxy.ice_getConnection().setCloseCallback(lambda conn: self.closed(conn)) + proxy.ice_getConnection().setHeartbeatCallback(lambda conn: self.heartbeat(conn)) + self.runTestCase(self._adapter, proxy) except Exception as ex: self._msg = "unexpected exception:\n" + traceback.format_exc() diff --git a/python/test/Ice/acm/TestI.py b/python/test/Ice/acm/TestI.py index 024899b8640..ee0625dc057 100644 --- a/python/test/Ice/acm/TestI.py +++ b/python/test/Ice/acm/TestI.py @@ -79,7 +79,7 @@ class TestIntfI(Test.TestIntf): def waitForHeartbeat(self, count, current=None): - class ConnectionCallbackI(Ice.ConnectionCallback): + class ConnectionCallbackI(): def __init__(self): self.m = threading.Condition() @@ -93,9 +93,6 @@ class TestIntfI(Test.TestIntf): finally: self.m.release() - def closed(self, con): - pass - def waitForCount(self, count): self.m.acquire() self.count = count @@ -106,6 +103,6 @@ class TestIntfI(Test.TestIntf): self.m.release() callback = ConnectionCallbackI() - current.con.setCallback(callback) + current.con.setHeartbeatCallback(lambda con: callback.heartbeat(con)) callback.waitForCount(2) |