diff options
author | Jose <jose@zeroc.com> | 2014-09-24 21:06:55 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2014-09-24 21:06:55 +0200 |
commit | b1087d646fa93c4208dd227d0c9df323ff7c858b (patch) | |
tree | 48532138bffdfac0dc5c818593d9c1958cfeeeb5 /py/test/Ice/exceptions/AllTests.py | |
parent | PHP dependency fixes (diff) | |
download | ice-b1087d646fa93c4208dd227d0c9df323ff7c858b.tar.bz2 ice-b1087d646fa93c4208dd227d0c9df323ff7c858b.tar.xz ice-b1087d646fa93c4208dd227d0c9df323ff7c858b.zip |
Fixed (ICE-5511) - Consider removing the deprecated AMI mapping
Diffstat (limited to 'py/test/Ice/exceptions/AllTests.py')
-rw-r--r-- | py/test/Ice/exceptions/AllTests.py | 364 |
1 files changed, 8 insertions, 356 deletions
diff --git a/py/test/Ice/exceptions/AllTests.py b/py/test/Ice/exceptions/AllTests.py index 9c3f347a6d5..e49b2dfcc9c 100644 --- a/py/test/Ice/exceptions/AllTests.py +++ b/py/test/Ice/exceptions/AllTests.py @@ -53,235 +53,6 @@ class CallbackBase: self._cond.notify() self._cond.release() -class AMI_Thrower_throwAasAI(CallbackBase): - def ice_response(self): - test(False) - - def ice_exception(self, ex): - try: - raise ex - except Test.A as ex: - test(ex.aMem == 1) - except: - test(False) - self.called() - -class AMI_Thrower_throwAasAObjectNotExistI(CallbackBase): - def __init__(self, communicator): - CallbackBase.__init__(self) - self._communicator = communicator - - def ice_response(self): - test(False) - - def ice_exception(self, ex): - try: - raise ex - except Ice.ObjectNotExistException as ex: - id = self._communicator.stringToIdentity("does not exist") - test(ex.id == id) - except: - test(False) - self.called() - -class AMI_Thrower_throwAasAFacetNotExistI(CallbackBase): - def ice_response(self): - test(False) - - def ice_exception(self, ex): - try: - raise ex - except Ice.FacetNotExistException as ex: - test(ex.facet == "no such facet") - except: - test(False) - self.called() - -class AMI_Thrower_throwAorDasAorDI(CallbackBase): - def ice_response(self): - test(False) - - def ice_exception(self, ex): - try: - raise ex - except Test.A as ex: - test(ex.aMem == 1) - except Test.D as ex: - test(ex.dMem == -1) - except: - test(False) - self.called() - -class AMI_Thrower_throwBasAI(CallbackBase): - def ice_response(self): - test(False) - - def ice_exception(self, ex): - try: - raise ex - except Test.B as ex: - test(ex.aMem == 1) - test(ex.bMem == 2) - except: - test(False) - self.called() - -class AMI_Thrower_throwCasAI(CallbackBase): - def ice_response(self): - test(False) - - def ice_exception(self, ex): - try: - raise ex - except Test.C as ex: - test(ex.aMem == 1) - test(ex.bMem == 2) - test(ex.cMem == 3) - except: - test(False) - self.called() - -class AMI_Thrower_throwBasBI(CallbackBase): - def ice_response(self): - test(False) - - def ice_exception(self, ex): - try: - raise ex - except Test.B as ex: - test(ex.aMem == 1) - test(ex.bMem == 2) - except: - test(False) - self.called() - -class AMI_Thrower_throwCasBI(CallbackBase): - def ice_response(self): - test(False) - - def ice_exception(self, ex): - try: - raise ex - except Test.C as ex: - test(ex.aMem == 1) - test(ex.bMem == 2) - test(ex.cMem == 3) - except: - test(False) - self.called() - -class AMI_Thrower_throwCasCI(CallbackBase): - def ice_response(self): - test(False) - - def ice_exception(self, ex): - try: - raise ex - except Test.C as ex: - test(ex.aMem == 1) - test(ex.bMem == 2) - test(ex.cMem == 3) - except: - test(False) - self.called() - -class AMI_Thrower_throwModAI(CallbackBase): - def ice_response(self): - test(False) - - def ice_exception(self, ex): - try: - raise ex - except Test.Mod.A as ex: - test(ex.aMem == 1) - test(ex.a2Mem == 2) - except Ice.OperationNotExistException: - # - # This operation is not supported in Java. - # - pass - except: - test(False) - self.called() - -class AMI_Thrower_throwUndeclaredAI(CallbackBase): - def ice_response(self): - test(False) - - def ice_exception(self, ex): - try: - raise ex - except Ice.UnknownUserException: - pass - except: - test(False) - self.called() - -class AMI_Thrower_throwUndeclaredBI(CallbackBase): - def ice_response(self): - test(False) - - def ice_exception(self, ex): - try: - raise ex - except Ice.UnknownUserException: - pass - except: - test(False) - self.called() - -class AMI_Thrower_throwUndeclaredCI(CallbackBase): - def ice_response(self): - test(False) - - def ice_exception(self, ex): - try: - raise ex - except Ice.UnknownUserException: - pass - except: - test(False) - self.called() - -class AMI_Thrower_throwLocalExceptionI(CallbackBase): - def ice_response(self): - test(False) - - def ice_exception(self, ex): - try: - raise ex - except Ice.UnknownLocalException: - pass - except: - test(False) - self.called() - -class AMI_Thrower_throwNonIceExceptionI(CallbackBase): - def ice_response(self): - test(False) - - def ice_exception(self, ex): - try: - raise ex - except Ice.UnknownException: - pass - except: - test(False) - self.called() - -class AMI_WrongOperation_noSuchOperationI(CallbackBase): - def ice_response(self): - test(False) - - def ice_exception(self, ex): - try: - raise ex - except Ice.OperationNotExistException as ex: - test(ex.operation == "noSuchOperation") - except: - test(False) - self.called() - class Callback(CallbackBase): def __init__(self, communicator=None): CallbackBase.__init__(self) @@ -838,126 +609,7 @@ def allTests(communicator): print("ok") - sys.stdout.write("catching exact types with AMI... ") - sys.stdout.flush() - - cb = AMI_Thrower_throwAasAI() - thrower.throwAasA_async(cb, 1) - cb.check() - # Let's check if we can reuse the same callback object for another call. - thrower.throwAasA_async(cb, 1) - cb.check() - - cb = AMI_Thrower_throwAorDasAorDI() - thrower.throwAorDasAorD_async(cb, 1) - cb.check() - - cb = AMI_Thrower_throwAorDasAorDI() - thrower.throwAorDasAorD_async(cb, -1) - cb.check() - - cb = AMI_Thrower_throwBasBI() - thrower.throwBasB_async(cb, 1, 2) - cb.check() - - cb = AMI_Thrower_throwCasCI() - thrower.throwCasC_async(cb, 1, 2, 3) - cb.check() - # Let's check if we can reuse the same callback object for another call. - thrower.throwCasC_async(cb, 1, 2, 3) - cb.check() - - cb = AMI_Thrower_throwModAI() - thrower.throwModA_async(cb, 1, 2) - cb.check() - - print("ok") - - sys.stdout.write("catching derived types... ") - sys.stdout.flush() - - cb = AMI_Thrower_throwBasAI() - thrower.throwBasA_async(cb, 1, 2) - cb.check() - - cb = AMI_Thrower_throwCasAI() - thrower.throwCasA_async(cb, 1, 2, 3) - cb.check() - - cb = AMI_Thrower_throwCasBI() - thrower.throwCasB_async(cb, 1, 2, 3) - cb.check() - - print("ok") - - if thrower.supportsUndeclaredExceptions(): - sys.stdout.write("catching unknown user exception with AMI... ") - sys.stdout.flush() - - cb = AMI_Thrower_throwUndeclaredAI() - thrower.throwUndeclaredA_async(cb, 1) - cb.check() - - cb = AMI_Thrower_throwUndeclaredBI() - thrower.throwUndeclaredB_async(cb, 1, 2) - cb.check() - - cb = AMI_Thrower_throwUndeclaredCI() - thrower.throwUndeclaredC_async(cb, 1, 2, 3) - cb.check() - - print("ok") - - sys.stdout.write("catching object not exist exception with AMI... ") - sys.stdout.flush() - - id = communicator.stringToIdentity("does not exist") - thrower2 = Test.ThrowerPrx.uncheckedCast(thrower.ice_identity(id)) - cb = AMI_Thrower_throwAasAObjectNotExistI(communicator) - thrower2.throwAasA_async(cb, 1) - cb.check() - - print("ok") - - sys.stdout.write("catching facet not exist exception with AMI... ") - sys.stdout.flush() - - thrower2 = Test.ThrowerPrx.uncheckedCast(thrower, "no such facet") - cb = AMI_Thrower_throwAasAFacetNotExistI() - thrower2.throwAasA_async(cb, 1) - cb.check() - - print("ok") - - sys.stdout.write("catching operation not exist exception with AMI... ") - sys.stdout.flush() - - cb = AMI_WrongOperation_noSuchOperationI() - thrower4 = Test.WrongOperationPrx.uncheckedCast(thrower) - thrower4.noSuchOperation_async(cb) - cb.check() - - print("ok") - - sys.stdout.write("catching unknown local exception with AMI... ") - sys.stdout.flush() - - cb = AMI_Thrower_throwLocalExceptionI() - thrower.throwLocalException_async(cb) - cb.check() - - print("ok") - - sys.stdout.write("catching unknown non-Ice exception with AMI... ") - sys.stdout.flush() - - cb = AMI_Thrower_throwNonIceExceptionI() - thrower.throwNonIceException_async(cb) - cb.check() - - print("ok") - - sys.stdout.write("catching exact types with new AMI mapping... ") + sys.stdout.write("catching exact types with AMI mapping... ") sys.stdout.flush() cb = Callback() @@ -986,7 +638,7 @@ def allTests(communicator): print("ok") - sys.stdout.write("catching derived types with new AMI mapping... ") + sys.stdout.write("catching derived types with AMI mapping... ") sys.stdout.flush() cb = Callback() @@ -1004,7 +656,7 @@ def allTests(communicator): print("ok") if thrower.supportsUndeclaredExceptions(): - sys.stdout.write("catching unknown user exception with new AMI mapping... ") + sys.stdout.write("catching unknown user exception with AMI mapping... ") sys.stdout.flush() cb = Callback() @@ -1021,7 +673,7 @@ def allTests(communicator): print("ok") - sys.stdout.write("catching object not exist exception with new AMI mapping... ") + sys.stdout.write("catching object not exist exception with AMI mapping... ") sys.stdout.flush() id = communicator.stringToIdentity("does not exist") @@ -1032,7 +684,7 @@ def allTests(communicator): print("ok") - sys.stdout.write("catching facet not exist exception with new AMI mapping... ") + sys.stdout.write("catching facet not exist exception with AMI mapping... ") sys.stdout.flush() thrower2 = Test.ThrowerPrx.uncheckedCast(thrower, "no such facet") @@ -1042,7 +694,7 @@ def allTests(communicator): print("ok") - sys.stdout.write("catching operation not exist exception with new AMI mapping... ") + sys.stdout.write("catching operation not exist exception with AMI mapping... ") sys.stdout.flush() cb = Callback() @@ -1052,7 +704,7 @@ def allTests(communicator): print("ok") - sys.stdout.write("catching unknown local exception with new AMI mapping... ") + sys.stdout.write("catching unknown local exception with AMI mapping... ") sys.stdout.flush() cb = Callback() @@ -1065,7 +717,7 @@ def allTests(communicator): print("ok") - sys.stdout.write("catching unknown non-Ice exception with new AMI mapping... ") + sys.stdout.write("catching unknown non-Ice exception with AMI mapping... ") sys.stdout.flush() cb = Callback() |