diff options
Diffstat (limited to 'python/test/Ice/proxy/ServerAMD.py')
-rwxr-xr-x | python/test/Ice/proxy/ServerAMD.py | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/python/test/Ice/proxy/ServerAMD.py b/python/test/Ice/proxy/ServerAMD.py index c767ac44efb..6a310161383 100755 --- a/python/test/Ice/proxy/ServerAMD.py +++ b/python/test/Ice/proxy/ServerAMD.py @@ -19,28 +19,27 @@ if not slice_dir: Ice.loadSlice("'-I" + slice_dir + "' TestAMD.ice") import Test -class MyDerivedClassI(Test.MyDerivedClass): +class MyDerivedClassI(Test._MyDerivedClassDisp): def __init__(self): self.ctx = None - def shutdown_async(self, cb, current=None): + def shutdown(self, current=None): current.adapter.getCommunicator().shutdown() - cb.ice_response() - def getContext_async(self, cb, current): - return cb.ice_response(self.ctx) + def getContext(self, current): + return Ice.Future.completed(self.ctx) - def echo_async(self, cb, obj, current): - return cb.ice_response(obj) + def echo(self, obj, current): + return Ice.Future.completed(obj) def ice_isA(self, s, current): self.ctx = current.ctx - return Test.MyDerivedClass.ice_isA(self, s, current) + return Test._MyDerivedClassDisp.ice_isA(self, s, current) def run(args, communicator): communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp") adapter = communicator.createObjectAdapter("TestAdapter") - adapter.add(MyDerivedClassI(), communicator.stringToIdentity("test")) + adapter.add(MyDerivedClassI(), Ice.stringToIdentity("test")) adapter.activate() communicator.waitForShutdown() return True @@ -50,17 +49,10 @@ try: initData.properties = Ice.createProperties(sys.argv) initData.properties.setProperty("Ice.Warn.Connections", "0") initData.properties.setProperty("Ice.Warn.Dispatch", "0") - communicator = Ice.initialize(sys.argv, initData) - status = run(sys.argv, communicator) + with Ice.initialize(sys.argv, initData) as communicator: + status = run(sys.argv, communicator) except: traceback.print_exc() status = False -if communicator: - try: - communicator.destroy() - except: - traceback.print_exc() - status = False - sys.exit(not status) |