import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
import org.apache.catalina.core.StandardContext;
import org.apache.catalina.startup.Tomcat;
-import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.catalina.startup.TomcatBaseTestJUnit4;
import org.apache.tomcat.util.buf.ByteChunk;
-public class TestMapperWelcomeFiles extends TomcatBaseTest {
+public class TestMapperWelcomeFiles extends TomcatBaseTestJUnit4 {
+ @Test
public void testWelcomeFileNotStrict() throws Exception {
Tomcat tomcat = getTomcatInstance();
assertEquals(HttpServletResponse.SC_OK, rc);
assertTrue(bc.toString().contains("Servlet"));
}
-
+
+ @Test
public void testWelcomeFileStrict() throws Exception {
Tomcat tomcat = getTomcatInstance();
import java.util.Arrays;
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
import org.apache.catalina.startup.Tomcat;
-import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.catalina.startup.TomcatBaseTestJUnit4;
import org.apache.tomcat.util.buf.ByteChunk;
/**
* generated using a test CA the files for which are in the Tomcat PMC private
* repository since not all of them are AL2 licensed.
*/
-public class TestClientCert extends TomcatBaseTest {
-
+public class TestClientCert extends TomcatBaseTestJUnit4 {
+
+ @Test
public void testClientCertGet() throws Exception {
if (!TesterSupport.isRenegotiationSupported(getTomcatInstance())) {
return;
assertEquals("OK", res.toString());
}
+ @Test
public void testClientCertPostSmaller() throws Exception {
Tomcat tomcat = getTomcatInstance();
int bodySize = tomcat.getConnector().getMaxSavePostSize() / 2;
doTestClientCertPost(bodySize, false);
}
+ @Test
public void testClientCertPostSame() throws Exception {
Tomcat tomcat = getTomcatInstance();
int bodySize = tomcat.getConnector().getMaxSavePostSize();
doTestClientCertPost(bodySize, false);
}
+ @Test
public void testClientCertPostLarger() throws Exception {
Tomcat tomcat = getTomcatInstance();
int bodySize = tomcat.getConnector().getMaxSavePostSize() * 2;
doTestClientCertPost(bodySize, true);
}
- public void doTestClientCertPost(int bodySize, boolean expectProtectedFail)
+ private void doTestClientCertPost(int bodySize, boolean expectProtectedFail)
throws Exception {
if (!TesterSupport.isRenegotiationSupported(getTomcatInstance())) {
return;
import javax.net.ssl.SSLHandshakeException;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.junit.Test;
+
import org.apache.catalina.connector.Connector;
import org.apache.catalina.startup.Tomcat;
-import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.catalina.startup.TomcatBaseTestJUnit4;
import org.apache.coyote.ProtocolHandler;
import org.apache.coyote.http11.AbstractHttp11JsseProtocol;
import org.apache.tomcat.util.buf.ByteChunk;
* generated using a test CA the files for which are in the Tomcat PMC private
* repository since not all of them are AL2 licensed.
*/
-public class TestCustomSsl extends TomcatBaseTest {
+public class TestCustomSsl extends TomcatBaseTestJUnit4 {
+ @Test
public void testCustomSslImplementation() throws Exception {
TesterSupport.configureClientSsl();
assertTrue(res.toString().indexOf("<h1>Hello World!</h1>") > 0);
}
+ @Test
public void testCustomTrustManager1() throws Exception {
doTestCustomTrustManager(false);
}
-
+
+ @Test
public void testCustomTrustManager2() throws Exception {
doTestCustomTrustManager(true);
}
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.junit.Test;
+
import org.apache.catalina.startup.Tomcat;
-import org.apache.catalina.startup.TomcatBaseTest;
+import org.apache.catalina.startup.TomcatBaseTestJUnit4;
import org.apache.tomcat.util.buf.ByteChunk;
/**
* generated using a test CA the files for which are in the Tomcat PMC private
* repository since not all of them are AL2 licensed.
*/
-public class TestSsl extends TomcatBaseTest {
+public class TestSsl extends TomcatBaseTestJUnit4 {
+ @Test
public void testSimpleSsl() throws Exception {
TesterSupport.configureClientSsl();
assertTrue(res.toString().indexOf("<h1>Hello World!</h1>") > 0);
}
+ @Test
public void testKeyPass() throws Exception {
TesterSupport.configureClientSsl();
boolean handshakeDone = false;
-
+
+ @Test
public void testRenegotiateFail() throws Exception {
// If RFC5746 is supported, renegotiation will always work (and will
fail("Re-negotiation worked");
}
-
+
+ @Test
public void testRenegotiateWorks() throws Exception {
Tomcat tomcat = getTomcatInstance();
import java.util.StringTokenizer;
-import org.apache.catalina.startup.TomcatBaseTest;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
-public class TestJarScanner extends TomcatBaseTest {
+import org.junit.Test;
+import org.apache.catalina.startup.TomcatBaseTestJUnit4;
+
+public class TestJarScanner extends TomcatBaseTestJUnit4 {
+
+ @Test
public void testJarsToSkipFormat() {
String jarList = System.getProperty(Constants.SKIP_JARS_PROPERTY);