tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lar...@apache.org
Subject cvs commit: jakarta-tomcat/src/admin/test test.jsp sanity-form.jsp
Date Mon, 31 Dec 2001 21:46:17 GMT
larryi      01/12/31 13:46:17

  Modified:    src/admin/test test.jsp sanity-form.jsp
  Log:
  Add some input fields and handling to set various properties for the
  internal test.  This makes it possible to run the tests without error while
  using Apache, IIS, and Netscape as external web servers.
  
  Also, fix so that the selections are preserved across test runs.
  
  Revision  Changes    Path
  1.19      +29 -0     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.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- test.jsp	22 Sep 2001 21:13:27 -0000	1.18
  +++ test.jsp	31 Dec 2001 21:46:16 -0000	1.19
  @@ -33,6 +33,15 @@
         out.println("ERROR: Invalid port number!");
         return;
      }
  +   String dirStatus="301";
  +   String redirStatus="301";
  +   if (!staticServer.equals("Tomcat")) {
  +      dirStatus="200";
  +      if (!staticServer.equals("Apache"))
  +         redirStatus="302";
  +      else
  +         redirStatus="301";
  +   }
   %>
   
   <ant:gtest />
  @@ -53,6 +62,26 @@
     <ant:property name="http.protocol" param="server.proto" />
     <ant:property name="host" param="host" />
     <ant:property name="not.standalone" value="<%= notStandAlone %>" />
  +  <ant:property name="dir.status" value="<%= dirStatus %>" />
  +  <ant:property name="redir.status" value="<%= redirStatus %>" />
  +<% if ("Tomcat".equals(webServer)) { %>
  +  <ant:property name="tomcat.server" value="Tomcat" />
  +<% } else if ("Apache".equals(webServer)) { %>
  +  <ant:property name="apache.server" value="Apache" />
  +<% } else if ("IIS".equals(webServer)) { %>
  +  <ant:property name="iis.server" value="IIS" />
  +<% } else if ("Netscape".equals(webServer)) { %>
  +  <ant:property name="netscape.server" value="Netscape" />
  +<% } %>
  +<% if ("Tomcat".equals(staticServer)) { %>
  +  <ant:property name="tomcat.static" value="Tomcat" />
  +<% } else if ("Apache".equals(staticServer)) { %>
  +  <ant:property name="apache.static" value="Apache" />
  +<% } else if ("IIS".equals(staticServer)) { %>
  +  <ant:property name="iis.static" value="IIS" />
  +<% } else if ("Netscape".equals(staticServer)) { %>
  +  <ant:property name="netscape.static" value="Netscape" />
  +<% } %>
   </ant:ant>
   <% // Test completed, display the results ( outType=none means
      // Gtest doesn't generate any output ( but we have to wait untill
  
  
  
  1.5       +69 -34    jakarta-tomcat/src/admin/test/sanity-form.jsp
  
  Index: sanity-form.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/admin/test/sanity-form.jsp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- sanity-form.jsp	18 Jul 2001 20:39:40 -0000	1.4
  +++ sanity-form.jsp	31 Dec 2001 21:46:16 -0000	1.5
  @@ -1,37 +1,72 @@
   <form method="GET" action="test.jsp" >
  -Target:
  -<select name="target" > 
  -  <option>file</option>
  -  <option>params</option>
  -  <option>dispatch</option>
  -  <option>get</option>
  -  <option>requestMap</option>
  -  <option>post</option>
  -  <option>wrong_request</option>
  -  <option>restricted</option>
  -  <option>jsp</option>
  -  <option>unavailable</option>
  -  <option>headers</option>
  -  <option>security_chk_url</option>
  -  <option>security_chk</option>
  -  <option>aaa</option>
  -  <option>special</option>
  -  <option>tomcat-standalone</option>
  -  <option>tomcat-apache</option>
  -  <option selected>client</option>
  -</select>
  -<br>
  -
  -Debug: <input type="checkbox" name="debug" value="10"><br>
  -Port: <input type="input" name="port" value="<%= request.getServerPort() %>">
  -<br>
  -Host: <input type="input" name="host" value="<%= request.getServerName() %>">
  -<br>
  -Expected protocol: 
  -<select name="server.proto" > 
  -  <option selected>HTTP/1.0</option>
  -  <option>HTTP/1.1</option>
  -</select>
  - ( use HTTP/1.1 when testing with Apache or a 1.1 server connector ) <br>
  +<%!
  +  void listOptions(String[] opts, String sel, JspWriter out)
  +      throws java.io.IOException
  +  {
  +    for ( int i=0; i < opts.length; i++ ) {
  +      if ( sel.equals(opts[i]) )
  +        out.println("  <option selected>" + sel + "</option>");
  +      else
  +        out.println("  <option>" + opts[i] + "</option>");
  +    }
  +  }
  +  String [] targets = new String [] {
  +      "file","params","dispatch","get","requestMap","post",
  +      "wrong_request","restricted","jsp","unavailable",
  +      "headers","enc","security_chk_url","security_chk",
  +      "aaa","special","client"};
  +  String [] protocols = new String [] {
  +      "HTTP/1.0","HTTP/1.1"};
  +  String [] webservers = new String [] {
  +      "Tomcat","Apache","IIS","Netscape" };
  +%>
  +<%
  +   String curTarget = request.getParameter("target");
  +   if (curTarget == null)
  +     curTarget = "client";
  +   String curProto = request.getParameter("server.proto");
  +   if ( curProto == null )
  +     curProto = "HTTP/1.0";
  +   String webServer = request.getParameter("web.server");
  +   if ( webServer == null )
  +     webServer = "Tomcat";
  +   String staticServer = request.getParameter("static.server");
  +   if ( staticServer == null )
  +     staticServer = "Tomcat";
  +%>
  +<p>Target:
  +<select name="target" ><% listOptions(targets, curTarget, out); %></select>
  +&quot;client&quot; is the target for the main test suite.</p>
  +<p>Host:
  +<input type="text" name="host" value="<%= request.getServerName() %>"></p>
  +<table cellspacing="2" >
  +<tr><th align="left">Parameter</th>
  +    <th align="left">Value</th>
  +    <th align="left">Description</th>
  +<tr><td valign="top">Host Web Server:</td>
  +    <td valign="top"><select name="web.server" >
  +        <% listOptions(webservers, webServer, out); %></select></td>
  +    <td valign="top">The host web server to test.</td></tr>
  +<tr><td valign="top">Host HTTP Port:</td>
  +    <td valign="top"><input type="text" name="port"
  +        value="<%= request.getServerPort() %>" size="10"></td>
  +    <td valign="top">HTTP port being used by the host web server.<br>
  +        Specify 8080 for Tomcat and 80 for others.</td></tr>
  +<tr><td valign="top">Expected protocol:</td>
  +    <td valign="top"><select name="server.proto" >
  +        <% listOptions(protocols, curProto, out); %></select></td>
  +    <td valign="top">Specify HTTP/1.0 for Tomcat as the host web server<br>
  +        Specify HTTP/1.1 for others.</td></tr>
  +<tr><td valign="top">Static Page Server: </td>
  +    <td valign="top"><select name="static.server" >
  +        <% listOptions(webservers, staticServer, out); %></select></td>
  +    <td valign="top">Server that serves static pages.<br>
  +        Specify Tomcat if using a generated configuration file with
  +        <code>forwardAll=&quot;true&quot;</code>.<br>
  +        Specify the host web server if
  +        <code>forwardAll=&quot;false&quot;.</code></td></tr>
  +</table>
  +<p>Debug:
  +<input type="checkbox" name="debug" value="10"></p>
   <input type="submit">
   </form>
  
  
  

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


Mime
View raw message