jakarta-watchdog-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rlu...@apache.org
Subject cvs commit: jakarta-watchdog-4.0/src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet/ServletResponseWrapper ServletResponseWrapperSetContentLengthTestServlet.java
Date Tue, 12 Mar 2002 05:22:19 GMT
rlubke      02/03/11 21:22:19

  Modified:    src/conf servlet-gtest.xml
               src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet/ServletRequest
                        GetRemoteHostTestServlet.java
               src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet/ServletRequestWrapper
                        ServletRequestWrapperGetRemoteHostTestServlet.java
               src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet/ServletResponse
                        SetContentLengthTestServlet.java
               src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet/ServletResponseWrapper
                        ServletResponseWrapperSetContentLengthTestServlet.java
  Log:
   - Added additional logic to the GetRemoteHost tests so that if an IP address of 127.0.0.1
was sent from the
     client as a check, that a value of localhost returned from the server would be valid.
   - Fixed the SetContentLength tests.
      SetContentLength test didn't take into account the LF added by println().
      ServletResponseWrapperSetContentLenghTest didn't take the length of the data introduced
by the wrapper
      when setContentLength() was called.
  
      All tests pass(?) running against the Old HTTP connector and Coyote.
  
  Revision  Changes    Path
  1.40      +4 -4      jakarta-watchdog-4.0/src/conf/servlet-gtest.xml
  
  Index: servlet-gtest.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-watchdog-4.0/src/conf/servlet-gtest.xml,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- servlet-gtest.xml	11 Feb 2002 18:36:52 -0000	1.39
  +++ servlet-gtest.xml	12 Mar 2002 05:22:18 -0000	1.40
  @@ -940,7 +940,7 @@
           <watchdog request="GET /servlet-tests/SetContentLengthTest HTTP/1.0"
               testName="SetContentLengthTest" debug="0"
               host="${host}" port="${port}" exactMatch="true"
  -            expectHeaders="Content-Length:31"
  +            expectHeaders="Content-Length:32"
               goldenFile="${wgdir}/javax_servlet/ServletResponse/SetContentLengthTest.html"
               assertion="Sets the length of the content body in the response, specified in
the Java Servlet Pages Specification v2.3, Sec 14"
               testStrategy="A test for ServletResponse.setContentLength() method."
  @@ -1461,7 +1461,7 @@
           <watchdog request="GET /servlet-tests/sresw/ServletResponseWrapperSetContentLengthTest
HTTP/1.0"
               testName="ServletResponseWrapperSetContentLengthTest" debug="0"
               host="${host}" port="${port}" exactMatch="true"
  -            expectHeaders="Content-Length:58"
  +            expectHeaders="Content-Length:104"
               goldenFile="${wgdir}/javax_servlet/ServletResponseWrapper/ServletResponseWrapperSetContentLengthTest.html"
               assertion="The default behavior of this method is to call setContentLength(int
len) on the wrapped response object, specified in the Java Servlet Pages Specification v2.3,
Sec 14"
               testStrategy="Client calls a servlet who's response has been wrapped. The wrapper
object writes a message to a static log file and calls the wrapped objects method. Servlet
then tests the returned value and returns the result of the test plus the contents of the
static log file."
  @@ -4169,7 +4169,7 @@
           <watchdog request="GET /servlet-tests/SetContentLengthTest HTTP/1.0"
               testName="SetContentLengthTest" debug="0"
               host="${host}" port="${port}" exactMatch="true"
  -            expectHeaders="Content-Length:31"
  +            expectHeaders="Content-Length:32"
               goldenFile="${wgdir}/javax_servlet/ServletResponse/SetContentLengthTest.html"
               assertion="Sets the length of the content body in the response, specified in
the Java Servlet Pages Specification v2.3,  Sec 14"
               testStrategy="A test for ServletResponse.setContentLength() method."
  @@ -4778,7 +4778,7 @@
           <watchdog request="GET /servlet-tests/ServletResponseWrapperSetContentLengthTest
HTTP/1.0"
               testName="ServletResponseWrapperSetContentLengthTest" debug="0"
               host="${host}" port="${port}" exactMatch="true"
  -            expectHeaders="Content-Length:58"
  +            expectHeaders="Content-Length:104"
               goldenFile="${wgdir}/javax_servlet/ServletResponseWrapper/ServletResponseWrapperSetContentLengthTest.html"
               assertion="The default behavior of this method is to call  setContentLength(int
len) on the wrapped response object,  specified in the Java Servlet Pages Specification v2.3,
Sec 14"
               testStrategy="Client calls a servlet who's response has been wrapped. The wrapper
object writes a message to a static log file and calls the wrapped objects method. Servlet
then tests the returned value and returns the result of the test plus the contents of the
static log file."
  
  
  
  1.5       +6 -3      jakarta-watchdog-4.0/src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet/ServletRequest/GetRemoteHostTestServlet.java
  
  Index: GetRemoteHostTestServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-watchdog-4.0/src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet/ServletRequest/GetRemoteHostTestServlet.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- GetRemoteHostTestServlet.java	11 Feb 2002 18:12:39 -0000	1.4
  +++ GetRemoteHostTestServlet.java	12 Mar 2002 05:22:18 -0000	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-watchdog-4.0/src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet/ServletRequest/GetRemoteHostTestServlet.java,v
1.4 2002/02/11 18:12:39 rlubke Exp $ 
  - * $Revision: 1.4 $
  - * $Date: 2002/02/11 18:12:39 $
  + * $Header: /home/cvs/jakarta-watchdog-4.0/src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet/ServletRequest/GetRemoteHostTestServlet.java,v
