tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoli...@apache.org
Subject svn commit: r1228969 - /tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java
Date Sun, 08 Jan 2012 22:03:24 GMT
Author: kkolinko
Date: Sun Jan  8 22:03:24 2012
New Revision: 1228969

URL: http://svn.apache.org/viewvc?rev=1228969&view=rev
Log:
Update TestAsyncContextImpl:
Always add a host-level AccessLogValve, so that the test logic does not need to change when
the tests are run with "test.accesslog=true". The test is about error 500 for unhandled request.
That access log entry is written into topmost AccessLogValve.

Modified:
    tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java

Modified: tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java?rev=1228969&r1=1228968&r2=1228969&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java (original)
+++ tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java Sun Jan  8 22:03:24
2012
@@ -431,6 +431,8 @@ public class TestAsyncContextImpl extend
 
         TesterAccessLogValve alv = new TesterAccessLogValve();
         ctx.getPipeline().addValve(alv);
+        TesterAccessLogValve alvGlobal = new TesterAccessLogValve();
+        tomcat.getHost().getPipeline().addValve(alvGlobal);
 
         tomcat.start();
         ByteChunk res = new ByteChunk();
@@ -464,11 +466,14 @@ public class TestAsyncContextImpl extend
 
         // Check the access log
         if (completeOnTimeout && dispatchUrl != null) {
-            if (!isAccessLogEnabled()) {
-                alv.validateAccessLog(1, 500, 0, TimeoutServlet.ASYNC_TIMEOUT +
-                        TIMEOUT_MARGIN + REQUEST_TIME);
-            }
+            // This error is written into Host-level AccessLogValve only
+            alvGlobal.validateAccessLog(1, 500, 0, TimeoutServlet.ASYNC_TIMEOUT
+                    + TIMEOUT_MARGIN + REQUEST_TIME);
+            alv.validateAccessLog(0, 500, 0, 0);
         } else {
+            alvGlobal.validateAccessLog(1, 200, TimeoutServlet.ASYNC_TIMEOUT,
+                    TimeoutServlet.ASYNC_TIMEOUT + TIMEOUT_MARGIN +
+                    REQUEST_TIME);
             alv.validateAccessLog(1, 200, TimeoutServlet.ASYNC_TIMEOUT,
                     TimeoutServlet.ASYNC_TIMEOUT + TIMEOUT_MARGIN +
                     REQUEST_TIME);



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


Mime
View raw message