craigmcc    01/07/18 13:17:18

  Modified:    tester/src/bin tester.xml
               tester/src/tester/org/apache/tester UpperCaseResponse.java
               tester/web/WEB-INF web.xml
  Added:       tester/src/tester/org/apache/tester CharArrayResponse.java
                        CharArrayWriterUpperCase.java ResponseWrap01.java
                        ResponseWrap01a.java ResponseWrap01c.java
  Log:
  Unit tests for creating a response wrapper and then using it with a
  request dispatcher, testing both includes and forwards to servlets and JSP
  pages.
  
  Revision  Changes    Path
  1.59      +18 -0     jakarta-tomcat-4.0/tester/src/bin/tester.xml
  
  Index: tester.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/tester/src/bin/tester.xml,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- tester.xml        2001/07/17 22:34:52     1.58
  +++ tester.xml        2001/07/18 20:17:17     1.59
  @@ -737,6 +737,24 @@
            request="${context.path}/Include07" debug="${debug}"
             golden="${golden.path}/Include07.txt"/>
   
  +    <!-- ========== Response Wrapping ===================================== -->
  +
  +    <tester host="${host}" port="${port}" protocol="${protocol}"
  +         request="${context.path}/ResponseWrap01?type=F&amp;page=/ResponseWrap01a"
  +      outContent="RESPONSEWRAP01A PASSED" debug="${debug}" />
  +
  +    <tester host="${host}" port="${port}" protocol="${protocol}"
  +         
request="${context.path}/ResponseWrap01?type=F&amp;page=/ResponseWrap01b.jsp"
  +      outContent="RESPONSEWRAP01B PASSED" debug="${debug}" />
  +
  +    <tester host="${host}" port="${port}" protocol="${protocol}"
  +         request="${context.path}/ResponseWrap01?type=I&amp;page=/ResponseWrap01c"
  +      outContent="RESPONSEWRAP01C PASSED" debug="${debug}" />
  +
  +    <tester host="${host}" port="${port}" protocol="${protocol}"
  +         
request="${context.path}/ResponseWrap01?type=I&amp;page=/ResponseWrap01d.jsp"
  +      outContent="RESPONSEWRAP01D PASSED" debug="${debug}" />
  +
     </target>
   
   
  
  
  
  1.2       +12 -2     
