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 /java/test/Ice/exceptions/AllTests.java | |
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 'java/test/Ice/exceptions/AllTests.java')
-rw-r--r-- | java/test/Ice/exceptions/AllTests.java | 840 |
1 files changed, 9 insertions, 831 deletions
diff --git a/java/test/Ice/exceptions/AllTests.java b/java/test/Ice/exceptions/AllTests.java index f11f576c2fb..960fae967aa 100644 --- a/java/test/Ice/exceptions/AllTests.java +++ b/java/test/Ice/exceptions/AllTests.java @@ -11,20 +11,6 @@ package test.Ice.exceptions; import java.io.PrintWriter; import test.Ice.exceptions.Test.A; -import test.Ice.exceptions.Test.AMI_Thrower_throwAasA; -import test.Ice.exceptions.Test.AMI_Thrower_throwAorDasAorD; -import test.Ice.exceptions.Test.AMI_Thrower_throwAssertException; -import test.Ice.exceptions.Test.AMI_Thrower_throwBasA; -import test.Ice.exceptions.Test.AMI_Thrower_throwBasB; -import test.Ice.exceptions.Test.AMI_Thrower_throwCasA; -import test.Ice.exceptions.Test.AMI_Thrower_throwCasB; -import test.Ice.exceptions.Test.AMI_Thrower_throwCasC; -import test.Ice.exceptions.Test.AMI_Thrower_throwLocalException; -import test.Ice.exceptions.Test.AMI_Thrower_throwNonIceException; -import test.Ice.exceptions.Test.AMI_Thrower_throwUndeclaredA; -import test.Ice.exceptions.Test.AMI_Thrower_throwUndeclaredB; -import test.Ice.exceptions.Test.AMI_Thrower_throwUndeclaredC; -import test.Ice.exceptions.Test.AMI_WrongOperation_noSuchOperation; import test.Ice.exceptions.Test.B; import test.Ice.exceptions.Test.C; import test.Ice.exceptions.Test.D; @@ -92,645 +78,6 @@ public class AllTests private boolean _called; } - private static class AMI_Thrower_throwAasAI extends AMI_Thrower_throwAasA - { - @Override - public void ice_response() - { - test(false); - } - - @Override - public void ice_exception(Ice.LocalException exc) - { - exc.printStackTrace(); - test(false); - } - - @Override - public void ice_exception(Ice.UserException exc) - { - try - { - throw exc; - } - catch(A ex) - { - test(ex.aMem == 1); - } - catch(Throwable ex) - { - ex.printStackTrace(); - test(false); - } - callback.called(); - } - - public void check() - { - callback.check(); - } - - private Callback callback = new Callback(); - } - - private static class AMI_Thrower_throwAasAObjectNotExistI extends AMI_Thrower_throwAasA - { - AMI_Thrower_throwAasAObjectNotExistI(Ice.Communicator communicator) - { - _communicator = communicator; - } - - @Override - public void ice_response() - { - test(false); - } - - @Override - public void ice_exception(Ice.LocalException exc) - { - try - { - throw exc; - } - catch(Ice.ObjectNotExistException ex) - { - Ice.Identity id = _communicator.stringToIdentity("does not exist"); - test(ex.id.equals(id)); - } - catch(Throwable ex) - { - ex.printStackTrace(); - test(false); - } - callback.called(); - } - - @Override - public void ice_exception(Ice.UserException exc) - { - exc.printStackTrace(); - test(false); - } - - public void check() - { - callback.check(); - } - - private Callback callback = new Callback(); - private Ice.Communicator _communicator; - } - - private static class AMI_Thrower_throwAasAFacetNotExistI extends AMI_Thrower_throwAasA - { - @Override - public void ice_response() - { - test(false); - } - - @Override - public void ice_exception(Ice.LocalException exc) - { - try - { - throw exc; - } - catch(Ice.FacetNotExistException ex) - { - test(ex.facet.equals("no such facet")); - } - catch(Throwable ex) - { - ex.printStackTrace(); - test(false); - } - callback.called(); - } - - @Override - public void ice_exception(Ice.UserException exc) - { - exc.printStackTrace(); - test(false); - } - - public void check() - { - callback.check(); - } - - private Callback callback = new Callback(); - } - - private static class AMI_Thrower_throwAorDasAorDI extends AMI_Thrower_throwAorDasAorD - { - @Override - public void ice_response() - { - test(false); - } - - @Override - public void ice_exception(Ice.LocalException exc) - { - exc.printStackTrace(); - test(false); - } - - @Override - public void ice_exception(Ice.UserException exc) - { - try - { - throw exc; - } - catch(A ex) - { - test(ex.aMem == 1); - } - catch(D ex) - { - test(ex.dMem == -1); - } - catch(Throwable ex) - { - ex.printStackTrace(); - test(false); - } - callback.called(); - } - - public void check() - { - callback.check(); - } - - private Callback callback = new Callback(); - } - - private static class AMI_Thrower_throwBasAI extends AMI_Thrower_throwBasA - { - @Override - public void ice_response() - { - test(false); - } - - @Override - public void ice_exception(Ice.LocalException exc) - { - exc.printStackTrace(); - test(false); - } - - @Override - public void ice_exception(Ice.UserException exc) - { - try - { - throw exc; - } - catch(B ex) - { - test(ex.aMem == 1); - test(ex.bMem == 2); - } - catch(Throwable ex) - { - ex.printStackTrace(); - test(false); - } - callback.called(); - } - - public void check() - { - callback.check(); - } - - private Callback callback = new Callback(); - } - - private static class AMI_Thrower_throwCasAI extends AMI_Thrower_throwCasA - { - @Override - public void ice_response() - { - test(false); - } - - @Override - public void ice_exception(Ice.LocalException exc) - { - exc.printStackTrace(); - test(false); - } - - @Override - public void ice_exception(Ice.UserException exc) - { - try - { - throw exc; - } - catch(C ex) - { - test(ex.aMem == 1); - test(ex.bMem == 2); - test(ex.cMem == 3); - } - catch(Throwable ex) - { - ex.printStackTrace(); - test(false); - } - callback.called(); - } - - public void check() - { - callback.check(); - } - - private Callback callback = new Callback(); - } - - private static class AMI_Thrower_throwBasBI extends AMI_Thrower_throwBasB - { - @Override - public void ice_response() - { - test(false); - } - - @Override - public void ice_exception(Ice.LocalException exc) - { - exc.printStackTrace(); - test(false); - } - - @Override - public void ice_exception(Ice.UserException exc) - { - try - { - throw exc; - } - catch(B ex) - { - test(ex.aMem == 1); - test(ex.bMem == 2); - } - catch(Throwable ex) - { - ex.printStackTrace(); - test(false); - } - callback.called(); - } - - public void check() - { - callback.check(); - } - - private Callback callback = new Callback(); - } - - private static class AMI_Thrower_throwCasBI extends AMI_Thrower_throwCasB - { - @Override - public void ice_response() - { - test(false); - } - - @Override - public void ice_exception(Ice.LocalException exc) - { - exc.printStackTrace(); - test(false); - } - - @Override - public void ice_exception(Ice.UserException exc) - { - try - { - throw exc; - } - catch(C ex) - { - test(ex.aMem == 1); - test(ex.bMem == 2); - test(ex.cMem == 3); - } - catch(Throwable ex) - { - ex.printStackTrace(); - test(false); - } - callback.called(); - } - - public void check() - { - callback.check(); - } - - private Callback callback = new Callback(); - } - - private static class AMI_Thrower_throwCasCI extends AMI_Thrower_throwCasC - { - @Override - public void ice_response() - { - test(false); - } - - @Override - public void ice_exception(Ice.LocalException exc) - { - exc.printStackTrace(); - test(false); - } - - @Override - public void ice_exception(Ice.UserException exc) - { - try - { - throw exc; - } - catch(C ex) - { - test(ex.aMem == 1); - test(ex.bMem == 2); - test(ex.cMem == 3); - } - catch(Throwable ex) - { - ex.printStackTrace(); - test(false); - } - callback.called(); - } - - public void check() - { - callback.check(); - } - - private Callback callback = new Callback(); - } - - private static class AMI_Thrower_throwUndeclaredAI extends AMI_Thrower_throwUndeclaredA - { - @Override - public void ice_response() - { - test(false); - } - - @Override - public void ice_exception(Ice.LocalException exc) - { - try - { - throw exc; - } - catch(Ice.UnknownUserException ex) - { - } - catch(Throwable ex) - { - ex.printStackTrace(); - test(false); - } - callback.called(); - } - - public void check() - { - callback.check(); - } - - private Callback callback = new Callback(); - } - - private static class AMI_Thrower_throwUndeclaredBI extends AMI_Thrower_throwUndeclaredB - { - @Override - public void ice_response() - { - test(false); - } - - @Override - public void ice_exception(Ice.LocalException exc) - { - try - { - throw exc; - } - catch(Ice.UnknownUserException ex) - { - } - catch(Throwable ex) - { - ex.printStackTrace(); - test(false); - } - callback.called(); - } - - public void check() - { - callback.check(); - } - - private Callback callback = new Callback(); - } - - private static class AMI_Thrower_throwUndeclaredCI extends AMI_Thrower_throwUndeclaredC - { - @Override - public void ice_response() - { - test(false); - } - - @Override - public void ice_exception(Ice.LocalException exc) - { - try - { - throw exc; - } - catch(Ice.UnknownUserException ex) - { - } - catch(Throwable ex) - { - ex.printStackTrace(); - test(false); - } - callback.called(); - } - - public void check() - { - callback.check(); - } - - private Callback callback = new Callback(); - } - - private static class AMI_Thrower_throwLocalExceptionI extends AMI_Thrower_throwLocalException - { - @Override - public void ice_response() - { - test(false); - } - - @Override - public void ice_exception(Ice.LocalException exc) - { - try - { - throw exc; - } - catch(Ice.UnknownLocalException ex) - { - } - catch(Throwable ex) - { - ex.printStackTrace(); - test(false); - } - callback.called(); - } - - public void check() - { - callback.check(); - } - - private Callback callback = new Callback(); - } - - private static class AMI_Thrower_throwNonIceExceptionI extends AMI_Thrower_throwNonIceException - { - @Override - public void ice_response() - { - test(false); - } - - @Override - public void ice_exception(Ice.LocalException exc) - { - try - { - throw exc; - } - catch(Ice.UnknownException ex) - { - } - catch(Throwable ex) - { - ex.printStackTrace(); - test(false); - } - callback.called(); - } - - public void check() - { - callback.check(); - } - - private Callback callback = new Callback(); - } - - private static class AMI_Thrower_throwAssertExceptionI extends AMI_Thrower_throwAssertException - { - @Override - public void ice_response() - { - test(false); - } - - @Override - public void ice_exception(Ice.LocalException exc) - { - try - { - throw exc; - } - catch(Ice.ConnectionLostException ex) - { - } - catch(Ice.UnknownException ex) - { - } - catch(Throwable ex) - { - ex.printStackTrace(); - test(false); - } - callback.called(); - } - - public void check() - { - callback.check(); - } - - private Callback callback = new Callback(); - } - - private static class AMI_WrongOperation_noSuchOperationI extends AMI_WrongOperation_noSuchOperation - { - @Override - public void ice_response() - { - test(false); - } - - @Override - public void ice_exception(Ice.LocalException exc) - { - try - { - throw exc; - } - catch(Ice.OperationNotExistException ex) - { - test(ex.operation.equals("noSuchOperation")); - } - catch(Throwable ex) - { - ex.printStackTrace(); - test(false); - } - callback.called(); - } - - public void check() - { - callback.check(); - } - - private Callback callback = new Callback(); - } - private static class Callback_Thrower_throwAasAI extends Callback_Thrower_throwAasA { @Override @@ -1965,176 +1312,7 @@ public class AllTests out.println("ok"); - out.print("catching exact types with AMI... "); - out.flush(); - - { - AMI_Thrower_throwAasAI cb = new 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(); - } - - { - AMI_Thrower_throwAorDasAorDI cb = new AMI_Thrower_throwAorDasAorDI(); - thrower.throwAorDasAorD_async(cb, 1); - cb.check(); - } - - { - AMI_Thrower_throwAorDasAorDI cb = new AMI_Thrower_throwAorDasAorDI(); - thrower.throwAorDasAorD_async(cb, -1); - cb.check(); - } - - { - AMI_Thrower_throwBasBI cb = new AMI_Thrower_throwBasBI(); - thrower.throwBasB_async(cb, 1, 2); - cb.check(); - } - - { - AMI_Thrower_throwCasCI cb = new 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(); - } - - out.println("ok"); - - out.print("catching derived types with AMI... "); - out.flush(); - - { - AMI_Thrower_throwBasAI cb = new AMI_Thrower_throwBasAI(); - thrower.throwBasA_async(cb, 1, 2); - cb.check(); - } - - { - AMI_Thrower_throwCasAI cb = new AMI_Thrower_throwCasAI(); - thrower.throwCasA_async(cb, 1, 2, 3); - cb.check(); - } - - { - AMI_Thrower_throwCasBI cb = new AMI_Thrower_throwCasBI(); - thrower.throwCasB_async(cb, 1, 2, 3); - cb.check(); - } - - out.println("ok"); - - if(thrower.supportsUndeclaredExceptions()) - { - out.print("catching unknown user exception with AMI... "); - out.flush(); - - { - AMI_Thrower_throwUndeclaredAI cb = new AMI_Thrower_throwUndeclaredAI(); - thrower.throwUndeclaredA_async(cb, 1); - cb.check(); - } - - { - AMI_Thrower_throwUndeclaredBI cb = new AMI_Thrower_throwUndeclaredBI(); - thrower.throwUndeclaredB_async(cb, 1, 2); - cb.check(); - } - - { - AMI_Thrower_throwUndeclaredCI cb = new AMI_Thrower_throwUndeclaredCI(); - thrower.throwUndeclaredC_async(cb, 1, 2, 3); - cb.check(); - } - - out.println("ok"); - } - - if(thrower.supportsAssertException()) - { - out.print("testing assert in the server with AMI... "); - out.flush(); - - AMI_Thrower_throwAssertExceptionI cb = new AMI_Thrower_throwAssertExceptionI(); - thrower.throwAssertException_async(cb); - cb.check(); - - out.println("ok"); - } - - out.print("catching object not exist exception with AMI... "); - out.flush(); - - { - Ice.Identity id = communicator.stringToIdentity("does not exist"); - ThrowerPrx thrower2 = ThrowerPrxHelper.uncheckedCast(thrower.ice_identity(id)); - AMI_Thrower_throwAasAObjectNotExistI cb = new AMI_Thrower_throwAasAObjectNotExistI(communicator); - thrower2.throwAasA_async(cb, 1); - cb.check(); - } - - out.println("ok"); - - out.print("catching facet not exist exception with AMI... "); - out.flush(); - - try - { - ThrowerPrx thrower2 = ThrowerPrxHelper.uncheckedCast(thrower, "no such facet"); - { - AMI_Thrower_throwAasAFacetNotExistI cb = new AMI_Thrower_throwAasAFacetNotExistI(); - thrower2.throwAasA_async(cb, 1); - cb.check(); - } - } - catch(Throwable ex) - { - ex.printStackTrace(); - test(false); - } - - out.println("ok"); - - out.print("catching operation not exist exception with AMI... "); - out.flush(); - - { - AMI_WrongOperation_noSuchOperationI cb = new AMI_WrongOperation_noSuchOperationI(); - WrongOperationPrx thrower2 = WrongOperationPrxHelper.uncheckedCast(thrower); - thrower2.noSuchOperation_async(cb); - cb.check(); - } - - out.println("ok"); - - out.print("catching unknown local exception with AMI... "); - out.flush(); - - { - AMI_Thrower_throwLocalExceptionI cb = new AMI_Thrower_throwLocalExceptionI(); - thrower.throwLocalException_async(cb); - cb.check(); - } - - out.println("ok"); - - out.print("catching unknown non-Ice exception with AMI... "); - out.flush(); - - { - AMI_Thrower_throwNonIceExceptionI cb = new AMI_Thrower_throwNonIceExceptionI(); - thrower.throwNonIceException_async(cb); - cb.check(); - } - - out.println("ok"); - - out.print("catching exact types with new AMI mapping... "); + out.print("catching exact types with AMI mapping... "); out.flush(); { @@ -2169,7 +1347,7 @@ public class AllTests out.println("ok"); - out.print("catching derived types with new AMI mapping... "); + out.print("catching derived types with mapping... "); out.flush(); { @@ -2194,7 +1372,7 @@ public class AllTests if(thrower.supportsUndeclaredExceptions()) { - out.print("catching unknown user exception with new AMI mapping... "); + out.print("catching unknown user exception with mapping... "); out.flush(); { @@ -2220,7 +1398,7 @@ public class AllTests if(thrower.supportsAssertException()) { - out.print("catching assert in the server with new AMI mapping... "); + out.print("catching assert in the server with mapping... "); out.flush(); Callback_Thrower_throwAssertExceptionI cb = new Callback_Thrower_throwAssertExceptionI(); @@ -2231,7 +1409,7 @@ public class AllTests } - out.print("catching object not exist exception with new AMI mapping... "); + out.print("catching object not exist exception with mapping... "); out.flush(); { @@ -2244,7 +1422,7 @@ public class AllTests out.println("ok"); - out.print("catching facet not exist exception with new AMI mapping... "); + out.print("catching facet not exist exception with mapping... "); out.flush(); { @@ -2256,7 +1434,7 @@ public class AllTests out.println("ok"); - out.print("catching operation not exist exception with new AMI mapping... "); + out.print("catching operation not exist exception with mapping... "); out.flush(); { @@ -2268,7 +1446,7 @@ public class AllTests out.println("ok"); - out.print("catching unknown local exception with new AMI mapping... "); + out.print("catching unknown local exception with mapping... "); out.flush(); { @@ -2298,7 +1476,7 @@ public class AllTests out.println("ok"); - out.print("catching unknown non-Ice exception with new AMI mapping... "); + out.print("catching unknown non-Ice exception with mapping... "); out.flush(); { |