Make it easier for tests to override the protocol (e.g. to test AJP)
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 10 Jul 2011 14:40:00 +0000 (14:40 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 10 Jul 2011 14:40:00 +0000 (14:40 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1144868 13f79535-47bb-0310-9956-ffa450edef68

test/org/apache/catalina/startup/TomcatBaseTest.java

index 52e2dfa..517be6f 100644 (file)
@@ -125,14 +125,7 @@ public abstract class TomcatBaseTest extends TestCase {
         
         tomcat = new Tomcat();
 
-        // Has a protocol been specified
-        String protocol = System.getProperty("tomcat.test.protocol");
-        
-        // Use BIO by default
-        if (protocol == null) {
-            protocol = "org.apache.coyote.http11.Http11Protocol";
-        }
-
+        String protocol = getProtocol();
         Connector connector = new Connector(protocol);
         // If each test is running on same port - they
         // may interfere with each other
@@ -164,6 +157,18 @@ public abstract class TomcatBaseTest extends TestCase {
         }
     }
     
+    protected String getProtocol() {
+        // Has a protocol been specified
+        String protocol = System.getProperty("tomcat.test.protocol");
+        
+        // Use BIO by default
+        if (protocol == null) {
+            protocol = "org.apache.coyote.http11.Http11Protocol";
+        }
+
+        return protocol;
+    }
+
     @Override
     public void tearDown() throws Exception {
         // Some tests may call tomcat.destroy(), some tests may just call