diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/test/src/main/java/test/IceSSL/configuration/AllTests.java | 104 |
1 files changed, 38 insertions, 66 deletions
diff --git a/java/test/src/main/java/test/IceSSL/configuration/AllTests.java b/java/test/src/main/java/test/IceSSL/configuration/AllTests.java index 24b3bd4ea26..d404bdd2fa5 100644 --- a/java/test/src/main/java/test/IceSSL/configuration/AllTests.java +++ b/java/test/src/main/java/test/IceSSL/configuration/AllTests.java @@ -2492,7 +2492,6 @@ public class AllTests com.zeroc.Ice.ObjectPrx p = comm.stringToProxy("dummy:wss -h demo.zeroc.com -p 5064"); while(true) { - com.zeroc.Ice.LocalException retryEx = null; try { p.ice_ping(); @@ -2503,44 +2502,31 @@ public class AllTests // Expected, by default we don't check for system CAs. break; } - catch(com.zeroc.Ice.ConnectTimeoutException ex) - { - retryEx = ex; - } - catch(com.zeroc.Ice.SocketException ex) - { - retryEx = ex; - } - catch(com.zeroc.Ice.DNSException ex) - { - retryEx = ex; - } catch(com.zeroc.Ice.LocalException ex) { - ex.printStackTrace(); - test(false); - } - - if(retryEx != null) - { - if(++retryCount > retryMax) + if((ex instanceof com.zeroc.Ice.ConnectTimeoutException) || + (ex instanceof com.zeroc.Ice.SocketException) || + (ex instanceof com.zeroc.Ice.DNSException)) { - retryEx.printStackTrace(); - test(false); - } - else - { - out.print("retrying... "); - out.flush(); - try + if(++retryCount < retryMax) { - Thread.sleep(retryDelay); - } - catch(InterruptedException e) - { - break; + out.print("retrying... "); + out.flush(); + try + { + Thread.sleep(retryDelay); + } + catch(InterruptedException e) + { + break; + } + continue; } } + + out.print("warning: unable to connect to demo.zeroc.com to check system CA\n"); + ex.printStackTrace(); + break; } } comm.destroy(); @@ -2554,7 +2540,6 @@ public class AllTests p = comm.stringToProxy("dummy:wss -h demo.zeroc.com -p 5064"); while(true) { - com.zeroc.Ice.LocalException retryEx = null; try { com.zeroc.Ice.WSConnectionInfo info = @@ -2563,44 +2548,31 @@ public class AllTests test(sslinfo.verified); break; } - catch(com.zeroc.Ice.ConnectTimeoutException ex) - { - retryEx = ex; - } - catch(com.zeroc.Ice.SocketException ex) - { - retryEx = ex; - } - catch(com.zeroc.Ice.DNSException ex) - { - retryEx = ex; - } catch(com.zeroc.Ice.LocalException ex) { - ex.printStackTrace(); - test(false); - } - - if(retryEx != null) - { - if(++retryCount > retryMax) + if((ex instanceof com.zeroc.Ice.ConnectTimeoutException) || + (ex instanceof com.zeroc.Ice.SocketException) || + (ex instanceof com.zeroc.Ice.DNSException)) { - retryEx.printStackTrace(); - test(false); - } - else - { - out.print("retrying... "); - out.flush(); - try + if(++retryCount < retryMax) { - Thread.sleep(retryDelay); - } - catch(InterruptedException e) - { - break; + out.print("retrying... "); + out.flush(); + try + { + Thread.sleep(retryDelay); + } + catch(InterruptedException e) + { + break; + } + continue; } } + + out.print("warning: unable to connect to demo.zeroc.com to check system CA\n"); + ex.printStackTrace(); + break; } } comm.destroy(); |