From b034227a2f024ae4dffd1402b983edbd9b626f07 Mon Sep 17 00:00:00 2001 From: markt Date: Tue, 8 Mar 2011 12:10:44 +0000 Subject: [PATCH] Don't swallow exceptions when they are not expected git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1079337 13f79535-47bb-0310-9956-ffa450edef68 --- test/org/apache/tomcat/util/net/TestCustomSsl.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/test/org/apache/tomcat/util/net/TestCustomSsl.java b/test/org/apache/tomcat/util/net/TestCustomSsl.java index d532bbfdb..2896602a7 100644 --- a/test/org/apache/tomcat/util/net/TestCustomSsl.java +++ b/test/org/apache/tomcat/util/net/TestCustomSsl.java @@ -84,7 +84,8 @@ public class TestCustomSsl extends TomcatBaseTest { if (!TesterSupport.RFC_5746_SUPPORTED) { // Make sure SSL renegotiation is not disabled in the JVM - System.setProperty("sun.security.ssl.allowUnsafeRenegotiation", "true"); + System.setProperty("sun.security.ssl.allowUnsafeRenegotiation", + "true"); } Tomcat tomcat = getTomcatInstance(); @@ -124,10 +125,16 @@ public class TestCustomSsl extends TomcatBaseTest { try { rc = getUrl("https://localhost:" + getPort() + "/protected", res, null, null); - } catch (SocketException expected1) { - // Ignore - } catch (SSLHandshakeException expected2) { - // Ignore + } catch (SocketException se) { + if (serverTrustAll) { + fail(se.getMessage()); + se.printStackTrace(); + } + } catch (SSLHandshakeException he) { + if (serverTrustAll) { + fail(he.getMessage()); + he.printStackTrace(); + } } if (serverTrustAll) { assertEquals(200, rc); -- 2.11.0