tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/tests/webpages/WEB-INF test-tomcat.xml
Date Fri, 29 Dec 2000 00:33:15 GMT
costin      00/12/28 16:33:15

  Modified:    src/etc  server.xml
               src/share/org/apache/tomcat/request SimpleRealm.java
  Added:       src/etc/users admin-users.xml example-users.xml
                        global-users.xml tomcat-users.xml
               src/tests/webpages/WEB-INF test-tomcat.xml
  Removed:     src/etc  admin-users.xml example-users.xml global-users.xml
                        tomcat-users.xml
               src/etc/ant test-tomcat.xml
  Log:
  More cleanup.
  
  The sanity-test application is now separated ( no more polution on the
  tomcat distribution ). I'll update the ant file to run it in the new
  structure.
  
  Simple-user realms are grouped under conf/users ( they are not intended for
  production mode anyway - use JdbcRealm or JAAS ).
  
  Revision  Changes    Path
  1.57      +3 -3      jakarta-tomcat/src/etc/server.xml
  
  Index: server.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/etc/server.xml,v
  retrieving revision 1.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- server.xml	2000/12/27 19:52:50	1.56
  +++ server.xml	2000/12/29 00:33:13	1.57
  @@ -199,7 +199,7 @@
             -->
           <RequestInterceptor 
               className="org.apache.tomcat.request.SimpleRealm" 
  -            filename="conf/global-users.xml"
  +            filename="conf/users/global-users.xml"
               debug="0" />
   
          <!-- UnComment the following and comment out the
  @@ -306,7 +306,7 @@
   	    reloadable="true" > 
              <RequestInterceptor 
                 className="org.apache.tomcat.request.SimpleRealm" 
  -              filename="conf/example-users.xml"
  +              filename="conf/users/example-users.xml"
                 debug="0" />
               <Logger name="example_tc_log" 
                 path="logs/examples.log"
  @@ -333,7 +333,7 @@
                    trusted="false" > 
           <RequestInterceptor 
               className="org.apache.tomcat.request.SimpleRealm" 
  -            filename="conf/admin-users.xml"
  +            filename="conf/users/admin-users.xml"
               debug="0" />
           </Context>
   
  
  
  
  1.1                  jakarta-tomcat/src/etc/users/admin-users.xml
  
  Index: admin-users.xml
  ===================================================================
  <tomcat-users>
    <user name="admin" password="changethis" roles="tomcat_admin,tomcat,role1" />
  </tomcat-users>
  
  
  
  1.1                  jakarta-tomcat/src/etc/users/example-users.xml
  
  Index: example-users.xml
  ===================================================================
  <tomcat-users>
    <user name="tomcat" password="tomcat" roles="tomcat" />
    <user name="role1"  password="tomcat" roles="role1"  />
    <user name="both"   password="tomcat" roles="tomcat,role1" />
  </tomcat-users>
  
  
  
  1.1                  jakarta-tomcat/src/etc/users/global-users.xml
  
  Index: global-users.xml
  ===================================================================
  <tomcat-users>
    <user name="root" password="changethis" roles="tomcat,role1,tomcat_admin,tomcat_root"
