You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by kk...@apache.org on 2014/03/14 16:17:28 UTC

svn commit: r1577565 - in /tomcat/trunk/test/org/apache/tomcat/util/net: TestClientCert.java TestCustomSsl.java TestSsl.java

Author: kkolinko
Date: Fri Mar 14 15:17:27 2014
New Revision: 1577565

URL: http://svn.apache.org/r1577565
Log:
Better reporting for skipped tests.
With org.junit.Assume the tests are clearly reported as 'skipped' in JUnit test run summary.

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

Modified: tomcat/trunk/test/org/apache/tomcat/util/net/TestClientCert.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/net/TestClientCert.java?rev=1577565&r1=1577564&r2=1577565&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/net/TestClientCert.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/net/TestClientCert.java Fri Mar 14 15:17:27 2014
@@ -20,6 +20,7 @@ import java.util.Arrays;
 
 import static org.junit.Assert.assertEquals;
 
+import org.junit.Assume;
 import org.junit.Test;
 
 import org.apache.catalina.startup.Tomcat;
@@ -35,9 +36,8 @@ public class TestClientCert extends Tomc
 
     @Test
     public void testClientCertGet() throws Exception {
-        if (!TesterSupport.isRenegotiationSupported(getTomcatInstance())) {
-            return;
-        }
+        Assume.assumeTrue("SSL renegotiation have to be supported",
+                TesterSupport.isRenegotiationSupported(getTomcatInstance()));
 
         // Unprotected resource
         ByteChunk res =
@@ -72,9 +72,8 @@ public class TestClientCert extends Tomc
 
     private void doTestClientCertPost(int bodySize, boolean expectProtectedFail)
             throws Exception {
-        if (!TesterSupport.isRenegotiationSupported(getTomcatInstance())) {
-            return;
-        }
+        Assume.assumeTrue("SSL renegotiation have to be supported",
+                TesterSupport.isRenegotiationSupported(getTomcatInstance()));
 
         byte[] body = new byte[bodySize];
         Arrays.fill(body, TesterSupport.DATA);

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=1577565&r1=1577564&r2=1577565&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/net/TestCustomSsl.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/net/TestCustomSsl.java Fri Mar 14 15:17:27 2014
@@ -25,6 +25,7 @@ import static org.junit.Assert.assertEqu
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import org.junit.Assume;
 import org.junit.Test;
 
 import org.apache.catalina.Context;
@@ -52,10 +53,9 @@ public class TestCustomSsl extends Tomca
 
         Tomcat tomcat = getTomcatInstance();
         Connector connector = tomcat.getConnector();
-        if (connector.getProtocolHandlerClassName().contains("Apr")) {
-            // This test is only for JSSE based SSL connectors
-            return;
-        }
+
+        Assume.assumeFalse("This test is only for JSSE based SSL connectors",
+                connector.getProtocolHandlerClassName().contains("Apr"));
 
         connector.setProperty("sslImplementationName",
                 "org.apache.tomcat.util.net.jsse.TesterBug50640SslImpl");
@@ -105,9 +105,8 @@ public class TestCustomSsl extends Tomca
 
         Tomcat tomcat = getTomcatInstance();
 
-        if (!TesterSupport.isRenegotiationSupported(getTomcatInstance())) {
-            return;
-        }
+        Assume.assumeTrue("SSL renegotiation have to be supported",
+                TesterSupport.isRenegotiationSupported(getTomcatInstance()));
 
         TesterSupport.configureClientCertContext(tomcat);
 

Modified: tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java?rev=1577565&r1=1577564&r2=1577565&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/net/TestSsl.java Fri Mar 14 15:17:27 2014
@@ -34,6 +34,7 @@ import static org.junit.Assert.assertTru
 import static org.junit.Assert.fail;
 
 import org.junit.Assert;
+import org.junit.Assume;
 import org.junit.Test;
 
 import org.apache.catalina.Context;
@@ -165,9 +166,8 @@ public class TestSsl extends TomcatBaseT
     public void testRenegotiateWorks() throws Exception {
         Tomcat tomcat = getTomcatInstance();
 
-        if (!TesterSupport.isRenegotiationSupported(tomcat)) {
-            return;
-        }
+        Assume.assumeTrue("SSL renegotiation have to be supported",
+                TesterSupport.isRenegotiationSupported(getTomcatInstance()));
 
         File appDir = new File(getBuildDirectory(), "webapps/examples");
         // app dir is relative to server home



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