diff options
author | Matthew Newhook <matthew@zeroc.com> | 2009-03-24 12:31:31 -0230 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2009-03-24 12:31:31 -0230 |
commit | 4cc5d77c383b6c91c3af9fe44df9687bb9b15580 (patch) | |
tree | 64ce3d6cf35b15497de50f298f7225a8c72f64b6 /java/test/Ice/exceptions/AllTests.java | |
parent | Merge commit 'origin/R3_3_branch' (diff) | |
download | ice-4cc5d77c383b6c91c3af9fe44df9687bb9b15580.tar.bz2 ice-4cc5d77c383b6c91c3af9fe44df9687bb9b15580.tar.xz ice-4cc5d77c383b6c91c3af9fe44df9687bb9b15580.zip |
Merged android-testsuite branch.
Diffstat (limited to 'java/test/Ice/exceptions/AllTests.java')
-rw-r--r-- | java/test/Ice/exceptions/AllTests.java | 173 |
1 files changed, 99 insertions, 74 deletions
diff --git a/java/test/Ice/exceptions/AllTests.java b/java/test/Ice/exceptions/AllTests.java index bcce84b603f..cc8d7e1a104 100644 --- a/java/test/Ice/exceptions/AllTests.java +++ b/java/test/Ice/exceptions/AllTests.java @@ -7,7 +7,32 @@ // // ********************************************************************** -import Test.*; +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; +import test.Ice.exceptions.Test.ThrowerPrx; +import test.Ice.exceptions.Test.ThrowerPrxHelper; +import test.Ice.exceptions.Test.WrongOperationPrx; +import test.Ice.exceptions.Test.WrongOperationPrxHelper; public class AllTests { @@ -715,10 +740,10 @@ public class AllTests } public static ThrowerPrx - allTests(Ice.Communicator communicator, boolean collocated) + allTests(Ice.Communicator communicator, boolean collocated, PrintWriter out) { { - System.out.print("testing object adapter registration exceptions... "); + out.print("testing object adapter registration exceptions... "); Ice.ObjectAdapter first; try { @@ -753,11 +778,11 @@ public class AllTests } test(communicator.getProperties().getProperty("TestAdapter0.Endpoints").equals("default")); first.deactivate(); - System.out.println("ok"); + out.println("ok"); } { - System.out.print("testing servant registration exceptions... "); + out.print("testing servant registration exceptions... "); communicator.getProperties().setProperty("TestAdapter1.Endpoints", "default"); Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter1"); Ice.Object obj = new EmptyI(); @@ -781,11 +806,11 @@ public class AllTests { } adapter.deactivate(); - System.out.println("ok"); + out.println("ok"); } { - System.out.print("testing servant locator registration exceptions... "); + out.print("testing servant locator registration exceptions... "); communicator.getProperties().setProperty("TestAdapter2.Endpoints", "default"); Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter2"); Ice.ServantLocator loc = new ServantLocatorI(); @@ -800,11 +825,11 @@ public class AllTests } adapter.deactivate(); - System.out.println("ok"); + out.println("ok"); } { - System.out.print("testing object factory registration exception... "); + out.print("testing object factory registration exception... "); Ice.ObjectFactory of = new ObjectFactoryI(); communicator.addObjectFactory(of, "::x"); try @@ -815,25 +840,25 @@ public class AllTests catch(Ice.AlreadyRegisteredException ex) { } - System.out.println("ok"); + out.println("ok"); } - System.out.print("testing stringToProxy... "); - System.out.flush(); + out.print("testing stringToProxy... "); + out.flush(); String ref = "thrower:default -p 12010 -t 10000"; Ice.ObjectPrx base = communicator.stringToProxy(ref); test(base != null); - System.out.println("ok"); + out.println("ok"); - System.out.print("testing checked cast... "); - System.out.flush(); + out.print("testing checked cast... "); + out.flush(); ThrowerPrx thrower = ThrowerPrxHelper.checkedCast(base); test(thrower != null); test(thrower.equals(base)); - System.out.println("ok"); + out.println("ok"); - System.out.print("catching exact types... "); - System.out.flush(); + out.print("catching exact types... "); + out.flush(); try { @@ -913,10 +938,10 @@ public class AllTests test(false); } - System.out.println("ok"); + out.println("ok"); - System.out.print("catching base types... "); - System.out.flush(); + out.print("catching base types... "); + out.flush(); try { @@ -949,10 +974,10 @@ public class AllTests test(false); } - System.out.println("ok"); + out.println("ok"); - System.out.print("catching derived types... "); - System.out.flush(); + out.print("catching derived types... "); + out.flush(); try { @@ -1004,14 +1029,14 @@ public class AllTests test(false); } - System.out.println("ok"); + out.println("ok"); if(thrower.supportsUndeclaredExceptions()) { test(!collocated); - System.out.print("catching unknown user exception... "); - System.out.flush(); + out.print("catching unknown user exception... "); + out.flush(); try { @@ -1055,13 +1080,13 @@ public class AllTests test(false); } - System.out.println("ok"); + out.println("ok"); } if(thrower.supportsAssertException()) { - System.out.print("testing assert in the server... "); - System.out.flush(); + out.print("testing assert in the server... "); + out.flush(); try { @@ -1082,11 +1107,11 @@ public class AllTests test(false); } - System.out.println("ok"); + out.println("ok"); } - System.out.print("catching object not exist exception... "); - System.out.flush(); + out.print("catching object not exist exception... "); + out.flush(); { Ice.Identity id = communicator.stringToIdentity("does not exist"); @@ -1107,10 +1132,10 @@ public class AllTests } } - System.out.println("ok"); + out.println("ok"); - System.out.print("catching facet not exist exception... "); - System.out.flush(); + out.print("catching facet not exist exception... "); + out.flush(); try { @@ -1131,10 +1156,10 @@ public class AllTests test(false); } - System.out.println("ok"); + out.println("ok"); - System.out.print("catching operation not exist exception... "); - System.out.flush(); + out.print("catching operation not exist exception... "); + out.flush(); try { @@ -1152,10 +1177,10 @@ public class AllTests test(false); } - System.out.println("ok"); + out.println("ok"); - System.out.print("catching unknown local exception... "); - System.out.flush(); + out.print("catching unknown local exception... "); + out.flush(); try { @@ -1171,10 +1196,10 @@ public class AllTests test(false); } - System.out.println("ok"); + out.println("ok"); - System.out.print("catching unknown non-Ice exception... "); - System.out.flush(); + out.print("catching unknown non-Ice exception... "); + out.flush(); try { @@ -1186,16 +1211,16 @@ public class AllTests } catch(Throwable ex) { - System.out.println(ex); + out.println(ex); test(false); } - System.out.println("ok"); + out.println("ok"); if(!collocated) { - System.out.print("catching exact types with AMI... "); - System.out.flush(); + out.print("catching exact types with AMI... "); + out.flush(); { AMI_Thrower_throwAasAI cb = new AMI_Thrower_throwAasAI(); @@ -1233,10 +1258,10 @@ public class AllTests test(cb.check()); } - System.out.println("ok"); + out.println("ok"); - System.out.print("catching derived types with AMI... "); - System.out.flush(); + out.print("catching derived types with AMI... "); + out.flush(); { AMI_Thrower_throwBasAI cb = new AMI_Thrower_throwBasAI(); @@ -1256,12 +1281,12 @@ public class AllTests test(cb.check()); } - System.out.println("ok"); + out.println("ok"); if(thrower.supportsUndeclaredExceptions()) { - System.out.print("catching unknown user exception with AMI... "); - System.out.flush(); + out.print("catching unknown user exception with AMI... "); + out.flush(); { AMI_Thrower_throwUndeclaredAI cb = new AMI_Thrower_throwUndeclaredAI(); @@ -1281,23 +1306,23 @@ public class AllTests test(cb.check()); } - System.out.println("ok"); + out.println("ok"); } if(thrower.supportsAssertException()) { - System.out.print("testing assert in the server with AMI... "); - System.out.flush(); + out.print("testing assert in the server with AMI... "); + out.flush(); AMI_Thrower_throwAssertExceptionI cb = new AMI_Thrower_throwAssertExceptionI(); thrower.throwAssertException_async(cb); test(cb.check()); - System.out.println("ok"); + out.println("ok"); } - System.out.print("catching object not exist exception with AMI... "); - System.out.flush(); + out.print("catching object not exist exception with AMI... "); + out.flush(); { Ice.Identity id = communicator.stringToIdentity("does not exist"); @@ -1307,10 +1332,10 @@ public class AllTests test(cb.check()); } - System.out.println("ok"); + out.println("ok"); - System.out.print("catching facet not exist exception with AMI... "); - System.out.flush(); + out.print("catching facet not exist exception with AMI... "); + out.flush(); try { @@ -1327,10 +1352,10 @@ public class AllTests test(false); } - System.out.println("ok"); + out.println("ok"); - System.out.print("catching operation not exist exception with AMI... "); - System.out.flush(); + out.print("catching operation not exist exception with AMI... "); + out.flush(); { AMI_WrongOperation_noSuchOperationI cb = new AMI_WrongOperation_noSuchOperationI(); @@ -1339,10 +1364,10 @@ public class AllTests test(cb.check()); } - System.out.println("ok"); + out.println("ok"); - System.out.print("catching unknown local exception with AMI... "); - System.out.flush(); + out.print("catching unknown local exception with AMI... "); + out.flush(); { AMI_Thrower_throwLocalExceptionI cb = new AMI_Thrower_throwLocalExceptionI(); @@ -1350,16 +1375,16 @@ public class AllTests test(cb.check()); } - System.out.println("ok"); + out.println("ok"); - System.out.print("catching unknown non-Ice exception with AMI... "); - System.out.flush(); + out.print("catching unknown non-Ice exception with AMI... "); + out.flush(); AMI_Thrower_throwNonIceExceptionI cb = new AMI_Thrower_throwNonIceExceptionI(); thrower.throwNonIceException_async(cb); test(cb.check()); - System.out.println("ok"); + out.println("ok"); } return thrower; |