Configure Checkstyle to allow limited static imports and revert most of r1056947
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 10 Jan 2011 07:43:34 +0000 (07:43 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 10 Jan 2011 07:43:34 +0000 (07:43 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1057100 13f79535-47bb-0310-9956-ffa450edef68

res/checkstyle/checkstyle.xml
test/org/apache/catalina/servlets/TestDefaultServlet.java

index 024bf91..5204bc7 100644 (file)
     
     <!-- Imports -->
     <module name="AvoidStarImport"/>
-    <module name="AvoidStaticImport"/>
+    <module name="AvoidStaticImport">
+        <property name="excludes"
+                  value="org.apache.catalina.startup.SimpleHttpClient.CRLF"/>
+    </module>
     <module name="IllegalImport"/>
     <module name="ImportOrder">
         <property name="groups" value="java,javax,async,jsp2,junit,org,util"/>
index d161c0d..cf01d5d 100644 (file)
@@ -30,6 +30,8 @@ import java.util.TimeZone;
 
 import javax.servlet.http.HttpServletResponse;
 
+import static org.apache.catalina.startup.SimpleHttpClient.CRLF;
+
 import org.apache.catalina.startup.SimpleHttpClient;
 import org.apache.catalina.startup.Tomcat;
 import org.apache.catalina.startup.TomcatBaseTest;
@@ -186,8 +188,8 @@ public class TestDefaultServlet extends TomcatBaseTest {
         client.setPort(getPort());
 
         client.reset();
-        client.setRequest(new String[] { "GET /MyApp/missing HTTP/1.0" +
-                SimpleHttpClient.CRLF + SimpleHttpClient.CRLF });
+        client.setRequest(new String[] {
+                "GET /MyApp/missing HTTP/1.0" +CRLF + CRLF });
         client.connect();
         client.processRequest();
         assertTrue(client.isResponse404());
@@ -203,11 +205,10 @@ public class TestDefaultServlet extends TomcatBaseTest {
         //
         client.reset();
         client.setRequest(new String[] {
-                "GET /MyApp/missing HTTP/1.1" + SimpleHttpClient.CRLF +
-                "Host: localhost" + SimpleHttpClient.CRLF +
-                "Connection: close" + SimpleHttpClient.CRLF +
-                "If-Modified-Since: " + tomorrow + SimpleHttpClient.CRLF +
-                SimpleHttpClient.CRLF });
+                "GET /MyApp/missing HTTP/1.1" + CRLF +
+                "Host: localhost" + CRLF +
+                "Connection: close" + CRLF +
+                "If-Modified-Since: " + tomorrow + CRLF + CRLF });
         client.connect();
         client.processRequest();
         assertTrue(client.isResponse404());
@@ -217,11 +218,10 @@ public class TestDefaultServlet extends TomcatBaseTest {
         //
         client.reset();
         client.setRequest(new String[] {
-                "GET /MyApp/missing HTTP/1.1" + SimpleHttpClient.CRLF +
-                "Host: localhost" + SimpleHttpClient.CRLF +
-                "Connection: close" + SimpleHttpClient.CRLF +
-                "Range: bytes=0-100" + SimpleHttpClient.CRLF +
-                SimpleHttpClient.CRLF });
+                "GET /MyApp/missing HTTP/1.1" + CRLF +
+                "Host: localhost" + CRLF +
+                "Connection: close" + CRLF +
+                "Range: bytes=0-100" + CRLF + CRLF });
         client.connect();
         client.processRequest();
         assertTrue(client.isResponse404());
@@ -261,8 +261,8 @@ public class TestDefaultServlet extends TomcatBaseTest {
         client.setPort(getPort());
 
         client.reset();
-        client.setRequest(new String[] { "GET /MyApp/missing HTTP/1.0" +
-                SimpleHttpClient.CRLF + SimpleHttpClient.CRLF });
+        client.setRequest(new String[] {
+                "GET /MyApp/missing HTTP/1.0" + CRLF + CRLF });
         client.connect();
         client.processRequest();
         assertTrue(client.isResponse404());