costin      01/01/06 16:24:00

  Modified:    src/tests/webpages/WEB-INF test-tomcat.xml
  Log:
  Removed few bad tests (IMHO) that tested for tomcat-specific behavior ( that was
  wrong ).
  
  The problem is that in previous versions of tomcat, errors RequestDispatcher.include
  were not propagated. Thanks to Larry and other's work on error handling we do now the
   right thing.
  
  One of the tests was also assuming the buffer is not reset before the error message 
is
  shown - I think it's very important to do reset the buffer.
  
  Also, in IncludeMismatch1 the test assumed the error handler will be called - but the
  spec requires to forward the exception, and it is dealt with in the calling servlet,
  so no error page will be displayed.
  
  Another bad test was Set-Cookie2 - which belongs to the wrong Cookie spec.
  
  Revision  Changes    Path
  1.2       +28 -3     jakarta-tomcat/src/tests/webpages/WEB-INF/test-tomcat.xml
  
  Index: test-tomcat.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/tests/webpages/WEB-INF/test-tomcat.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- test-tomcat.xml   2000/12/29 00:33:15     1.1
  +++ test-tomcat.xml   2001/01/07 00:24:00     1.2
  @@ -18,7 +18,7 @@
        <property name="host" value="localhost" />
        <property name="port"     value="8080" />
        <property name="tomcat.home" value="." />
  -     <property name="gdir" value="${tomcat.home}/lib/test/Golden" />
  +     <property name="gdir" value="../Golden" />
        <property name="http.protocol" value="HTTP/1.0" />
        
        <taskdef name="gtest" classname="org.apache.tomcat.task.GTest" />
  @@ -83,6 +83,14 @@
                returnCode="${http.protocol} 200"
                goldenFile="${gdir}/SimpleForward.txt" 
          />
  +
  +      <!-- Removed: the test calls RequestDispatcher.include(), and 
  +           the included servlet throws an exception. 
  +           Before Tomcat 3.2(3?) the exception was hidden - now we correctly
  +           throw it, so include() will throw exception, and since it's not
  +           catched no response should be seen. ( costin )
  +        
  +
         <gtest host="${host}" port="${port}"  description="PrintWriterTest"
                request="GET /test/servlet/dispatch.PrintWriterTest1Servlet HTTP/1.0"
                returnCode="${http.protocol} 200"
  @@ -98,6 +106,15 @@
                returnCode="${http.protocol} 200"
                responseMatch="Included servlet error: 500" 
          />
  +       End removed 
  +       -->
  + 
  +      <gtest host="${host}" port="${port}"  description="PrintWriterTest"
  +             request="GET /test/servlet/dispatch.PrintWriterTest1Servlet HTTP/1.0"
  +             returnCode="${http.protocol} 500"
  +       />
  + 
  +
         <gtest host="${host}" port="${port}"  description="Mismatch2"
                request="GET /test/servlet/dispatch.Mismatch2 HTTP/1.0"
                returnCode="${http.protocol} 200"
  @@ -110,11 +127,17 @@
                responseMatch="LINE1" 
          />
   
  +      <!-- BAD test: the included Target1 will call getWriter, 
  +          and IllegalState will be thrown - and catched by the IncludeMismatch.
  +          No error handler will be involved - the Dispatcher spec clearly 
  +          requires include() to propagate exceptions. 
  +          Previous behavior of tomcat was wrong. ( costin )
         <gtest host="${host}" port="${port}"  description="IncludeMismatch1-2"
                request="GET /test/servlet/dispatch.IncludeMismatch1 HTTP/1.0"
                returnCode="${http.protocol} 200"
                responseMatch="error: 500" 
          />
  +      -->
   
         <gtest host="${host}" port="${port}"  description="IncludeMismatch1-3"
                request="GET /test/servlet/dispatch.IncludeMismatch1 HTTP/1.0"
  @@ -485,7 +508,7 @@
         />
   
         <gtest host="${host}" port="${port}"  request="GET /test/servlet/Cookie25 
HTTP/1.0"
  -             expectHeaders="Set-Cookie2:foo=bar;Version=1;Max-Age=8640000"
  +             expectHeaders="Set-Cookie:foo=bar; Version=1; Max-Age=8640000"
         />
   
         <gtest host="${host}" port="${port}"  request="GET 
/test/servlet/ResponseError HTTP/1.0"
  @@ -726,10 +749,12 @@
         <gtest host="${host}" port="${port}"  request="GET 
/test/servlet/PermanentlyUnavailable HTTP/1.0"
                returnCode="${http.protocol} 503"
         />
  -      <!-- this one was loaded on startup -->
  +      <!-- this one was loaded on startup - Can't find it ( costin )
         <gtest host="${host}" port="${port}"  request="GET 
/test/servlet/PermanentlyUnavailable2 HTTP/1.0"
                returnCode="${http.protocol} 503"
         />
  +       -->
  +   
         <!-- 2nd hit on the unavailable servlet should succeed -->
         <gtest host="${host}" port="${port}"  request="GET /test/servlet/Unavailable 
HTTP/1.0"
                returnCode="${http.protocol} 200"
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to