1.5 2002/03/12 05:22:18 rlubke Exp $ 
  + * $Revision: 1.5 $
  + * $Date: 2002/03/12 05:22:18 $
    *
    * ====================================================================
    * The Apache Software License, Version 1.1
  @@ -94,6 +94,9 @@
   
                   while ( ( !found ) && ( i <= len - 1 ) ) {
                       if ( result.toLowerCase().indexOf( expectedResult[ i ] ) > -1 )
{
  +                        found = true;
  +                    }
  +                    if (result.toLowerCase().equals("localhost") && expectedResult[i].equals("127.0.0.1"))
{
                           found = true;
                       }
   
  
  
  
  1.4       +6 -3      jakarta-watchdog-4.0/src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet/ServletRequestWrapper/ServletRequestWrapperGetRemoteHostTestServlet.java
  
  Index: ServletRequestWrapperGetRemoteHostTestServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-watchdog-4.0/src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet/ServletRequestWrapper/ServletRequestWrapperGetRemoteHostTestServlet.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ServletRequestWrapperGetRemoteHostTestServlet.java	11 Feb 2002 18:31:08 -0000	1.3
  +++ ServletRequestWrapperGetRemoteHostTestServlet.java	12 Mar 2002 05:22:18 -0000	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-watchdog-4.0/src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet/ServletRequestWrapper/ServletRequestWrapperGetRemoteHostTestServlet.java,v
1.3 2002/02/11 18:31:08 rlubke Exp $ 
  - * $Revision: 1.3 $
  - * $Date: 2002/02/11 18:31:08 $
  + * $Header: /home/cvs/jakarta-watchdog-4.0/src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet/ServletRequestWrapper/ServletRequestWrapperGetRemoteHostTestServlet.java,v
1.4 2002/03/12 05:22:18 rlubke Exp $ 
  + * $Revision: 1.4 $
  + * $Date: 2002/03/12 05:22:18 $
    *
    * ====================================================================
    * The Apache Software License, Version 1.1
  @@ -92,6 +92,9 @@
   
                   while ( ( !found ) && ( i <= len - 1 ) ) {
                       if ( result.toLowerCase().indexOf( expectedResult[ i ] ) > -1 )
{
  +                        found = true;
  +                    }
  +                    if (result.toLowerCase().equals("localhost") && expectedResult[i].equals("127.0.0.1"))
{
                           found = true;
                       }
   
  
  
  
  1.3       +4 -4      jakarta-watchdog-4.0/src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet/ServletResponse/SetContentLengthTestServlet.java
  
  Index: SetContentLengthTestServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-watchdog-4.0/src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet/ServletResponse/SetContentLengthTestServlet.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SetContentLengthTestServlet.java	11 Jan 2002 22:21:00 -0000	1.2
  +++ SetContentLengthTestServlet.java	12 Mar 2002 05:22:18 -0000	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-watchdog-4.0/src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet/ServletResponse/SetContentLengthTestServlet.java,v
1.2 2002/01/11 22:21:00 rlubke Exp $ 
  - * $Revision: 1.2 $
  - * $Date: 2002/01/11 22:21:00 $
  + * $Header: /home/cvs/jakarta-watchdog-4.0/src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet/ServletResponse/SetContentLengthTestServlet.java,v
1.3 2002/03/12 05:22:18 rlubke Exp $ 
  + * $Revision: 1.3 $
  + * $Date: 2002/03/12 05:22:18 $
    *
    * ====================================================================
    * The Apache Software License, Version 1.1
  @@ -75,7 +75,7 @@
       public void service ( ServletRequest request, ServletResponse response ) throws ServletException,
IOException {
   
           PrintWriter out = response.getWriter();
  -        response.setContentLength( PASSED.length() );
  +        response.setContentLength( PASSED.length() + 1 );
           out.println( PASSED );
       }
   }
  
  
  
  1.2       +5 -5      jakarta-watchdog-4.0/src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet/ServletResponseWrapper/ServletResponseWrapperSetContentLengthTestServlet.java
  
  Index: ServletResponseWrapperSetContentLengthTestServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-watchdog-4.0/src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet/ServletResponseWrapper/ServletResponseWrapperSetContentLengthTestServlet.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ServletResponseWrapperSetContentLengthTestServlet.java	11 Jan 2002 22:21:00 -0000	1.1
  +++ ServletResponseWrapperSetContentLengthTestServlet.java	12 Mar 2002 05:22:18 -0000	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-watchdog-4.0/src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet/ServletResponseWrapper/ServletResponseWrapperSetContentLengthTestServlet.java,v
1.1 2002/01/11 22:21:00 rlubke Exp $ 
  - * $Revision: 1.1 $
  - * $Date: 2002/01/11 22:21:00 $
  + * $Header: /home/cvs/jakarta-watchdog-4.0/src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet/ServletResponseWrapper/ServletResponseWrapperSetContentLengthTestServlet.java,v
1.2 2002/03/12 05:22:18 rlubke Exp $ 
  + * $Revision: 1.2 $
  + * $Date: 2002/03/12 05:22:18 $
    *
    * ====================================================================
    * The Apache Software License, Version 1.1
  @@ -75,8 +75,8 @@
       public void service ( ServletRequest request, ServletResponse response ) throws ServletException,
IOException {
           PrintWriter out = response.getWriter();
           sl.resetLog();
  -
  -        response.setContentLength( PASSED.length() );
  +        // this length includes the output from the wrapper.
  +        response.setContentLength( PASSED.length() + 46 );
           out.println( PASSED );
           Enumeration e = sl.readFromLog();
   
  
  
  

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


Mime
View raw message