diff options
Diffstat (limited to 'java/test/Ice/servantLocator/AllTests.java')
-rw-r--r-- | java/test/Ice/servantLocator/AllTests.java | 276 |
1 files changed, 138 insertions, 138 deletions
diff --git a/java/test/Ice/servantLocator/AllTests.java b/java/test/Ice/servantLocator/AllTests.java index eaf730541b0..74f19f9e24f 100644 --- a/java/test/Ice/servantLocator/AllTests.java +++ b/java/test/Ice/servantLocator/AllTests.java @@ -24,101 +24,101 @@ public class AllTests public static void testExceptions(TestIntfPrx obj, boolean collocated) { - try - { - obj.requestFailedException(); - test(false); - } - catch(ObjectNotExistException ex) - { - if(!collocated) - { - test(ex.id.equals(obj.ice_getIdentity())); - test(ex.facet.equals(obj.ice_getFacet())); - test(ex.operation.equals("requestFailedException")); - } - } - - try - { - obj.unknownUserException(); - test(false); - } - catch(UnknownUserException ex) - { - test(ex.unknown.equals("reason")); - } - - try - { - obj.unknownLocalException(); - test(false); - } - catch(UnknownLocalException ex) - { - test(ex.unknown.equals("reason")); - } - - try - { - obj.unknownException(); - test(false); - } - catch(UnknownException ex) - { - test(ex.unknown.equals("reason")); - } - - // - // User exceptions are checked exceptions - // -// try -// { -// obj.userException(); -// test(false); -// } -// catch(UnknownUserException ex) -// { -// //System.err.println(ex.unknown); -// test(!collocated); -// test(ex.unknown.equals("Test::TestIntfUserException")); -// } -// catch(TestIntfUserException ex) -// { -// test(collocated); -// } - - try - { - obj.localException(); - test(false); - } - catch(UnknownLocalException ex) - { - //System.err.println(ex.unknown); - test(!collocated); - test(ex.unknown.indexOf("Ice.SocketException") >= 0); - } - catch(SocketException ex) - { - test(collocated); - } - - try - { - obj.javaException(); - test(false); - } - catch(UnknownException ex) - { - //System.err.println(ex.unknown); - test(!collocated); - test(ex.unknown.indexOf("java.lang.RuntimeException: message") >= 0); - } - catch(java.lang.RuntimeException ex) - { - test(collocated); - } + try + { + obj.requestFailedException(); + test(false); + } + catch(ObjectNotExistException ex) + { + if(!collocated) + { + test(ex.id.equals(obj.ice_getIdentity())); + test(ex.facet.equals(obj.ice_getFacet())); + test(ex.operation.equals("requestFailedException")); + } + } + + try + { + obj.unknownUserException(); + test(false); + } + catch(UnknownUserException ex) + { + test(ex.unknown.equals("reason")); + } + + try + { + obj.unknownLocalException(); + test(false); + } + catch(UnknownLocalException ex) + { + test(ex.unknown.equals("reason")); + } + + try + { + obj.unknownException(); + test(false); + } + catch(UnknownException ex) + { + test(ex.unknown.equals("reason")); + } + + // + // User exceptions are checked exceptions + // +// try +// { +// obj.userException(); +// test(false); +// } +// catch(UnknownUserException ex) +// { +// //System.err.println(ex.unknown); +// test(!collocated); +// test(ex.unknown.equals("Test::TestIntfUserException")); +// } +// catch(TestIntfUserException ex) +// { +// test(collocated); +// } + + try + { + obj.localException(); + test(false); + } + catch(UnknownLocalException ex) + { + //System.err.println(ex.unknown); + test(!collocated); + test(ex.unknown.indexOf("Ice.SocketException") >= 0); + } + catch(SocketException ex) + { + test(collocated); + } + + try + { + obj.javaException(); + test(false); + } + catch(UnknownException ex) + { + //System.err.println(ex.unknown); + test(!collocated); + test(ex.unknown.indexOf("java.lang.RuntimeException: message") >= 0); + } + catch(java.lang.RuntimeException ex) + { + test(collocated); + } } public static TestIntfPrx @@ -138,54 +138,54 @@ public class AllTests test(obj.equals(base)); System.out.println("ok"); - System.out.print("testing servant locator... "); + System.out.print("testing servant locator... "); System.out.flush(); - base = communicator.stringToProxy("category/locate:default -p 12010 -t 10000"); - obj = TestIntfPrxHelper.checkedCast(base); - try - { - TestIntfPrxHelper.checkedCast(communicator.stringToProxy("category/unknown:default -p 12010 -t 10000")); - } - catch(ObjectNotExistException ex) - { - } - System.out.println("ok"); - - System.out.print("testing default servant locator... "); + base = communicator.stringToProxy("category/locate:default -p 12010 -t 10000"); + obj = TestIntfPrxHelper.checkedCast(base); + try + { + TestIntfPrxHelper.checkedCast(communicator.stringToProxy("category/unknown:default -p 12010 -t 10000")); + } + catch(ObjectNotExistException ex) + { + } + System.out.println("ok"); + + System.out.print("testing default servant locator... "); System.out.flush(); - base = communicator.stringToProxy("anothercat/locate:default -p 12010 -t 10000"); - obj = TestIntfPrxHelper.checkedCast(base); - base = communicator.stringToProxy("locate:default -p 12010 -t 10000"); - obj = TestIntfPrxHelper.checkedCast(base); - try - { - TestIntfPrxHelper.checkedCast(communicator.stringToProxy("anothercat/unknown:default -p 12010 -t 10000")); - } - catch(ObjectNotExistException ex) - { - } - try - { - TestIntfPrxHelper.checkedCast(communicator.stringToProxy("unknown:default -p 12010 -t 10000")); - } - catch(ObjectNotExistException ex) - { - } - System.out.println("ok"); - - System.out.print("testing locate exceptions... "); + base = communicator.stringToProxy("anothercat/locate:default -p 12010 -t 10000"); + obj = TestIntfPrxHelper.checkedCast(base); + base = communicator.stringToProxy("locate:default -p 12010 -t 10000"); + obj = TestIntfPrxHelper.checkedCast(base); + try + { + TestIntfPrxHelper.checkedCast(communicator.stringToProxy("anothercat/unknown:default -p 12010 -t 10000")); + } + catch(ObjectNotExistException ex) + { + } + try + { + TestIntfPrxHelper.checkedCast(communicator.stringToProxy("unknown:default -p 12010 -t 10000")); + } + catch(ObjectNotExistException ex) + { + } + System.out.println("ok"); + + System.out.print("testing locate exceptions... "); System.out.flush(); - base = communicator.stringToProxy("category/locate:default -p 12010 -t 10000"); - obj = TestIntfPrxHelper.checkedCast(base); - testExceptions(obj, collocated); - System.out.println("ok"); + base = communicator.stringToProxy("category/locate:default -p 12010 -t 10000"); + obj = TestIntfPrxHelper.checkedCast(base); + testExceptions(obj, collocated); + System.out.println("ok"); - System.out.print("testing finished exceptions... "); + System.out.print("testing finished exceptions... "); System.out.flush(); - base = communicator.stringToProxy("category/finished:default -p 12010 -t 10000"); - obj = TestIntfPrxHelper.checkedCast(base); - testExceptions(obj, collocated); - System.out.println("ok"); + base = communicator.stringToProxy("category/finished:default -p 12010 -t 10000"); + obj = TestIntfPrxHelper.checkedCast(base); + testExceptions(obj, collocated); + System.out.println("ok"); return obj; } |