Author: markt
Date: Fri Feb 15 08:30:09 2019
New Revision: 1853620
URL: http://svn.apache.org/viewvc?rev=1853620&view=rev
Log:
Refactor so tests are correctly skipped when Tomcat Native is not available
Modified:
tomcat/trunk/test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java
Modified:
tomcat/trunk/test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java?rev=1853620&r1=1853619&r2=1853620&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java
(original)
+++ tomcat/trunk/test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java
Fri Feb 15 08:30:09 2019
@@ -75,6 +75,7 @@ public class TestSSLHostConfigCompat ext
public void testHostPEM() throws Exception {
sslHostConfig.setCertificateFile(getPath(TesterSupport.LOCALHOST_CERT_PEM));
sslHostConfig.setCertificateKeyFile(getPath(TesterSupport.LOCALHOST_KEY_PEM));
+ doTest();
}
@@ -82,6 +83,17 @@ public class TestSSLHostConfigCompat ext
@Ignore // Currently the APR/native connector cannot be configured using a
Keystore
public void testHostKeystore() throws Exception {
sslHostConfig.setCertificateKeystoreFile(getPath(TesterSupport.LOCALHOST_JKS));
+ doTest();
+ }
+
+
+ private void doTest() throws Exception {
+ Tomcat tomcat = getTomcatInstance();
+ tomcat.start();
+
+ // Check a request can be made
+ ByteChunk res = getUrl("https://localhost:" + getPort() + "/");
+ Assert.assertEquals("OK", res.toString());
}
@@ -120,21 +132,6 @@ public class TestSSLHostConfigCompat ext
}
- @Override
- public void tearDown() throws Exception {
- Tomcat tomcat = getTomcatInstance();
- tomcat.start();
-
- // Check a request can be made
- ByteChunk res = getUrl("https://localhost:" + getPort() + "/");
- try {
- Assert.assertEquals("OK", res.toString());
- } finally {
- super.tearDown();
- }
- }
-
-
private static String getPath(String relativePath) {
File f = new File(relativePath);
return f.getAbsolutePath();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]