costin      01/01/28 11:18:37

  Modified:    src/admin/WEB-INF/classes/tadm GTestTag.java
               src/admin/test test.jsp
  Log:
  Updated GTestTag to process "port", "http.protocol", "host"
  parameters and set them as ant properties.
  This allows testing with apache ( where http.protocol is HTTP/1.1, and
  the port is different ), and allows to test virtual hosts.
  
  Added the options in the simple form in test.jsp. ( again, the graphical
  aspect of the test application sucks, and most of the taglibraries used
  are ugly - the goal is to find and fix the bugs, we can make it look
  nice later )
  
  It would be really great if someone can "beautify" the test page and the
  other admin pages, etc - but it's low priority right now.
  
  Revision  Changes    Path
  1.8       +11 -1     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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- GTestTag.java     2001/01/27 18:39:33     1.7
  +++ GTestTag.java     2001/01/28 19:18:36     1.8
  @@ -146,6 +146,16 @@
            // XXX
            project.setUserProperty( "gdir", base + "/Golden");
            project.setUserProperty( "wgdir", base + "/Golden");
  +
  +         String port=pageContext.getRequest().getParameter("port");
  +         if( port!=null)
  +             project.setUserProperty( "port", port);
  +         String proto=pageContext.getRequest().getParameter("server.proto");
  +         if( proto!=null )
  +             project.setUserProperty( "http.protocol", proto);
  +         String host=pageContext.getRequest().getParameter("host");
  +         if( host!=null )
  +             project.setUserProperty( "host", host);
            
            ProjectHelper.configureProject( project, testFile );
   
  @@ -154,7 +164,7 @@
            if (revision  == null)
                revision  = "Revision: Unknown";
            else {
  -             // clean up a little in case CVS $Revision: 1.7 $ used
  +             // clean up a little in case CVS $Revision: 1.8 $ used
                revision  = revision .replace('$',' ');
                revision .trim();
            }
  
  
  
  1.7       +21 -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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- test.jsp  2001/01/27 18:39:33     1.6
  +++ test.jsp  2001/01/28 19:18:37     1.7
  @@ -26,7 +26,10 @@
   <br>
   
   Debug: <input type="checkbox" name="debug" value="10"><br>
  -
  +Port: <input type="input" name="port" value="8080"><br>
  +Host: <input type="input" name="host" value="127.0.0.1"><br>
  +Expected protocol: <input type="input" name="server.proto" value="HTTP/1.0">
  + ( use when testing Apache - tomcat3.x returns HTTP/1.0 ) <br>
   <input type="submit">
   </form>
   
  @@ -77,6 +80,23 @@
   <pre>
     <%= failures.getMatcher().getMessage() %>
   </pre>
  +
  +<% // use a tag %>
  +<% if( request.getParameter("debug" ) != null ) { %>
  +  <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 -------------------- %>
  
  
  

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

Reply via email to