jakarta-tomcat-4.0/tester/src/tester/org/apache/tester/UpperCaseResponse.java
  
  Index: UpperCaseResponse.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/tester/src/tester/org/apache/tester/UpperCaseResponse.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- UpperCaseResponse.java    2001/05/30 19:42:46     1.1
  +++ UpperCaseResponse.java    2001/07/18 20:17:17     1.2
  @@ -69,7 +69,7 @@
    * upper case.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.1 $ $Date: 2001/05/30 19:42:46 $
  + * @version $Revision: 1.2 $ $Date: 2001/07/18 20:17:17 $
    */
   
   public class UpperCaseResponse extends HttpServletResponseWrapper {
  @@ -77,9 +77,16 @@
   
       HttpServletResponse response = null;
   
  +    boolean stream = false; // Wrap our own output stream
  +
       public UpperCaseResponse(HttpServletResponse response) {
  +        this(response, false);
  +    }
  +
  +    public UpperCaseResponse(HttpServletResponse response, boolean stream) {
           super(response);
           this.response = response;
  +        this.stream = stream;
       }
   
       public ServletOutputStream getOutputStream() throws IOException {
  @@ -87,7 +94,10 @@
       }
   
       public PrintWriter getWriter() throws IOException {
  -        return (new UpperCaseWriter(response.getWriter()));
  +        if (stream)
  +            return (new PrintWriter(getOutputStream(), true));
  +        else
  +            return (new UpperCaseWriter(response.getWriter()));
       }
   
   
  
  
  
  1.1                  
jakarta-tomcat-4.0/tester/src/tester/org/apache/tester/CharArrayResponse.java
  
  Index: CharArrayResponse.java
  ===================================================================
  /* ========================================================================= *
   *                                                                           *
   *                 The Apache Software License,  Version 1.1                 *
   *                                                                           *
   *      Copyright (c) 1999, 2000, 2001  The Apache Software Foundation.      *
   *                           All rights reserved.                            *
   *                                                                           *
   * ========================================================================= *
   *                                                                           *
   * Redistribution and use in source and binary forms,  with or without modi- *
   * fication, are permitted provided that the following conditions are met:   *
   *                                                                           *
   * 1. Redistributions of source code  must retain the above copyright notice *
   *    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 Software Foundation.                                            *
   *                                                                           *
   * 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 indivi- *
   * duals on behalf of the  Apache Software Foundation.  For more information *
   * on the Apache Software Foundation, please see <http://www.apache.org/>.   *
   *                                                                           *
   * ========================================================================= */
  
  package org.apache.tester;
  
  
  import java.io.*;
  import java.util.*;
  import javax.servlet.*;
  import javax.servlet.http.*;
  
  
  /**
   * HttpServletResponse wrapper that converts all output characters to
   * upper case via an intermediate buffer.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2001/07/18 20:17:17 $
   */
  
  public class CharArrayResponse extends HttpServletResponseWrapper {
  
  
      CharArrayWriterUpperCase writer = null;
  
      public CharArrayResponse(HttpServletResponse response) {
          super(response);
          writer = new CharArrayWriterUpperCase();
      }
  
      public void flushBuffer() throws IOException {
          int n = 0;
          Reader reader = getReader();
          PrintWriter writer = getResponse().getWriter();
          while (true) {
              int ch = reader.read();
              if (ch < 0)
                  break;
              n++;
              writer.print((char) ch);
          }
          writer.println("[" + n + "]");
          this.writer.reset();
      }
  
      public Reader getReader() {
          return (new CharArrayReader(writer.toCharArray()));
      }
  
      public PrintWriter getWriter() throws IOException {
          return (new PrintWriter(writer, true));
      }
  
  
  }
  
  
  
  
  
  
  1.1                  
jakarta-tomcat-4.0/tester/src/tester/org/apache/tester/CharArrayWriterUpperCase.java
  
  Index: CharArrayWriterUpperCase.java
  ===================================================================
  /* ========================================================================= *
   *                                                                           *
   *                 The Apache Software License,  Version 1.1                 *
   *                                                                           *
   *      Copyright (c) 1999, 2000, 2001  The Apache Software Foundation.      *
   *                           All rights reserved.                            *
   *                                                                           *
   * ========================================================================= *
   *                                                                           *
   * Redistribution and use in source and binary forms,  with or without modi- *
   * fication, are permitted provided that the following conditions are met:   *
   *                                                                           *
   * 1. Redistributions of source code  must retain the above copyright notice *
   *    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 Software Foundation.                                            *
   *                                                                           *
   * 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 indivi- *
   * duals on behalf of the  Apache Software Foundation.  For more information *
   * on the Apache Software Foundation, please see <http://www.apache.org/>.   *
   *                                                                           *
   * ========================================================================= */
  
  package org.apache.tester;
  
  
  import java.io.*;
  import java.util.*;
  import javax.servlet.*;
  import javax.servlet.http.*;
  
  
  /**
   * Implementation of CharArrayWriter that upper cases its output.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2001/07/18 20:17:17 $
   */
  
  public class CharArrayWriterUpperCase extends CharArrayWriter {
  
  
      CharArrayWriter writer = new CharArrayWriter();
  
      public void close() {
          writer.close();
      }
  
      public void flush() {
          writer.flush();
      }
  
      public void reset() {
          writer.reset();
      }
  
      public int size() {
          return (writer.size());
      }
  
      public char[] toCharArray() {
          return (writer.toCharArray());
      }
  
      public String toString() {
          return (writer.toString());
      }
  
      public void write(int c) {
          char ch = (char) c;
          if (Character.isLowerCase(ch))
              ch = Character.toUpperCase(ch);
          writer.write((int) ch);
      }
  
      public void write(char c[]) throws IOException {
          write(c, 0, c.length);
      }
  
      public void write(char c[], int off, int len) {
          for (int i = off; i < (off + len); i++)
              write(c[i]);
      }
  
      public void write(String str) throws IOException {
          write(str, 0, str.length());
      }
  
      public void write(String str, int off, int len) {
          for (int i = off; i < (off + len); i++)
              write(str.charAt(i));
      }
  
      public void writeTo(Writer out) throws IOException {
          writer.writeTo(out);
      }
  
  
  }
  
  
  
  1.1                  
jakarta-tomcat-4.0/tester/src/tester/org/apache/tester/ResponseWrap01.java
  
  Index: ResponseWrap01.java
  ===================================================================
  /* ========================================================================= *
   *                                                                           *
   *                 The Apache Software License,  Version 1.1                 *
   *                                                                           *
   *      Copyright (c) 1999, 2000, 2001  The Apache Software Foundation.      *
   *                           All rights reserved.                            *
   *                                                                           *
   * ========================================================================= *
   *                                                                           *
   * Redistribution and use in source and binary forms,  with or without modi- *
   * fication, are permitted provided that the following conditions are met:   *
   *                                                                           *
   * 1. Redistributions of source code  must retain the above copyright notice *
   *    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 Software Foundation.                                            *
   *                                                                           *
   * 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 indivi- *
   * duals on behalf of the  Apache Software Foundation.  For more information *
   * on the Apache Software Foundation, please see <http://www.apache.org/>.   *
   *                                                                           *
   * ========================================================================= */
  
  package org.apache.tester;
  
  
  import java.io.*;
  import javax.servlet.*;
  import javax.servlet.http.*;
  
  /**
   * Basis for testing wrapped responses with combinations of forwarding to
   * or including both servlets and JSP pages.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2001/07/18 20:17:17 $
   */
  
  public class ResponseWrap01 extends HttpServlet {
  
      public void doGet(HttpServletRequest request, HttpServletResponse response)
          throws IOException, ServletException {
  
          // Acquire request parameters
          String type = request.getParameter("type");
          String page = request.getParameter("page");
  
          // Prepare this response
          response.setContentType("text/plain");
          //    PrintWriter writer = response.getWriter();
  
          // Forward or include as requested
          RequestDispatcher rd =
              getServletContext().getRequestDispatcher(page);
          if (rd == null) {
              PrintWriter writer = response.getWriter();
              writer.println("ResponseWrap01 FAILED - No request dispatcher" +
                             " for " + page);
          } else if ("F".equals(type)) {
              HttpServletResponseWrapper wrapper =
                  new CharArrayResponse(response);
              rd.forward(request, wrapper);
              wrapper.flushBuffer();
          } else {
              HttpServletResponseWrapper wrapper =
                  new CharArrayResponse(response);
              rd.include(request, wrapper);
              wrapper.flushBuffer();
          }
  
          // No filter wrapping for this test series
          StaticLogger.reset();
  
      }
  
  }
  
  
  
  1.1                  
jakarta-tomcat-4.0/tester/src/tester/org/apache/tester/ResponseWrap01a.java
  
  Index: ResponseWrap01a.java
  ===================================================================
  /* ========================================================================= *
   *                                                                           *
   *                 The Apache Software License,  Version 1.1                 *
   *                                                                           *
   *      Copyright (c) 1999, 2000, 2001  The Apache Software Foundation.      *
   *                           All rights reserved.                            *
   *                                                                           *
   * ========================================================================= *
   *                                                                           *
   * Redistribution and use in source and binary forms,  with or without modi- *
   * fication, are permitted provided that the following conditions are met:   *
   *                                                                           *
   * 1. Redistributions of source code  must retain the above copyright notice *
   *    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 Software Foundation.                                            *
   *                                                                           *
   * 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 indivi- *
   * duals on behalf of the  Apache Software Foundation.  For more information *
   * on the Apache Software Foundation, please see <http://www.apache.org/>.   *
   *                                                                           *
   * ========================================================================= */
  
  package org.apache.tester;
  
  
  import java.io.*;
  import javax.servlet.*;
  import javax.servlet.http.*;
  
  /**
   * Basis for testing wrapped responses with combinations of forwarding to
   * or including both servlets and JSP pages.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2001/07/18 20:17:17 $
   */
  
  public class ResponseWrap01a extends HttpServlet {
  
      public void doGet(HttpServletRequest request, HttpServletResponse response)
          throws IOException, ServletException {
  
          // Prepare this response
          response.setContentType("text/plain");
          PrintWriter writer = response.getWriter();
          writer.println("ResponseWrap01a PASSED");
  
      }
  
  }
  
  
  
  1.1                  
jakarta-tomcat-4.0/tester/src/tester/org/apache/tester/ResponseWrap01c.java
  
  Index: ResponseWrap01c.java
  ===================================================================
  /* ========================================================================= *
   *                                                                           *
   *                 The Apache Software License,  Version 1.1                 *
   *                                                                           *
   *      Copyright (c) 1999, 2000, 2001  The Apache Software Foundation.      *
   *                           All rights reserved.                            *
   *                                                                           *
   * ========================================================================= *
   *                                                                           *
   * Redistribution and use in source and binary forms,  with or without modi- *
   * fication, are permitted provided that the following conditions are met:   *
   *                                                                           *
   * 1. Redistributions of source code  must retain the above copyright notice *
   *    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 Software Foundation.                                            *
   *                                                                           *
   * 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 indivi- *
   * duals on behalf of the  Apache Software Foundation.  For more information *
   * on the Apache Software Foundation, please see <http://www.apache.org/>.   *
   *                                                                           *
   * ========================================================================= */
  
  package org.apache.tester;
  
  
  import java.io.*;
  import javax.servlet.*;
  import javax.servlet.http.*;
  
  /**
   * Basis for testing wrapped responses with combinations of forwarding to
   * or including both servlets and JSP pages.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2001/07/18 20:17:17 $
   */
  
  public class ResponseWrap01c extends HttpServlet {
  
      public void doGet(HttpServletRequest request, HttpServletResponse response)
          throws IOException, ServletException {
  
          // Prepare this response
          response.setContentType("text/plain");
          PrintWriter writer = response.getWriter();
          writer.println("ResponseWrap01c PASSED");
  
      }
  
  }
  
  
  
  1.43      +30 -0     jakarta-tomcat-4.0/tester/web/WEB-INF/web.xml
  
  Index: web.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/tester/web/WEB-INF/web.xml,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- web.xml   2001/07/12 02:40:59     1.42
  +++ web.xml   2001/07/18 20:17:18     1.43
  @@ -759,6 +759,21 @@
       </servlet>
   
       <servlet>
  +        <servlet-name>ResponseWrap01</servlet-name>
  +        <servlet-class>org.apache.tester.ResponseWrap01</servlet-class>
  +    </servlet>
  +
  +    <servlet>
  +        <servlet-name>ResponseWrap01a</servlet-name>
  +        <servlet-class>org.apache.tester.ResponseWrap01a</servlet-class>
  +    </servlet>
  +
  +    <servlet>
  +        <servlet-name>ResponseWrap01c</servlet-name>
  +        <servlet-class>org.apache.tester.ResponseWrap01c</servlet-class>
  +    </servlet>
  +
  +    <servlet>
           <servlet-name>Session01</servlet-name>
           <servlet-class>org.apache.tester.Session01</servlet-class>
       </servlet>
  @@ -1374,6 +1389,21 @@
       <servlet-mapping>
           <servlet-name>Resources06</servlet-name>
           <url-pattern>/WrappedResources06</url-pattern>
  +    </servlet-mapping>
  +
  +    <servlet-mapping>
  +        <servlet-name>ResponseWrap01</servlet-name>
  +        <url-pattern>/ResponseWrap01</url-pattern>
  +    </servlet-mapping>
  +
  +    <servlet-mapping>
  +        <servlet-name>ResponseWrap01a</servlet-name>
  +        <url-pattern>/ResponseWrap01a</url-pattern>
  +    </servlet-mapping>
  +
  +    <servlet-mapping>
  +        <servlet-name>ResponseWrap01c</servlet-name>
  +        <url-pattern>/ResponseWrap01c</url-pattern>
       </servlet-mapping>
   
       <servlet-mapping>
  
  
  

Reply via email to