nacho 01/03/03 14:08:16
Modified: src/tests/webpages/WEB-INF test-tomcat.xml
Added: src/tests/webpages/WEB-INF/classes CloseWriter.java
src/tests/share/tests/jsp/Golden CloseWriter.txt
Log:
Regression test for reciclying writer bug ( aka RequesDispatcher ) .
Revision Changes Path
1.1
jakarta-tomcat/src/tests/webpages/WEB-INF/classes/CloseWriter.java
Index: CloseWriter.java
===================================================================
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class CloseWriter extends HttpServlet {
public void init(ServletConfig conf)
throws ServletException
{
super.init(conf);
}
public void service(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
res.setContentType("text/plain");
PrintWriter out= res.getWriter();
out.write( "Closing Writer" );
/// XXX trying to simulate the closed outputstream bug,
// this test runs 2 times hoping it will catch a regression
// on this issue..
out.close();
}
}
1.1 jakarta-tomcat/src/tests/share/tests/jsp/Golden/CloseWriter.txt
Index: CloseWriter.txt
===================================================================
Closing Writer
1.27 +25 -9 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.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- test-tomcat.xml 2001/03/01 17:59:03 1.26
+++ test-tomcat.xml 2001/03/03 22:08:16 1.27
@@ -16,7 +16,7 @@
early tests.
-->
- <property name="revision" value="$Revision: 1.26 $" />
+ <property name="revision" value="$Revision: 1.27 $" />
<property name="host" value="127.0.0.1" />
<property name="port" value="8080" />
<property name="outputType" value="text" />
@@ -52,7 +52,7 @@
<taskdef name="comment"
classname="org.apache.tomcat.util.test.Body" />
- <taskdef name="gtestDefaults"
+ <taskdef name="gtestDefaults"
classname="org.apache.tomcat.util.test.TestDefaults" />
<!-- Backward compatibility -->
@@ -108,7 +108,7 @@
<target name="params" depends="init">
<httpClient>
- <comment>Simple GET with parmeters</comment>
+ <comment>Simple GET with parameters</comment>
<httpRequest path="/test/servlet/params.Params">
<param name="a" value="k" />
<param name="c" value="l" />
@@ -120,7 +120,7 @@
</httpClient>
<httpClient>
- <comment>Simple POST parmeters</comment>
+ <comment>Simple POST parameters</comment>
<httpRequest path="/test/servlet/params.Params"
method="POST">
<param name="a" value="b" />
@@ -133,7 +133,7 @@
<httpClient>
<comment>POST and GET parameters</comment>
- <httpRequest
+ <httpRequest
path="/test/servlet/params.Params"
method="POST">
<param name="a" value="x" type="GET" />
@@ -214,7 +214,7 @@
</httpRequest>
<responseMatch match="before:a = [ k , m ]" />
<responseMatch match="before:c = [ l ]" />
- <responseMatch
+ <responseMatch
match="Calling RD.include for: params.Params/include1?a=b"/>
<responseMatch match="/include1:a = [ b , k , m ]" />
<responseMatch match="/include1:c = [ l ]" />
@@ -339,9 +339,9 @@
<target name="dispatch" depends="init">
<gtest description="SimpleInclude"
request="GET /test/servlet/dispatch.SimpleIncludeServlet HTTP/1.0"
- expectHeaders="Content-Type:text/foobar"
+ expectHeaders="Content-Type:text/foobar"
returnCode="${http.protocol} 200"
- goldenFile="${gdir}/SimpleInclude.txt"
+ goldenFile="${gdir}/SimpleInclude.txt"
/>
<gtest description="SimpleForward"
request="GET /test/servlet/dispatch.SimpleForwardServlet HTTP/1.0"
@@ -1107,11 +1107,27 @@
request="GET /test/jsp/HelloWorld.jsp%20 HTTP/1.0"
returnCode="${http.protocol} 404"
/>
+ </target>
+ <target name="writer">
+ <httpClient>
+ <comment>Writer test, closing writer at end</comment>
+ <httpRequest path="/test/servlet/CloseWriter" />
+ <httpStatusMatch match="200" />
+ <headerMatch name="Content-Type" value="text/plain" />
+ <goldenMatch file="${gdir}/CloseWriter.txt"/>
+ </httpClient>
+ <httpClient>
+ <comment>Writer test,trying to catch reciclying issues</comment>
+ <httpRequest path="/test/servlet/CloseWriter" />
+ <httpStatusMatch match="200" />
+ <headerMatch name="Content-Type" value="text/plain" />
+ <goldenMatch file="${gdir}/CloseWriter.txt"/>
+ </httpClient>
</target>
<!-- ==================== All targets ==================== -->
- <target name="client"
depends="file,params,dispatch,get,requestMap,post,wrong_request,restricted,jsp,unavailable,headers">
+ <target name="client"
depends="file,params,writer,dispatch,get,requestMap,post,wrong_request,restricted,jsp,unavailable,headers">
</target>
<!-- ==================== Aux targets ==================== -->
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]