Author: markt
Date: Tue Mar  8 12:10:44 2011
New Revision: 1079337

URL: http://svn.apache.org/viewvc?rev=1079337&view=rev
Log:
Don't swallow exceptions when they are not expected

Modified:
    tomcat/trunk/test/org/apache/tomcat/util/net/TestCustomSsl.java

Modified: tomcat/trunk/test/org/apache/tomcat/util/net/TestCustomSsl.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/net/TestCustomSsl.java?rev=1079337&r1=1079336&r2=1079337&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/net/TestCustomSsl.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/net/TestCustomSsl.java Tue Mar  8 
12:10:44 2011
@@ -84,7 +84,8 @@ public class TestCustomSsl extends Tomca
         
         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 Tomca
         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);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to