costin 01/01/21 12:10:40
Modified: src/admin/WEB-INF admin.tld
src/admin/WEB-INF/classes/tadm GTestTEI.java GTestTag.java
src/admin/test test.jsp
src/share/org/apache/tomcat/util/test DefaultMatcher.java
GTest.java HttpClient.java
src/tests/webpages/WEB-INF test-tomcat.xml
Added: src/share/org/apache/tomcat/util/test TestDefaults.java
Log:
Varius cosmetic changes to the testing component of the admin webapp.
- Option to do "external" formating ( i.e. the test results are stored,
and the JSP page can do whatever formating it wants ). Old style is
still supported ( text, simple html generated by GTest )
- A simple tag to set the defaults for HttpClient and GTest ( avoid quite
a few keystrokes - host="${host}", etc for each test )
- test.jsp will display the FAILED tests first ( easier to read )
- the test now detects HTTP/0.9 errors ( 9 tests are now failing, mostly
because of a bug in HTTP/0.9 support - not hard to fix, I think the bug
is also present in 3.2 ). The old GTest didn't implemented 0.9 support
corectly, and accepted 1.0 responses for 0.9 requests. Few of the tests are
wrong from the same reason ( expect status on 0.9 requests )
- fixes, more options, etc
Revision Changes Path
1.6 +5 -0 jakarta-tomcat/src/admin/WEB-INF/admin.tld
Index: admin.tld
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/admin/WEB-INF/admin.tld,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- admin.tld 2001/01/21 06:39:21 1.5
+++ admin.tld 2001/01/21 20:10:37 1.6
@@ -107,6 +107,11 @@
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
+ <attribute>
+ <name>outputType</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
</tag>
1.2 +12 -6 jakarta-tomcat/src/admin/WEB-INF/classes/tadm/GTestTEI.java
Index: GTestTEI.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/admin/WEB-INF/classes/tadm/GTestTEI.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- GTestTEI.java 2001/01/20 20:14:28 1.1
+++ GTestTEI.java 2001/01/21 20:10:38 1.2
@@ -20,15 +20,21 @@
public VariableInfo[] getVariableInfo(TagData data) {
return (new VariableInfo[] {
- new VariableInfo("gtestSuccessCount",
- "java.lang.Integer",
+ new VariableInfo("gtestTestResults",
+ "java.util.Vector",
true, VariableInfo.AT_BEGIN),
- new VariableInfo("gtestErrorCount",
- "java.lang.Integer",
+ new VariableInfo("gtestTestFailures",
+ "java.util.Vector",
true, VariableInfo.AT_BEGIN),
- new VariableInfo("gtestErrors",
+ new VariableInfo("gtestTestSuccess",
"java.util.Vector",
- true, VariableInfo.AT_BEGIN)
+ true, VariableInfo.AT_BEGIN),
+ new VariableInfo("gtestTestProperties",
+ "java.util.Hashtable",
+ true, VariableInfo.AT_BEGIN),
+ new VariableInfo("gtestHttpClients",
+ "java.util.Hashtable",
+ true, VariableInfo.AT_BEGIN),
});
}
1.5 +32 -10 jakarta-tomcat/src/admin/WEB-INF/classes/tadm/GTestTag.java
Index: GTestTag.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/admin/WEB-INF/classes/tadm/GTestTag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- GTestTag.java 2001/01/21 06:39:21 1.4
+++ GTestTag.java 2001/01/21 20:10:38 1.5
@@ -36,8 +36,18 @@
String base=targetCtx.getRealPath("/");
runTest( base );
- //pageContext.setAttribute("cm", cm);
+ pageContext.setAttribute("gtestTestResults",
+ GTest.getTestResults());
+ pageContext.setAttribute("gtestTestFailures",
+ GTest.getTestFailures());
+ pageContext.setAttribute("gtestTestSuccess",
+ GTest.getTestSuccess());
+ pageContext.setAttribute("gtestTestProperties",
+ GTest.getTestProperties());
+ pageContext.setAttribute("gtestHttpClients",
+ HttpClient.getHttpClients());
+
} catch (Exception ex ) {
ex.printStackTrace();
}
@@ -64,7 +74,8 @@
String target;
String testApp;
String debug;
-
+ String outputType="html";
+
/** Set the name of the test.xml, relative to the base dir.
* For example, /WEB-INF/test-tomcat.xml
*/
@@ -75,7 +86,7 @@
/** Set the target - a subset of tests to be run
*/
public void setTarget( String s ) {
- System.out.println("Setting target " + s );
+ // System.out.println("Setting target " + s );
target=s;
}
@@ -89,6 +100,10 @@
public void setDebug( String s ) {
debug=s;
}
+
+ public void setOutputType( String s ) {
+ outputType=s;
+ }
// -------------------- Implementation methods --------------------
@@ -96,17 +111,24 @@
PrintWriter out=pageContext.getResponse().getWriter();
try {
out.flush();
- out.println("Running test " + base + " " + testFileName + " "
- + target + "</br>" );
+ // out.println("Running test " + base + " " + testFileName + " "
+ // + target + "</br>" );
File testFile=new File( base + testFileName);
- // old task
- org.apache.tomcat.task.GTest.setDefaultWriter( out );
- org.apache.tomcat.task.GTest.setHtmlMode( true );
+ // reset test repositories
+ GTest.getTestResults().setSize(0);
+ GTest.getTestFailures().setSize(0);
+ GTest.getTestSuccess().setSize(0);
+ GTest.getTestProperties().clear();
+ HttpClient.getHttpClients().clear();
+
+ // // old task
+ // org.apache.tomcat.task.GTest.setDefaultWriter( out );
+ // org.apache.tomcat.task.GTest.setHtmlMode( true );
// new one
GTest.setDefaultWriter(out);
- GTest.setDefaultOutput("html");
+ GTest.setDefaultOutput("none"); // external formatting
if(debug!=null)
GTest.setDefaultDebug(Integer.valueOf( debug ).intValue());
@@ -133,7 +155,7 @@
ex.printStackTrace(out);
if( ex instanceof BuildException ) {
Throwable ex1=((BuildException)ex).getException();
- System.out.println("Root cause: " );
+ out.println("Root cause: " );
if( ex1!=null)
ex1.printStackTrace(out);
}
1.4 +58 -1 jakarta-tomcat/src/admin/test/test.jsp
Index: test.jsp
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/admin/test/test.jsp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- test.jsp 2001/01/21 06:39:21 1.3
+++ test.jsp 2001/01/21 20:10:38 1.4
@@ -45,5 +45,62 @@
<adm:gtest testFile="WEB-INF/test-tomcat.xml"
testApp="/test"
target='<%= request.getParameter("target") %>'
- debug='<%= request.getParameter("debug") %>' />
+ debug='<%= request.getParameter("debug") %>'
+ outputType='none' />
+<% // Test completed, display the results ( outType=none means
+ // Gtest doesn't generate any output ( but we have to wait untill
+ // it's done ), use 'html' for "interactive" results
+%>
+
+<% // -------------------- Failures -------------------- %>
+<h1>FAILED Tests</h1>
+
+<adm:iterate name="failures" enumeration="<%= gtestTestFailures.elements() %>"
+ type="org.apache.tomcat.util.test.GTest" >
+<% // Need more tags - if, etc
+%>
+<a href='<%= failures.getHttpClient().getURI() %>'>
+<font color='red'> FAIL </font></a> ( <%= failures.getDescription() %> )
+ <%= failures.getHttpClient().getRequestLine() %>
+<br>
+TEST: <%= failures.getMatcher().getTestDescription() %>
+<br>
+<b>Request: </b>
+<pre>
+ <%= failures.getHttpClient().getFullRequest() %>
+</pre>
+
+<b>Message: </b>
+<pre>
+ <%= failures.getMatcher().getMessage() %>
+</pre>
+
+<b>Response status: </b>
+<%= failures.getHttpClient().getResponse().getResponseLine() %>
+<br>
+<b>Response headers: </b>
+ (I'm not sure how to do embeded iterations, need JSP expert )
+<br>
+
+<b>Response body: </b>
+<pre>
+<%= failures.getHttpClient().getResponse().getResponseBody() %>
+</pre>
+
+</adm:iterate>
+
+<% // -------------------- Success story -------------------- %>
+
+<h1>PASSED Tests</h1>
+
+<adm:iterate name="success" enumeration="<%= gtestTestSuccess.elements() %>"
+ type="org.apache.tomcat.util.test.GTest" >
+
+<a href='<%= success.getHttpClient().getURI() %>'>
+OK</a> ( <%= success.getDescription() %> )
+ <%= success.getHttpClient().getRequestLine() %>
+<br>
+TEST: <%= success.getMatcher().getTestDescription() %>
+<br>
+</adm:iterate>
1.3 +58 -6
jakarta-tomcat/src/share/org/apache/tomcat/util/test/DefaultMatcher.java
Index: DefaultMatcher.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/test/DefaultMatcher.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DefaultMatcher.java 2001/01/21 06:39:22 1.2
+++ DefaultMatcher.java 2001/01/21 20:10:39 1.3
@@ -161,6 +161,18 @@
Header.parseHeadersAsString( s, expectHeaders );
}
+ public Hashtable getExpectHeaders() {
+ if( headerVector.size() > 0 ) {
+ Enumeration en=headerVector.elements();
+ while( en.hasMoreElements()) {
+ Header rh=(Header)en.nextElement();
+ expectHeaders.put( rh.getName(), rh );
+ }
+ headerVector=new Vector();
+ }
+ return expectHeaders;
+ }
+
/** Verify that response match the string
*/
public void setResponseMatch( String s ) {
@@ -173,6 +185,51 @@
this.returnCode=s;
}
+ /** A test description of the test beeing made
+ */
+ public String getTestDescription() {
+ StringBuffer desc=new StringBuffer();
+ boolean needAND=false;
+ if( returnCode != null ) {
+ desc.append("( returnCode matches '" + returnCode + "') ");
+ needAND=true;
+ }
+
+ if( getExpectHeaders().size() > 0 ) {
+ Enumeration e=expectHeaders.keys();
+ while( e.hasMoreElements()) {
+ if( ! needAND ) needAND=true;
+ if( needAND ) desc.append( " && " );
+ String key=(String)e.nextElement();
+ Header h=(Header)expectHeaders.get(key);
+ desc.append("( responseHeader '" + h.getName() +
+ ": " + h.getValue() + "' ) ");
+ }
+ }
+
+ if( responseMatch != null ) {
+ if( ! needAND ) needAND=true;
+ if( needAND ) desc.append( " && " );
+
+ desc.append("( responseBody matches '"+ responseMatch + "') ");
+ }
+
+ if( goldenFile != null ) {
+ if( ! needAND ) needAND=true;
+ if( needAND ) desc.append( " && " );
+
+ desc.append("( responseBody " );
+ if( exactMatch )
+ desc.append( "equals file '" );
+ else
+ desc.append( "like file '");
+ desc.append( goldenFile + "') ");
+ }
+
+ desc.append( " == " ).append( magnitude );
+ return desc.toString();
+ }
+
// -------------------- Execute the request --------------------
public void execute() {
@@ -206,13 +263,8 @@
log(" Got : " + responseLine);
}
}
-
- Enumeration en=headerVector.elements();
- while( en.hasMoreElements()) {
- Header rh=(Header)en.nextElement();
- expectHeaders.put( rh.getName(), rh );
- }
+ getExpectHeaders();
if( expectHeaders.size() > 0 ) {
// Check if we got the expected headers
if(headers==null) {
1.4 +62 -6 jakarta-tomcat/src/share/org/apache/tomcat/util/test/GTest.java
Index: GTest.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/test/GTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- GTest.java 2001/01/21 06:39:22 1.3
+++ GTest.java 2001/01/21 20:10:39 1.4
@@ -71,20 +71,29 @@
This class is using the well-known ant patterns.
*/
public class GTest {
+ // Defaults
+ static PrintWriter defaultOutput=new PrintWriter(System.out);
+ static String defaultOutType="text";
+ static int defaultDebug=0;
+ static boolean failureOnly=false;
+
+ // all test results will be available
+ static Vector testResults=new Vector();
+ static Vector testFailures=new Vector();
+ static Vector testSuccess=new Vector();
+ static Hashtable testProperties=new Hashtable();
+ // Instance variables
+
HttpClient httpClient=new HttpClient();
DefaultMatcher matcher=new DefaultMatcher();
String description="No description";
- static PrintWriter defaultOutput=new PrintWriter(System.out);
- static String defaultOutType="text";
- static int defaultDebug=0;
-
PrintWriter out=defaultOutput;
String outType=defaultOutType;
int debug=defaultDebug;
- boolean failureOnly=false;
+ boolean result=false;
public GTest() {
matcher.setDebug( debug );
@@ -101,10 +110,41 @@
defaultOutput=pw;
}
+ /** @deprecated. Output will be text or none, with external
+ formater ( or event ? - it would be nice, but too serious, it's
+ still a simple test runner )
+ */
public static void setDefaultOutput( String s ) {
defaultOutType=s;
}
+ /** Vector of GTest elements, containing all test instances
+ * that were run.
+ */
+ public static Vector getTestResults() {
+ return testResults;
+ }
+
+ /** Vector of GTest elements, containing all test instances
+ * that were run and failed.
+ */
+ public static Vector getTestFailures() {
+ return testFailures;
+ }
+
+ /** Vector of GTest elements, containing all test instances
+ * that were run and failed.
+ */
+ public static Vector getTestSuccess() {
+ return testSuccess;
+ }
+
+ /** Various global test propertis
+ */
+ public static Hashtable getTestProperties() {
+ return testProperties;
+ }
+
// -------------------- GTest behavior --------------------
public void setWriter( PrintWriter pw ) {
out=pw;
@@ -135,7 +175,16 @@
public void addDefaultMatcher( DefaultMatcher m ) {
matcher=m;
}
+ // -------------------- Getters --------------------
+
+ public HttpClient getHttpClient() {
+ return httpClient;
+ }
+ public DefaultMatcher getMatcher() {
+ return matcher;
+ }
+
// -------------------- Local properties --------------------
/** Description should be in <test description=""/>
*/
@@ -236,7 +285,7 @@
matcher.setResponse( resp );
matcher.execute();
- boolean result=matcher.getResult();
+ result=matcher.getResult();
// don't print OKs
if( result && failureOnly ) return;
@@ -251,6 +300,13 @@
// no exception should be thrown in normal operation
ex.printStackTrace();
}
+
+ // after execute() is done, add the test result to the list
+ testResults.addElement( this );
+ if( !result )
+ testFailures.addElement( this );
+ else
+ testSuccess.addElement( this );
}
1.3 +41 -6
jakarta-tomcat/src/share/org/apache/tomcat/util/test/HttpClient.java
Index: HttpClient.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/test/HttpClient.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- HttpClient.java 2001/01/21 06:39:22 1.2
+++ HttpClient.java 2001/01/21 20:10:39 1.3
@@ -73,14 +73,25 @@
*
*/
public class HttpClient {
- static String CRLF="\r\n";
- String host="localhost";
- int port=8080;
+ // Defaults
+ static String defaultHost="localhost";
+ static int defaultPort=8080;
+ static int defaultDebug=0;
+ static String defaultProtocol="HTTP/1.0";
+
+ static Hashtable clients=new Hashtable();
+
+ // Instance variables
+
+ String id;
+ // Instance variables
+ String host=defaultHost;
+ int port=defaultPort;
- int debug=0;
+ int debug=defaultDebug;
String method="GET";
- String protocol="HTTP/1.0";
+ String protocol=defaultProtocol;
String path;
String requestLine;
@@ -92,10 +103,25 @@
// Response resulted from this request
Response response=new Response();
+ static String CRLF="\r\n";
public HttpClient() {
}
+ /** Return one of the "named" clients that have been executed so far.
+ */
+ public static Hashtable getHttpClients() {
+ return clients;
+ }
+
+ /** Set an unique id to this request. This allows it to be
+ * referenced later, for complex tests/matchers that look
+ * at multiple requests.
+ */
+ public void setId(String id) {
+ this.id=id;
+ }
+
/** Server that will receive the request
*/
public void setHost(String h) {
@@ -173,6 +199,14 @@
}
public String getRequestLine( ) {
+ if( requestLine==null ) {
+ prepareRequest();
+ int idx=fullRequest.indexOf("\r");
+ if( idx<0 )
+ requestLine=fullRequest;
+ else
+ requestLine=fullRequest.substring(0, idx );
+ }
return requestLine;
}
@@ -206,12 +240,13 @@
} catch(Exception ex ) {
ex.printStackTrace();
}
+ if( id!=null )
+ clients.put( id, this );
}
/**
*/
private void prepareRequest()
- throws Exception
{
// explicitely set
if( fullRequest != null ) return;
1.1
jakarta-tomcat/src/share/org/apache/tomcat/util/test/TestDefaults.java
Index: TestDefaults.java
===================================================================
/*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* [Additional notices, if required by prior licensing conditions]
*
*/
package org.apache.tomcat.util.test;
import java.net.*;
import java.io.*;
import java.util.*;
import java.net.*;
/** Set default values for HttpClient and GTest.
*/
public class TestDefaults {
public TestDefaults() {
}
public void setHost( String s ) {
// I know, I'll add setters...
HttpClient.defaultHost=s;
}
public void setPort(int port ) {
HttpClient.defaultPort=port;
}
public void setProtocol( String proto ) {
HttpClient.defaultProtocol=proto;
}
public void setDebug( int debug ) {
GTest.setDefaultDebug( debug );
}
public void setOutputType(String t ) {
GTest.setDefaultOutput(t);
}
public void execute() {
}
}
1.5 +198 -184 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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- test-tomcat.xml 2001/01/21 06:39:22 1.4
+++ test-tomcat.xml 2001/01/21 20:10:40 1.5
@@ -18,10 +18,13 @@
<property name="host" value="localhost" />
<property name="port" value="8080" />
- <property name="tomcat.home" value="." />
- <property name="gdir" value="../Golden" />
+ <property name="outputType" value="text" />
+ <property name="debug" value="0" />
<property name="http.protocol" value="HTTP/1.0" />
-
+
+ <property name="gdir" value="../Golden" />
+
+ <!-- ==================== Tasks ==================== -->
<taskdef name="gtest" classname="org.apache.tomcat.util.test.GTest" />
<taskdef name="httpClient"
classname="org.apache.tomcat.util.test.HttpClient" />
@@ -32,9 +35,20 @@
<taskdef name="defaultMatcher"
classname="org.apache.tomcat.util.test.DefaultMatcher" />
+ <taskdef name="gtestDefaults"
+ classname="org.apache.tomcat.util.test.TestDefaults" />
+
+ <!-- ==================== Defaults ==================== -->
+ <target name="init" >
+ <gtestDefaults port="${port}"
+ host="${host}"
+ debug="${debug}"
+ protocol="${http.protocol}"
+ outputType="${outputType}" />
+ </target>
<!-- ==================== File tests ==================== -->
- <target name="new-style" >
- <gtest host="${host}" port="${port}" >
+ <target name="new-style" depends="init">
+ <gtest>
<httpClient path="/test/index.html" debug="0">
<header name="foo" value="bar"/>
<body>RequestBody</body>
@@ -47,60 +61,60 @@
<!-- ==================== File tests ==================== -->
- <target name="file">
- <gtest host="${host}" port="${port}" description="Content Type Test"
+ <target name="file" depends="init">
+ <gtest description="Content Type Test"
request="GET /test/binaries/image1.gif HTTP/1.0"
expectHeaders="Content-Type:image/gif" />
- <gtest host="${host}" port="${port}" description="File Integrity and Length
Test"
+ <gtest description="File Integrity and Length Test"
request="GET /test/binaries/image1.gif HTTP/1.0"
goldenFile="${gdir}/image1.gif"
exactMatch="true" />
</target>
- <target name="file-tomcat" depends="file">
- <gtest host="${host}" port="${port}" description="Welcome File Test1"
+ <target name="file-tomcat" depends="init,file">
+ <gtest description="Welcome File Test1"
request="GET /test/welcome HTTP/1.0"
expectHeaders="Location:/welcome/"
returnCode="${http.protocol} 302" />
- <gtest host="${host}" port="${port}" description="Welcome File Test2"
+ <gtest description="Welcome File Test2"
request="GET /test/binaries HTTP/1.0"
returnCode="${http.protocol} 200" />
- <gtest host="${host}" port="${port}" description="Welcome File Test3"
+ <gtest description="Welcome File Test3"
request="GET /test/welcome/ HTTP/1.0"
returnCode="${http.protocol} 302"
goldenFile="${gdir}/movedwelcome.txt" />
</target>
- <target name="file-apache" depends="file">
- <gtest host="${host}" port="${port}" description="Welcome File Test1"
+ <target name="file-apache" depends="init,file">
+ <gtest description="Welcome File Test1"
request="GET /test/welcome HTTP/1.0"
expectHeaders="Location:/welcome/"
returnCode="${http.protocol} 301" />
- <gtest host="${host}" port="${port}" description="Welcome File Test2"
+ <gtest description="Welcome File Test2"
request="GET /test/binaries HTTP/1.0"
returnCode="${http.protocol} 301" />
<!-- Tomcat returns 302 -->
- <gtest host="${host}" port="${port}" description="Welcome File Test3"
+ <gtest description="Welcome File Test3"
request="GET /test/welcome/ HTTP/1.0"
returnCode="${http.protocol} 200"
goldenFile="${gdir}/welcome.txt" />
</target>
<!-- ==================== Dispatch tests ==================== -->
- <target name="dispatch">
- <gtest host="${host}" port="${port}" description="SimpleInclude"
+ <target name="dispatch" depends="init">
+ <gtest description="SimpleInclude"
request="GET /test/servlet/dispatch.SimpleIncludeServlet HTTP/1.0"
expectHeaders="Content-Type:text/foobar"
returnCode="${http.protocol} 200"
goldenFile="${gdir}/SimpleInclude.txt"
/>
- <gtest host="${host}" port="${port}" description="SimpleForward"
+ <gtest description="SimpleForward"
request="GET /test/servlet/dispatch.SimpleForwardServlet HTTP/1.0"
expectHeaders="Content-Type:text/funky"
returnCode="${http.protocol} 200"
@@ -114,17 +128,17 @@
catched no response should be seen. ( costin )
- <gtest host="${host}" port="${port}" description="PrintWriterTest"
+ <gtest description="PrintWriterTest"
request="GET /test/servlet/dispatch.PrintWriterTest1Servlet HTTP/1.0"
returnCode="${http.protocol} 200"
responseMatch="PreInclude"
/>
- <gtest host="${host}" port="${port}" description="PrintWriterTest"
+ <gtest description="PrintWriterTest"
request="GET /test/servlet/dispatch.PrintWriterTest1Servlet HTTP/1.0"
returnCode="${http.protocol} 200"
responseMatch="PostInclude"
/>
- <gtest host="${host}" port="${port}" description="PrintWriterTest"
+ <gtest description="PrintWriterTest"
request="GET /test/servlet/dispatch.PrintWriterTest1Servlet HTTP/1.0"
returnCode="${http.protocol} 200"
responseMatch="Included servlet error: 500"
@@ -132,19 +146,19 @@
End removed
-->
- <gtest host="${host}" port="${port}" description="PrintWriterTest"
+ <gtest description="PrintWriterTest"
request="GET /test/servlet/dispatch.PrintWriterTest1Servlet HTTP/1.0"
returnCode="${http.protocol} 500"
/>
- <gtest host="${host}" port="${port}" description="Mismatch2"
+ <gtest description="Mismatch2"
request="GET /test/servlet/dispatch.Mismatch2 HTTP/1.0"
returnCode="${http.protocol} 200"
goldenFile="${gdir}/Mismatch2.txt"
/>
- <gtest host="${host}" port="${port}" description="IncludeMismatch1-1"
+ <gtest description="IncludeMismatch1-1"
request="GET /test/servlet/dispatch.IncludeMismatch1 HTTP/1.0"
returnCode="${http.protocol} 200"
responseMatch="LINE1"
@@ -155,20 +169,20 @@
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"
+ <gtest 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"
+ <gtest description="IncludeMismatch1-3"
request="GET /test/servlet/dispatch.IncludeMismatch1 HTTP/1.0"
returnCode="${http.protocol} 200"
responseMatch="LINE1"
/>
- <gtest host="${host}" port="${port}" description="IncludeFile"
+ <gtest description="IncludeFile"
request="GET /test/servlet/dispatch.IncludeFileServlet HTTP/1.0"
returnCode="${http.protocol} 200"
expectHeaders="Content-Type:text/foobar"
@@ -176,7 +190,7 @@
/>
<!-- Parameter order may change
- <gtest host="${host}" port="${port}" description="ForwardWithQuery"
+ <gtest description="ForwardWithQuery"
request="GET
/test/servlet/dispatch.ForwardWithQueryServlet?name=Sun%20Microsystems&age=100000&city=Cupertino
HTTP/1.0"
returnCode="${http.protocol} 200"
expectHeaders="Content-Type:text/funky"
@@ -188,335 +202,335 @@
</target>
- <target name="dispatch-tomcat" depends="dispatch">
- <gtest host="${host}" port="${port}" description="SimpleRedirect"
+ <target name="dispatch-tomcat" depends="init,dispatch">
+ <gtest description="SimpleRedirect"
request="GET /test/servlet/dispatch.SimpleRedirectServlet?/index.html
HTTP/1.0"
expectHeaders="Location:http://${host}:${port}/index.html"
returnCode="${http.protocol} 302"
/>
- <gtest host="${host}" port="${port}" description="SimpleRedirect2"
+ <gtest description="SimpleRedirect2"
request="GET /test/servlet/dispatch.SimpleRedirectServlet?index.html
HTTP/1.0"
expectHeaders="Location:http://${host}:${port}/test/servlet/index.html"
returnCode="${http.protocol} 302"
/>
</target>
- <target name="dispatch-apache" depends="dispatch">
- <gtest host="${host}" port="${port}" description="SimpleRedirect"
+ <target name="dispatch-apache" depends="init,dispatch">
+ <gtest description="SimpleRedirect"
request="GET /test/servlet/dispatch.SimpleRedirectServlet?/index.html
HTTP/1.0"
returnCode="${http.protocol} 302"
/>
- <gtest host="${host}" port="${port}" description="SimpleRedirect2"
+ <gtest description="SimpleRedirect2"
request="GET /test/servlet/dispatch.SimpleRedirectServlet?index.html
HTTP/1.0"
returnCode="${http.protocol} 302"
/>
</target>
<!-- ==================== Jsp tests ==================== -->
- <target name="jsp">
- <gtest host="${host}" port="${port}" request="GET /test/jsp/HelloWorld.jsp
HTTP/1.0"
+ <target name="jsp" depends="init">
+ <gtest request="GET /test/jsp/HelloWorld.jsp HTTP/1.0"
goldenFile="${gdir}/HelloWorld.txt"
/>
- <gtest host="${host}" port="${port}" request="GET /test/doesNotExist.jsp
HTTP/1.0"
+ <gtest request="GET /test/doesNotExist.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
magnitude="false" />
- <gtest host="${host}" port="${port}" request="GET /test/jsp HTTP/1.0"
+ <gtest request="GET /test/jsp HTTP/1.0"
returnCode="${http.protocol} 200"
description="Getting -- HTTP/1.0 302 Found"
magnitude="false" />
- <gtest host="${host}" port="${port}" request="GET /test/.jsp HTTP/1.0"
+ <gtest request="GET /test/.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
magnitude="false" />
- <gtest host="${host}" port="${port}" request="GET
/test/jsp/HelloWorld.jsp?????? HTTP/1.0"
+ <gtest request="GET /test/jsp/HelloWorld.jsp?????? HTTP/1.0"
goldenFile="${gdir}/HelloWorld.txt"
debug="0"
/>
- <gtest host="${host}" port="${port}" request="GET
/test/jsp/HelloWorld.jsp?a=b&c=d HTTP/1.0"
+ <gtest request="GET /test/jsp/HelloWorld.jsp?a=b&c=d HTTP/1.0"
goldenFile="${gdir}/HelloWorld.txt"
debug="0"
/>
- <gtest host="${host}" port="${port}" request="GET
/test/jsp/HelloWorld.jsp?&& HTTP/1.0"
+ <gtest request="GET /test/jsp/HelloWorld.jsp?&& HTTP/1.0"
goldenFile="${gdir}/HelloWorld.txt"
/>
- <gtest host="${host}" port="${port}" request="GET
/test/jsp/declaration/IntegerOverflow.jsp HTTP/1.0"
+ <gtest request="GET /test/jsp/declaration/IntegerOverflow.jsp HTTP/1.0"
returnCode="${http.protocol} 500"
debug="0"
/>
- <gtest host="${host}" port="${port}" request="GET /test/jsp/error/err.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/error/err.jsp HTTP/1.0"
goldenFile="${gdir}/Err.txt"
returnCode="${http.protocol} 200"
/>
- <gtest host="${host}" port="${port}" request="GET
/test/jsp/forward/forward.jsp HTTP/1.0"
+ <gtest request="GET /test/jsp/forward/forward.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
/>
- <gtest host="${host}" port="${port}" request="GET
/test/jsp/jsptoserv/jsptoservlet.jsp HTTP/1.0"
+ <gtest request="GET /test/jsp/jsptoserv/jsptoservlet.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
goldenFile="${gdir}/jsptoservlet.txt"
/>
- <gtest host="${host}" port="${port}" request="GET /test/jsp/initDestroy.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/initDestroy.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
/>
- <gtest host="${host}" port="${port}" request="GET /test/jsp/classTest.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/classTest.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
goldenFile="${gdir}/classTest.txt"
/>
- <gtest host="${host}" port="${port}" request="GET /test/jsp/import.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/import.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
goldenFile="${gdir}/import.txt"
/>
- <gtest host="${host}" port="${port}" request="GET /test/jsp/buffer.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/buffer.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
goldenFile="${gdir}/buffer.txt"
/>
- <gtest host="${host}" port="${port}" request="GET /test/jsp/buffer1.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/buffer1.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
magnitude="false" />
- <gtest host="${host}" port="${port}" request="GET /test/jsp/buffer2.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/buffer2.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
magnitude="false" />
- <gtest host="${host}" port="${port}" request="GET /test/jsp/buffer3.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/buffer3.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
magnitude="false" />
- <gtest host="${host}" port="${port}" request="GET /test/jsp/buffer4.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/buffer4.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
magnitude="false" />
- <gtest host="${host}" port="${port}" request="GET /test/jsp/comments.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/comments.jsp HTTP/1.0"
returnCode="${http.protocol} 500"
/>
- <gtest host="${host}" port="${port}" request="GET /test/jsp/parse.jsp HTTP/1.0"
+ <gtest request="GET /test/jsp/parse.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
goldenFile="${gdir}/parse.txt"
/>
- <gtest host="${host}" port="${port}" request="GET /test/jsp/pageInfo.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/pageInfo.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
magnitude="false" />
- <gtest host="${host}" port="${port}" request="GET /test/jsp/pageLanguage.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/pageLanguage.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
magnitude="false" />
- <gtest host="${host}" port="${port}" request="GET
/test/jsp/pageIsThreadSafe.jsp HTTP/1.0"
+ <gtest request="GET /test/jsp/pageIsThreadSafe.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
magnitude="false" />
- <gtest host="${host}" port="${port}" request="GET /test/jsp/pageSession.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/pageSession.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
magnitude="false" />
- <gtest host="${host}" port="${port}" request="GET /test/jsp/pageAutoFlush.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/pageAutoFlush.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
magnitude="false" />
- <gtest host="${host}" port="${port}" request="GET /test/jsp/pageError.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/pageError.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
/>
- <gtest host="${host}" port="${port}" request="GET /test/jsp/pageExtends.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/pageExtends.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
magnitude="false" />
- <gtest host="${host}" port="${port}" request="GET
/test/jsp/pageIsErrorPage.jsp HTTP/1.0"
+ <gtest request="GET /test/jsp/pageIsErrorPage.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
magnitude="false" />
- <gtest host="${host}" port="${port}" request="GET
/test/jsp/pageContentType.jsp HTTP/1.0"
+ <gtest request="GET /test/jsp/pageContentType.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
/>
- <gtest host="${host}" port="${port}" request="GET /test/jsp/pageImport2.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/pageImport2.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
magnitude="false" />
- <gtest host="${host}" port="${port}" request="GET /test/jsp/pageImport.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/pageImport.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
goldenFile="${gdir}/pageImport.txt"
/>
- <gtest host="${host}" port="${port}" request="GET /test/jsp/beanTest1.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/beanTest1.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
goldenFile="${gdir}/beanTest.txt"
/>
- <gtest host="${host}" port="${port}" request="GET /test/jsp/beanTest2.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/beanTest2.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
magnitude="false" />
- <gtest host="${host}" port="${port}" request="GET /test/jsp/beanScopePage.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/beanScopePage.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
/>
- <gtest host="${host}" port="${port}" request="GET
/test/jsp/beanScopeSession.jsp HTTP/1.0"
+ <gtest request="GET /test/jsp/beanScopeSession.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
debug="0"
/>
- <gtest host="${host}" port="${port}" request="GET /test/jsp/implicitOut.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/implicitOut.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
goldenFile="${gdir}/implicitOut.txt"
/>
- <gtest host="${host}" port="${port}" request="GET /test/jsp/implicitConfig.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/implicitConfig.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
goldenFile="${gdir}/implicitConfig.txt"
/>
- <gtest host="${host}" port="${port}" request="GET
/test/jsp/implicitException.jsp HTTP/1.0"
+ <gtest request="GET /test/jsp/implicitException.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
goldenFile="${gdir}/implicitException.txt"
/>
- <gtest host="${host}" port="${port}" request="GET
/test/jsp/implicitPageContext.jsp HTTP/1.0"
+ <gtest request="GET /test/jsp/implicitPageContext.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
goldenFile="${gdir}/implicitPageContext.txt"
/>
- <gtest host="${host}" port="${port}" request="GET
/test/jsp/implicitContext.jsp HTTP/1.0"
+ <gtest request="GET /test/jsp/implicitContext.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
goldenFile="${gdir}/implicitContext.txt"
/>
- <gtest host="${host}" port="${port}" request="GET
/test/jsp/implicitRequest.jsp HTTP/1.0"
+ <gtest request="GET /test/jsp/implicitRequest.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
goldenFile="${gdir}/implicitRequest.txt"
/>
- <gtest host="${host}" port="${port}" request="GET
/test/jsp/implicitResponse.jsp HTTP/1.0"
+ <gtest request="GET /test/jsp/implicitResponse.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
goldenFile="${gdir}/implicitResponse.txt"
/>
- <gtest host="${host}" port="${port}" request="GET
/test/jsp/implicitSession.jsp HTTP/1.0"
+ <gtest request="GET /test/jsp/implicitSession.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
goldenFile="${gdir}/implicitSession.txt"
/>
- <gtest host="${host}" port="${port}" request="GET
/test/jsp/implicitPageContext.jsp HTTP/1.0"
+ <gtest request="GET /test/jsp/implicitPageContext.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
goldenFile="${gdir}/implicitPageContext.txt"
/>
- <gtest host="${host}" port="${port}" request="GET /test/jsp/pageInvalid.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/pageInvalid.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
magnitude="false" />
- <gtest host="${host}" port="${port}" request="GET /test/jsp/pageDouble.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/pageDouble.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
magnitude="false" />
- <gtest host="${host}" port="${port}" request="GET /test/jsp/pageContent3.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/pageContent3.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
/>
- <gtest host="${host}" port="${port}" request="GET /test/servlet/servletParam1
HTTP/1.0"
+ <gtest request="GET /test/servlet/servletParam1 HTTP/1.0"
returnCode="${http.protocol} 200"
goldenFile="${gdir}/servletParam1.txt"
/>
- <gtest host="${host}" port="${port}" request="GET /test/servlet/servletParam2
HTTP/1.0"
+ <gtest request="GET /test/servlet/servletParam2 HTTP/1.0"
returnCode="${http.protocol} 200"
goldenFile="${gdir}/servletParam2.txt"
/>
- <gtest host="${host}" port="${port}" request="GET /test/servlet/ServletParam
HTTP/1.0"
+ <gtest request="GET /test/servlet/ServletParam HTTP/1.0"
returnCode="${http.protocol} 200"
goldenFile="${gdir}/ServletParam.txt"
/>
- <gtest host="${host}" port="${port}" request="GET /test/jsp/bigDeclaration.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/bigDeclaration.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
/>
- <gtest host="${host}" port="${port}" request="GET
/test/jsp/include/include.jsp HTTP/1.0"
+ <gtest request="GET /test/jsp/include/include.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
goldenFile="${gdir}/Include.txt"
/>
- <gtest host="${host}" port="${port}" request="GET /test/jsp/chinese.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/chinese.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
/>
- <gtest host="${host}" port="${port}" request="GET /test/jsp/japanese.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/japanese.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
/>
- <gtest host="${host}" port="${port}" request="GET /test/jsp/extends1.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/extends1.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
magnitude="false"
/>
- <gtest host="${host}" port="${port}" request="GET /test/jsp/extends2.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/extends2.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
magnitude="false"
/>
- <gtest host="${host}" port="${port}" request="GET /test/jsp/extends3.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/extends3.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
/>
- <gtest host="${host}" port="${port}" request="GET /test/jsp/extends4.jsp
HTTP/1.0"
+ <gtest request="GET /test/jsp/extends4.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
/>
</target>
- <target name="jsp-tomcat" depends="jsp">
- <gtest host="${host}" port="${port}" request="GET /test/jsp/ HTTP/1.0"
+ <target name="jsp-tomcat" depends="init,jsp">
+ <gtest request="GET /test/jsp/ HTTP/1.0"
goldenFile="${gdir}/movedindex.txt"
description="Redirects to index.html"
/>
</target>
- <target name="jsp-apache" depends="jsp">
- <gtest host="${host}" port="${port}" request="GET /test/jsp/ HTTP/1.0"
+ <target name="jsp-apache" depends="init,jsp">
+ <gtest request="GET /test/jsp/ HTTP/1.0"
goldenFile="${gdir}/index.txt"
description="Serves index.html"
/>
</target>
- <target name="wrong_request">
- <gtest host="${host}" port="${port}" request="GET /test/*.jsp HTTP/1.0"
+ <target name="wrong_request" depends="init">
+ <gtest request="GET /test/*.jsp HTTP/1.0"
returnCode="${http.protocol} 200"
magnitude="false" />
- <gtest host="${host}" port="${port}" request="GET *jsp HTTP/1.0"
+ <gtest request="GET *jsp HTTP/1.0"
returnCode="${http.protocol} 200"
magnitude="false" />
<!-- Hangs on apache - apache expects a 1.0 request
- gtest host="${host}" port="${port}" request="GET /test/jsp/HelloWorld.jsp
HTTP"
+ gtest request="GET /test/jsp/HelloWorld.jsp HTTP"
returnCode="${http.protocol} 400"
/-->
<!-- Hangs on apache - apache expects a 1.0 request
- gtest host="${host}" port="${port}" request="GET /test/jsp/HelloWorld.jsp
1.0"
+ gtest request="GET /test/jsp/HelloWorld.jsp 1.0"
returnCode="${http.protocol} 400"
/ -->
<!-- Hangs on apache - apache expects a 1.0 request
- gtest host="${host}" port="${port}" request="GET /test/jsp/HelloWorld.jsp
/1.0"
+ gtest request="GET /test/jsp/HelloWorld.jsp /1.0"
returnCode="${http.protocol} 400"
/ -->
@@ -524,158 +538,158 @@
- <target name="get">
+ <target name="get" depends="init">
<!-- hit unavailable servlet 1st time -->
- <gtest host="${host}" port="${port}" request="GET /test/servlet/Unavailable
HTTP/1.0"
+ <gtest request="GET /test/servlet/Unavailable HTTP/1.0"
returnCode="${http.protocol} 503"
/>
- <gtest host="${host}" port="${port}" request="GET /test/servlet/Cookie25
HTTP/1.0"
+ <gtest request="GET /test/servlet/Cookie25 HTTP/1.0"
expectHeaders="Set-Cookie:foo=bar; Version=1; Max-Age=8640000"
/>
- <gtest host="${host}" port="${port}" request="GET
/test/servlet/ResponseError HTTP/1.0"
+ <gtest request="GET /test/servlet/ResponseError HTTP/1.0"
returnCode="${http.protocol} 400"
responseMatch="Wrong data"
/>
- <gtest host="${host}" port="${port}" request="GET
/test/request/uri/does/not/exist"
+ <gtest request="GET /test/request/uri/does/not/exist"
returnCode="404"
/>
- <gtest host="${host}" port="${port}" request="GET
/test/request/uri/does/not/exist HTTP/1.0"
+ <gtest request="GET /test/request/uri/does/not/exist HTTP/1.0"
returnCode="${http.protocol} 404"
/>
- <gtest host="${host}" port="${port}" request="GET /test/"
+ <gtest request="GET /test/"
returnCode="Error: "
magnitude="false" />
<!-- Hangs apache - it starts with " ", apache expects a 1.0 request
- gtest host="${host}" port="${port}" request=" GET / "
+ gtest request=" GET / "
returnCode="Error: "
magnitude="false" / -->
<!-- tolerate bad request for now
- <gtest host="${host}" port="${port}" request=" GET / HTTP/1.0"
+ <gtest request=" GET / HTTP/1.0"
returnCode="${http.protocol} 200"
/>
-->
<!-- tolerate bad request for now
- <gtest host="${host}" port="${port}" request="GET /test/index.ht ml HTTP/1.0"
+ <gtest request="GET /test/index.ht ml HTTP/1.0"
returnCode="${http.protocol} 400"
/>
-->
<!-- tolerate bad request for now
- <gtest host="${host}" port="${port}" request=" GET /index.ht ml HTTP/1.0
"
+ <gtest request=" GET /index.ht ml HTTP/1.0 "
returnCode="${http.protocol} 400"
/>
-->
- <gtest host="${host}" port="${port}" request="GET /test/servlet HTTP/1.0"
+ <gtest request="GET /test/servlet HTTP/1.0"
returnCode="${http.protocol} 404"
/>
- <gtest host="${host}" port="${port}" request="GET /test/servlet/ HTTP/1.0"
+ <gtest request="GET /test/servlet/ HTTP/1.0"
returnCode="${http.protocol} 404"
/>
- <gtest host="${host}" port="${port}" request="GET /test/servlet/foo HTTP/1.0"
+ <gtest request="GET /test/servlet/foo HTTP/1.0"
returnCode="${http.protocol} 404"
/>
</target>
- <target name="get-tomcat" depends="get">
- <gtest host="${host}" port="${port}" request="GET /test/ HTTP/1.0"
+ <target name="get-tomcat" depends="init,get" >
+ <gtest request="GET /test/ HTTP/1.0"
returnCode="${http.protocol} 302"
/>
- <gtest host="${host}" port="${port}" request="GET /test/welcome HTTP/1.0"
+ <gtest request="GET /test/welcome HTTP/1.0"
returnCode="${http.protocol} 302"
/>
</target>
- <target name="get-apache" depends="get">
- <gtest host="${host}" port="${port}" request="GET /test/ HTTP/1.0"
+ <target name="get-apache" depends="init,get">
+ <gtest request="GET /test/ HTTP/1.0"
returnCode="${http.protocol} 200"
/>
- <gtest host="${host}" port="${port}" request="GET /test/welcome HTTP/1.0"
+ <gtest request="GET /test/welcome HTTP/1.0"
returnCode="${http.protocol} 301"
/>
</target>
- <target name="requestMap">
- <gtest host="${host}" port="${port}" description="/foo/bar/index.html : 1.0
: 200"
+ <target name="requestMap" depends="init" >
+ <gtest description="/foo/bar/index.html : 1.0 : 200"
request="GET /test/foo/bar/index.html HTTP/1.0"
responseMatch="Servlet: Servlet1"
/>
- <gtest host="${host}" port="${port}" description="/foo/bar/index.bop : 1.0 :
200"
+ <gtest description="/foo/bar/index.bop : 1.0 : 200"
request="GET /test/foo/bar/index.bop HTTP/1.0"
responseMatch="Servlet: Servlet1"
/>
- <gtest host="${host}" port="${port}" description="/baz : 1.0 : 200"
+ <gtest description="/baz : 1.0 : 200"
request="GET /test/baz HTTP/1.0"
responseMatch="Servlet: Servlet2"
/>
- <gtest host="${host}" port="${port}" description="/baz/index.html : 1.0 :
200"
+ <gtest description="/baz/index.html : 1.0 : 200"
request="GET /test/baz/index.html HTTP/1.0"
responseMatch="Servlet: Servlet2"
/>
- <gtest host="${host}" port="${port}" description="/catalog : 1.0 : 200"
+ <gtest description="/catalog : 1.0 : 200"
request="GET /test/catalog HTTP/1.0"
responseMatch="Servlet: Servlet3"
/>
- <gtest host="${host}" port="${port}" description="/catalog/index.html : 1.0
: 200"
+ <gtest description="/catalog/index.html : 1.0 : 200"
request="GET /test/catalog/index.html HTTP/1.0"
returnCode="${http.protocol} 404"
/>
- <gtest host="${host}" port="${port}" description="/catalog/racecar.bop : 1.0
: 200"
+ <gtest description="/catalog/racecar.bop : 1.0 : 200"
request="GET /test/catalog/racecar.bop HTTP/1.0"
responseMatch="Servlet: Servlet4"
/>
- <gtest host="${host}" port="${port}" description="/index.bop : 1.0 : 200"
+ <gtest description="/index.bop : 1.0 : 200"
request="GET /test/index.bop HTTP/1.0"
responseMatch="Servlet: Servlet4"
/>
</target>
- <target name="post1">
- <gtest host="${host}" port="${port}" description="Content Type Test"
+ <target name="post1" depends="init" >
+ <gtest description="Content Type Test"
request="POST /test/servlet/Post HTTP/1.0"
debug="10"
content="Test POST BODY" />
</target>
- <target name="post">
- <gtest host="${host}" port="${port}" request="POST
/test/servlet/request.NotThere HTTP/1.0"
+ <target name="post" depends="init" >
+ <gtest request="POST /test/servlet/request.NotThere HTTP/1.0"
content="name=lightness of being"
returnCode="${http.protocol} 404"
/>
- <gtest host="${host}" port="${port}" request="POST
/test/servlet/request.EchoServlet HTTP/1.0"
+ <gtest request="POST /test/servlet/request.EchoServlet HTTP/1.0"
content="name=lightness of being"
returnCode="${http.protocol} 200"
/>
- <gtest host="${host}" port="${port}" request="GHOST
/test/servlet/request.EchoServlet HTTP/1.0"
+ <gtest request="GHOST /test/servlet/request.EchoServlet HTTP/1.0"
content="name=lightness of being"
returnCode="${http.protocol} 501"
/>
<!-- Hangs on apache, apache expects a 1.0 requets
- gtest host="${host}" port="${port}" request="POST
/test/servlet/request.EchoServlet HT TP/1.0"
+ gtest request="POST /test/servlet/request.EchoServlet HT TP/1.0"
content="name=lightness of being"
returnCode="Error: 400"
/-->
@@ -683,175 +697,175 @@
<!-- tomcat will wait a request - it's the same as if the client will do a
post and stop
transmiting.
XXX XXX Tomcat needs timeout
- <gtest host="${host}" port="${port}" request="POST "
+ <gtest request="POST "
content="name=lightness of being"
returnCode="Error: 400"
/>
-->
- <gtest host="${host}" port="${port}" request="POST
/test/servlet/request.EchoServlet HTTP/1.0"
+ <gtest request="POST /test/servlet/request.EchoServlet HTTP/1.0"
content=""
returnCode="${http.protocol} 200"
/>
- <gtest host="${host}" port="${port}" request="POST /test/servlet HTTP/1.0"
+ <gtest request="POST /test/servlet HTTP/1.0"
content=""
returnCode="${http.protocol} 404"
/>
- <gtest host="${host}" port="${port}" request="POST /test/servlet/ HTTP/1.0"
+ <gtest request="POST /test/servlet/ HTTP/1.0"
content=""
returnCode="${http.protocol} 404"
/>
- <gtest host="${host}" port="${port}" request="POST /test/"
+ <gtest request="POST /test/"
content=""
returnCode="${http.protocol} 400"
/>
- <gtest host="${host}" port="${port}" request="POST
/test/servlet/request.EchoServlet"
+ <gtest request="POST /test/servlet/request.EchoServlet"
content="name=lightness of being"
returnCode="${http.protocol} 200"
/>
- <gtest host="${host}" port="${port}" request="POST
/test/servlet/request.EchoServlet"
+ <gtest request="POST /test/servlet/request.EchoServlet"
content="name=lightness of being,,,,,,,....###///&&@@@@@***"
returnCode="${http.protocol} 200"
/>
- <gtest host="${host}" port="${port}" request="POST
/test/servlet/request.EchoServlet"
+ <gtest request="POST /test/servlet/request.EchoServlet"
content="name=lightness of
being,,,,,,,....###///&&&&@@@@@***"
returnCode="${http.protocol} 200"
/>
- <gtest host="${host}" port="${port}" request="POST
\/test/servlet/request.EchoServlet?name=sun&age=2000"
+ <gtest request="POST
\/test/servlet/request.EchoServlet?name=sun&age=2000"
content="name=lightness of being,,,,,,,....###///&@@@@@***"
returnCode="${http.protocol} 200"
/>
- <gtest host="${host}" port="${port}" request="POST \"
+ <gtest request="POST \"
content="name=lightness of being"
returnCode="Error: 400"
/>
- <gtest host="${host}" port="${port}" request="POST
/test/servlet/request.EchoServlet HTTP/1.0"
+ <gtest request="POST /test/servlet/request.EchoServlet HTTP/1.0"
content="name=lightness of being"
returnCode="${http.protocol} 200"
/>
- <gtest host="${host}" port="${port}" request="post
/test/servlet/request.EchoServlet HTTP/1.0"
+ <gtest request="post /test/servlet/request.EchoServlet HTTP/1.0"
content="name=lightness of being"
returnCode="${http.protocol} 501"
/>
<!-- tolerate bad request for now
- <gtest host="${host}" port="${port}" request="GET
http://www.javasoft.com/index.html HTTP/1.0 "
+ <gtest request="GET http://www.javasoft.com/index.html HTTP/1.0 "
returnCode="${http.protocol} 400"
/>
-->
- <gtest host="${host}" port="${port}" request="POST
/test/servlet/request.EchoServlet HTTP/1.0"
+ <gtest request="POST /test/servlet/request.EchoServlet HTTP/1.0"
headers="Content-Encoding: x-gzip"
content="name=lightness of being"
returnCode="${http.protocol} 200"
/>
<!-- Can't be OK - we don't implement HTTP/4.4
- gtest host="${host}" port="${port}" request="POST
/test/servlet/request.EchoServlet HTTP/4.4"
+ gtest request="POST /test/servlet/request.EchoServlet HTTP/4.4"
content="name=lightness of being"
returnCode="${http.protocol} 200"
/ -->
</target>
<!-- ============= unavailable servlet tests ============= -->
- <target name="unavailable">
- <gtest host="${host}" port="${port}" request="GET
/test/servlet/PermanentlyUnavailable HTTP/1.0"
+ <target name="unavailable" depends="init" >
+ <gtest request="GET /test/servlet/PermanentlyUnavailable HTTP/1.0"
returnCode="${http.protocol} 503"
/>
<!-- again for good measure -->
- <gtest host="${host}" port="${port}" request="GET
/test/servlet/PermanentlyUnavailable HTTP/1.0"
+ <gtest request="GET /test/servlet/PermanentlyUnavailable HTTP/1.0"
returnCode="${http.protocol} 503"
/>
<!-- this one was loaded on startup - Can't find it ( costin )
- <gtest host="${host}" port="${port}" request="GET
/test/servlet/PermanentlyUnavailable2 HTTP/1.0"
+ <gtest 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"
+ <gtest request="GET /test/servlet/Unavailable HTTP/1.0"
returnCode="${http.protocol} 200"
responseMatch="Hello"
/>
</target>
<!-- ============= restricted access tests ============= -->
- <target name="restricted">
- <gtest host="${host}" port="${port}" request="GET /test/WEB-INF HTTP/1.0"
+ <target name="restricted" depends="init" >
+ <gtest request="GET /test/WEB-INF HTTP/1.0"
returnCode="${http.protocol} 4" />
- <gtest host="${host}" port="${port}" request="GET /test/WEB-INF/ HTTP/1.0"
+ <gtest request="GET /test/WEB-INF/ HTTP/1.0"
returnCode="${http.protocol} 4" />
- <gtest host="${host}" port="${port}" request="GET /test/../test/WEB-INF
HTTP/1.0"
+ <gtest request="GET /test/../test/WEB-INF HTTP/1.0"
returnCode="${http.protocol} 4" />
- <gtest host="${host}" port="${port}" request="GET /test/../test/WEB-INF/
HTTP/1.0"
+ <gtest request="GET /test/../test/WEB-INF/ HTTP/1.0"
returnCode="${http.protocol} 4" />
- <gtest host="${host}" port="${port}" request="GET /test/WEB-INF/classes
HTTP/1.0"
+ <gtest request="GET /test/WEB-INF/classes HTTP/1.0"
returnCode="${http.protocol} 4" />
<!-- For Windows systems, insure blocking is not case sensitive! -->
- <gtest host="${host}" port="${port}" request="GET /test/web-inf HTTP/1.0"
+ <gtest request="GET /test/web-inf HTTP/1.0"
returnCode="${http.protocol} 4" />
- <gtest host="${host}" port="${port}" request="GET /test/web-inf/ HTTP/1.0"
+ <gtest request="GET /test/web-inf/ HTTP/1.0"
returnCode="${http.protocol} 4" />
- <gtest host="${host}" port="${port}" request="GET /test/../test/web-inf
HTTP/1.0"
+ <gtest request="GET /test/../test/web-inf HTTP/1.0"
returnCode="${http.protocol} 4" />
- <gtest host="${host}" port="${port}" request="GET /test/../test/web-inf/
HTTP/1.0"
+ <gtest request="GET /test/../test/web-inf/ HTTP/1.0"
returnCode="${http.protocol} 4" />
- <gtest host="${host}" port="${port}" request="GET /test/WEB-INF/web.xml
HTTP/1.0"
+ <gtest request="GET /test/WEB-INF/web.xml HTTP/1.0"
returnCode="${http.protocol} 4" />
- <gtest host="${host}" port="${port}" request="GET
/test/../test/WEB-INF/web.xml HTTP/1.0"
+ <gtest request="GET /test/../test/WEB-INF/web.xml HTTP/1.0"
returnCode="${http.protocol} 4" />
- <gtest host="${host}" port="${port}" request="GET /test/WEB-INF/web.Xml
HTTP/1.0"
+ <gtest request="GET /test/WEB-INF/web.Xml HTTP/1.0"
returnCode="${http.protocol} 4" />
- <gtest host="${host}" port="${port}" request="GET /test/web-inf/web.xml
HTTP/1.0"
+ <gtest request="GET /test/web-inf/web.xml HTTP/1.0"
returnCode="${http.protocol} 4" />
- <gtest host="${host}" port="${port}" request="GET /test/META-INF HTTP/1.0"
+ <gtest request="GET /test/META-INF HTTP/1.0"
returnCode="${http.protocol} 4" />
- <gtest host="${host}" port="${port}" request="GET /test/META-INF/ HTTP/1.0"
+ <gtest request="GET /test/META-INF/ HTTP/1.0"
returnCode="${http.protocol} 4" />
- <gtest host="${host}" port="${port}" request="GET /test/../test/META-INF
HTTP/1.0"
+ <gtest request="GET /test/../test/META-INF HTTP/1.0"
returnCode="${http.protocol} 4" />
- <gtest host="${host}" port="${port}" request="GET /test/../test/META-INF/
HTTP/1.0"
+ <gtest request="GET /test/../test/META-INF/ HTTP/1.0"
returnCode="${http.protocol} 4" />
- <gtest host="${host}" port="${port}" request="GET /test/meta-inf HTTP/1.0"
+ <gtest request="GET /test/meta-inf HTTP/1.0"
returnCode="${http.protocol} 4" />
- <gtest host="${host}" port="${port}" request="GET /test/META-INF/Manifest.mf
HTTP/1.0"
+ <gtest request="GET /test/META-INF/Manifest.mf HTTP/1.0"
returnCode="${http.protocol} 4" />
- <gtest host="${host}" port="${port}" request="GET
/test/../test/META-INF/Manifest.mf HTTP/1.0"
+ <gtest request="GET /test/../test/META-INF/Manifest.mf HTTP/1.0"
returnCode="${http.protocol} 4" />
- <gtest host="${host}" port="${port}" request="GET /test/META-INF/Manifest.Mf
HTTP/1.0"
+ <gtest request="GET /test/META-INF/Manifest.Mf HTTP/1.0"
returnCode="${http.protocol} 4" />
- <gtest host="${host}" port="${port}" request="GET /test/meta-inf/Manifest.mf
HTTP/1.0"
+ <gtest request="GET /test/meta-inf/Manifest.mf HTTP/1.0"
returnCode="${http.protocol} 4" />
</target>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]