/>
  </tomcat-users>
  
  
  
  1.1                  jakarta-tomcat/src/etc/users/tomcat-users.xml
  
  Index: tomcat-users.xml
  ===================================================================
  <tomcat-users>
    <user name="tomcat" password="tomcat" roles="tomcat" />
    <user name="role1"  password="tomcat" roles="role1"  />
    <user name="both"   password="tomcat" roles="tomcat,role1" />
  </tomcat-users>
  
  
  
  1.19      +3 -3      jakarta-tomcat/src/share/org/apache/tomcat/request/SimpleRealm.java
  
  Index: SimpleRealm.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/request/SimpleRealm.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- SimpleRealm.java	2000/12/28 01:57:41	1.18
  +++ SimpleRealm.java	2000/12/29 00:33:15	1.19
  @@ -76,7 +76,7 @@
    *  an xml file. The file is fully read in memory when the context is
    *  initialized.
    *
  - *  The default file is TOMCAT_HOME/conf/tomcat-users.xml. You can
  + *  The default file is TOMCAT_HOME/conf/users/tomcat-users.xml. You can
    *  change it, and you can also set this module as a per context
    *  interceptor, so that each module have it's own realm.
    *
  @@ -93,7 +93,7 @@
       int userNote=-1;
       int passwordNote=-1;
   
  -    String filename="/conf/tomcat-users.xml";
  +    String filename="/conf/users/tomcat-users.xml";
   
       
       public SimpleRealm() {
  @@ -241,7 +241,7 @@
               if (filename != null)
                   f=new File( home + File.separator + filename );
               else
  -                f=new File( home + "/conf/tomcat-users.xml");
  +                f=new File( home + "/conf/users/tomcat-users.xml");
   
               if( ! f.exists() ) {
                   log( "File not found  " + f );
  
  
  
  1.1                  jakarta-tomcat/src/tests/webpages/WEB-INF/test-tomcat.xml
  
  Index: test-tomcat.xml
  ===================================================================
  <project name="TestRun" default="main">
     <!-- To test tomcat standalone, type:
            bin/tomcat.sh ant -f conf/test-tomcat.xml client
          or for Windows systems, type:
            bin\tomcat.bat ant -f conf/test-tomcat.xml client
          
          To test apache, type:
            bin/tomcat.sh ant -f conf/test-tomcat.xml -Dport=<your port> -Dhttp.protocol=HTTP/1.1
client-apache
          or for Windows systems, type:
            bin/tomcat.bat ant -f conf/test-tomcat.xml -Dport=<your port> -Dhttp.protocol=HTTP/1.1
client-apache
  	  Specify <your port> from "Port" setting in apache's httpd.conf file.
  
          Works best if you manually start tomcat, and if necessary apache.  If you use this
file's
          "main" or "apache" targets, tomcat may not start fast enough to avoid failing some
of the
          early tests.
      -->
    
       <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="http.protocol" value="HTTP/1.0" />
       
       <taskdef name="gtest" classname="org.apache.tomcat.task.GTest" />
  
    <!-- ==================== File tests ==================== -->
    <target name="file">
      <gtest host="${host}" port="${port}"  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"
             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"
             request="GET /test/welcome HTTP/1.0"
             expectHeaders="Location:/welcome/" 
             returnCode="${http.protocol} 302" />
  
      <gtest host="${host}" port="${port}"  description="Welcome File Test2"
             request="GET /test/binaries HTTP/1.0"
             returnCode="${http.protocol} 200" />
  
      <gtest host="${host}" port="${port}"  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"
             request="GET /test/welcome HTTP/1.0"
             expectHeaders="Location:/welcome/" 
             returnCode="${http.protocol} 301" />
  
      <gtest host="${host}" port="${port}"  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"
             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"
               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"
               request="GET /test/servlet/dispatch.SimpleForwardServlet HTTP/1.0"
               expectHeaders="Content-Type:text/funky" 
               returnCode="${http.protocol} 200"
               goldenFile="${gdir}/SimpleForward.txt" 
         />
        <gtest host="${host}" port="${port}"  description="PrintWriterTest"
               request="GET /test/servlet/dispatch.PrintWriterTest1Servlet HTTP/1.0"
               returnCode="${http.protocol} 200"
               responseMatch="PreInclude" 
         />
        <gtest host="${host}" port="${port}"  description="PrintWriterTest"
               request="GET /test/servlet/dispatch.PrintWriterTest1Servlet HTTP/1.0"
               returnCode="${http.protocol} 200"
               responseMatch="PostInclude" 
         />
        <gtest host="${host}" port="${port}"  description="PrintWriterTest"
               request="GET /test/servlet/dispatch.PrintWriterTest1Servlet HTTP/1.0"
               returnCode="${http.protocol} 200"
               responseMatch="Included servlet error: 500" 
         />
        <gtest host="${host}" port="${port}"  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"
               request="GET /test/servlet/dispatch.IncludeMismatch1 HTTP/1.0"
               returnCode="${http.protocol} 200"
               responseMatch="LINE1" 
         />
  
        <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"
               returnCode="${http.protocol} 200"
               responseMatch="LINE1" 
         />
  
        <gtest host="${host}" port="${port}"  description="IncludeFile"
               request="GET /test/servlet/dispatch.IncludeFileServlet HTTP/1.0"
               returnCode="${http.protocol} 200"
               expectHeaders="Content-Type:text/foobar" 
               goldenFile="${gdir}/IncludeFile.txt" 
         />
  
        <!-- Parameter order may change 
        <gtest host="${host}" port="${port}"  description="ForwardWithQuery"
               request="GET /test/servlet/dispatch.ForwardWithQueryServlet?name=Sun%20Microsystems&amp;age=100000&amp;city=Cupertino
HTTP/1.0"
               returnCode="${http.protocol} 200"
               expectHeaders="Content-Type:text/funky" 
               goldenFile="${gdir}/ForwardWithQuery.txt" 
         />    
         -->
  
      
  
      </target>
  
      <target name="dispatch-tomcat" depends="dispatch">
        <gtest host="${host}" port="${port}"  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"
               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"
               request="GET /test/servlet/dispatch.SimpleRedirectServlet?/index.html HTTP/1.0"
               returnCode="${http.protocol} 302" 
         />
        <gtest host="${host}" port="${port}"  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"
             goldenFile="${gdir}/HelloWorld.txt"
      />
  
      <gtest host="${host}" port="${port}"  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"
             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"
             returnCode="${http.protocol} 200"
             magnitude="false" />
  
      <gtest host="${host}" port="${port}"  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&amp;c=d
HTTP/1.0"
             goldenFile="${gdir}/HelloWorld.txt"
             debug="0"
      />
  
      <gtest host="${host}" port="${port}"  request="GET /test/jsp/HelloWorld.jsp?&amp;&amp;
HTTP/1.0"
             goldenFile="${gdir}/HelloWorld.txt"
      />
  
      <gtest host="${host}" port="${port}"  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"
             goldenFile="${gdir}/Err.txt"
             returnCode="${http.protocol} 200"
      />
  
      <gtest host="${host}" port="${port}"  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"
             returnCode="${http.protocol} 200"
             goldenFile="${gdir}/jsptoservlet.txt"
      />
  
      <gtest host="${host}" port="${port}"  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"
             returnCode="${http.protocol} 200"
             goldenFile="${gdir}/classTest.txt"
      />
  
      <gtest host="${host}" port="${port}"  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"
             returnCode="${http.protocol} 200"
             goldenFile="${gdir}/buffer.txt"
      />
  
      <gtest host="${host}" port="${port}"  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"
             returnCode="${http.protocol} 200"
             magnitude="false" />
  
      <gtest host="${host}" port="${port}"  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"
             returnCode="${http.protocol} 200"
             magnitude="false" />
  
      <gtest host="${host}" port="${port}"  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"
             returnCode="${http.protocol} 200"
             goldenFile="${gdir}/parse.txt"
      />
  
      <gtest host="${host}" port="${port}"  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"
             returnCode="${http.protocol} 200"
             magnitude="false" />
  
      <gtest host="${host}" port="${port}"  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"
             returnCode="${http.protocol} 200"
             magnitude="false" />
  
      <gtest host="${host}" port="${port}"  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"
             returnCode="${http.protocol} 200"
      />
  
      <gtest host="${host}" port="${port}"  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"
             returnCode="${http.protocol} 200"
             magnitude="false" />
  
      <gtest host="${host}" port="${port}"  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"
             returnCode="${http.protocol} 200"
             magnitude="false" />
  
      <gtest host="${host}" port="${port}"  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"
             returnCode="${http.protocol} 200"
             goldenFile="${gdir}/beanTest.txt"
      />
  
      <gtest host="${host}" port="${port}"  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"
             returnCode="${http.protocol} 200"
      />
  
      <gtest host="${host}" port="${port}"  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"
             returnCode="${http.protocol} 200"
             goldenFile="${gdir}/implicitOut.txt"
      />
  
      <gtest host="${host}" port="${port}"  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"
             returnCode="${http.protocol} 200"
             goldenFile="${gdir}/implicitException.txt"
      />
  
      <gtest host="${host}" port="${port}"  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"
             returnCode="${http.protocol} 200"
             goldenFile="${gdir}/implicitContext.txt"
      />
  
      <gtest host="${host}" port="${port}"  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"
             returnCode="${http.protocol} 200"
             goldenFile="${gdir}/implicitResponse.txt"
      />
  
      <gtest host="${host}" port="${port}"  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"
             returnCode="${http.protocol} 200"
             goldenFile="${gdir}/implicitPageContext.txt"
      />
  
      <gtest host="${host}" port="${port}"  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"
             returnCode="${http.protocol} 200"
             magnitude="false" />
  
      <gtest host="${host}" port="${port}"  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"
             returnCode="${http.protocol} 200"
             goldenFile="${gdir}/servletParam1.txt"
      />
  
      <gtest host="${host}" port="${port}"  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"
             returnCode="${http.protocol} 200"
             goldenFile="${gdir}/ServletParam.txt"
      />
  
      <gtest host="${host}" port="${port}"  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"
             returnCode="${http.protocol} 200"
             goldenFile="${gdir}/Include.txt"
      />
   
      <gtest host="${host}" port="${port}"  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"
             returnCode="${http.protocol} 200"
      />
  
     <gtest host="${host}" port="${port}"  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"
             returnCode="${http.protocol} 200"
             magnitude="false" 
      />
  
     <gtest host="${host}" port="${port}"  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"
             returnCode="${http.protocol} 200"
      />
  
     </target>
  
    <target name="jsp-tomcat" depends="jsp">
      <gtest host="${host}" port="${port}"  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"
             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"
             returnCode="${http.protocol} 200"
             magnitude="false" />
  
      <gtest host="${host}" port="${port}"  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"
             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"
             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"
             returnCode="${http.protocol} 400"
      / -->
  
    </target>
  
  
  
     <target name="get">
        <!-- hit unavailable servlet 1st time -->
        <gtest host="${host}" port="${port}"  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"
               expectHeaders="Set-Cookie2:foo=bar;Version=1;Max-Age=8640000"
        />
  
        <gtest host="${host}" port="${port}"  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"
               returnCode="404"
        />
  
        <gtest host="${host}" port="${port}"  request="GET /test/request/uri/does/not/exist
HTTP/1.0"
               returnCode="${http.protocol} 404"
        />
  
        <gtest host="${host}" port="${port}"  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   /   "
               returnCode="Error: "
               magnitude="false" / -->
  
        <!-- tolerate bad request for now
        <gtest host="${host}" port="${port}"  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"
               returnCode="${http.protocol} 400"
        />
        -->
  
        <!-- tolerate bad request for now
        <gtest host="${host}" port="${port}"  request="   GET   /index.ht ml HTTP/1.0 "
 
               returnCode="${http.protocol} 400"
        />
        -->
  
  
        <gtest host="${host}" port="${port}"  request="GET /test/servlet HTTP/1.0"
               returnCode="${http.protocol} 404"
        />
  
        <gtest host="${host}" port="${port}"  request="GET /test/servlet/ HTTP/1.0"
               returnCode="${http.protocol} 404"
        />
  
        <gtest host="${host}" port="${port}"  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"
               returnCode="${http.protocol} 302"
        />
  
        <gtest host="${host}" port="${port}"  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"
               returnCode="${http.protocol} 200"
        />
  
        <gtest host="${host}" port="${port}"  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"
               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"
               request="GET /test/foo/bar/index.bop HTTP/1.0"
               responseMatch="Servlet: Servlet1"
              />
  
        <gtest host="${host}" port="${port}"  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"
               request="GET /test/baz/index.html HTTP/1.0"
               responseMatch="Servlet: Servlet2"
              />
  
        <gtest host="${host}" port="${port}"  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"
               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"
               request="GET /test/catalog/racecar.bop HTTP/1.0"
               responseMatch="Servlet: Servlet4"
              />
  
        <gtest host="${host}" port="${port}"  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"
             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"
               content="name=lightness of being"
               returnCode="${http.protocol} 404"
              />
  
        <gtest host="${host}" port="${port}"  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"
               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"
               content="name=lightness of being"
               returnCode="Error: 400"
              /-->
  
        <!-- 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 "
               content="name=lightness of being"
               returnCode="Error: 400"
              />
         -->
  
        <gtest host="${host}" port="${port}"  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"
               content=""
               returnCode="${http.protocol} 404"
              />
  
        <gtest host="${host}" port="${port}"  request="POST /test/servlet/ HTTP/1.0"
               content=""
               returnCode="${http.protocol} 404"
              />
  
        <gtest host="${host}" port="${port}"  request="POST /test/"
               content=""
               returnCode="${http.protocol} 400"
              />
  
        <gtest host="${host}" port="${port}"  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"
               content="name=lightness of being,,,,,,,....###///&amp;&amp;@@@@@***"
               returnCode="${http.protocol} 200"
              />
  
        <gtest host="${host}" port="${port}"  request="POST /test/servlet/request.EchoServlet"
               content="name=lightness of being,,,,,,,....###///&amp;&amp;&amp;&amp;@@@@@***"
               returnCode="${http.protocol} 200"
              />
  
        <gtest host="${host}" port="${port}"  request="POST \/test/servlet/request.EchoServlet?name=sun&amp;age=2000"
               content="name=lightness of being,,,,,,,....###///&amp;@@@@@***"
               returnCode="${http.protocol} 200"
              />
  
        <gtest host="${host}" port="${port}"  request="POST \"
               content="name=lightness of being"
               returnCode="Error: 400"
              />
  
        <gtest host="${host}" port="${port}"  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"
               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   "
               returnCode="${http.protocol} 400"
              />
        -->
  
        <gtest host="${host}" port="${port}"  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"
               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"
               returnCode="${http.protocol} 503"
        />
        <!-- again for good measure -->
        <gtest host="${host}" port="${port}"  request="GET /test/servlet/PermanentlyUnavailable
HTTP/1.0"
               returnCode="${http.protocol} 503"
        />
        <!-- this one was loaded on startup -->
        <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"
               responseMatch="Hello"
        />
     </target>
  
     <!-- ============= restricted access tests ============= -->
     <target name="restricted">
        <gtest host="${host}" port="${port}"  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"
               returnCode="${http.protocol} 4" />
  
        <gtest host="${host}" port="${port}"  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"
               returnCode="${http.protocol} 4" />
  
        <gtest host="${host}" port="${port}"  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"
               returnCode="${http.protocol} 4" />
  
        <gtest host="${host}" port="${port}"  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"
               returnCode="${http.protocol} 4" />
  
        <gtest host="${host}" port="${port}"  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"
               returnCode="${http.protocol} 4" />
  
        <gtest host="${host}" port="${port}"  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"
               returnCode="${http.protocol} 4" />
  
        <gtest host="${host}" port="${port}"  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"
               returnCode="${http.protocol} 4" />
  
        <gtest host="${host}" port="${port}"  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"
               returnCode="${http.protocol} 4" />
  
        <gtest host="${host}" port="${port}"  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"
               returnCode="${http.protocol} 4" />
  
        <gtest host="${host}" port="${port}"  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"
               returnCode="${http.protocol} 4" />
  
        <gtest host="${host}" port="${port}"  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"
               returnCode="${http.protocol} 4" />
     </target>
  
     <target name="startup">
       <java classname="org.apache.tomcat.startup.Tomcat" args="" />
     </target>
  
  
     <target name="client" depends="file-tomcat,dispatch-tomcat,get-tomcat,requestMap,post,jsp-tomcat,wrong_request,unavailable,restricted">
     </target>
  
     <target name="client-apache" depends="file-apache,dispatch-apache,get-apache,post,jsp-apache,wrong_request,unavailable,restricted">
     </target>
  
     <target name="shutdown">
       <java classname="org.apache.tomcat.startup.Tomcat" args="-stop" />
     </target>
  
  
     <target name="main" depends="startup,client,shutdown" />
  
     <target name="apache" depends="startup,client-apache,shutdown" />
  
  </project>
  
  
  
  

Mime
View raw message