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_http/HttpServletRequestWrapper HttpServletRequestWrapperGetRequestURLTestServlet.java
Date Mon, 05 Aug 2002 02:33:32 GMT
rlubke      2002/08/04 19:33:32

  Modified:    src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet_http/HttpServletRequestWrapper
                        HttpServletRequestWrapperGetRequestURLTestServlet.java
  Log:
   - Changed logic from using cookies to using request headers.
     Cookie handling was not needed for this test.
  
  Revision  Changes    Path
  1.3       +11 -13    jakarta-watchdog-4.0/src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet_http/HttpServletRequestWrapper/HttpServletRequestWrapperGetRequestURLTestServlet.java
  
  Index: HttpServletRequestWrapperGetRequestURLTestServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-watchdog-4.0/src/server/servlet-tests/WEB-INF/classes/tests/javax_servlet_http/HttpServletRequestWrapper/HttpServletRequestWrapperGetRequestURLTestServlet.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- HttpServletRequestWrapperGetRequestURLTestServlet.java	12 Feb 2002 13:56:42 -0000	1.2
  +++ HttpServletRequestWrapperGetRequestURLTestServlet.java	5 Aug 2002 02:33:32 -0000	1.3
  @@ -83,35 +83,32 @@
   
           String url = null;
   
  -        Cookie c[] = request.getCookies();
  -        int len = c.length;
           boolean found1 = false;
           boolean found2 = false;
           boolean found3 = false;
           boolean found4 = false;
  +
           String prefix = null;
           String server = null;
           String port = null;
           String path = null;
  -        int i = 0;
   
  -        while ( i <= len - 1 ) {
  -            String temp = c[ i ].getName();
  +        for (Enumeration e = request.getHeaderNames(); e.hasMoreElements(); ) {
  +            String temp = (String) e.nextElement();
   
               if ( temp.equals( "prefix" ) ) {
  -                prefix = c[ i ].getValue();
  +                prefix = request.getHeader( temp );
                   found1 = true;
               } else if ( temp.equals( "server" ) ) {
  -                server = c[ i ].getValue();
  +                server = request.getHeader( temp );
                   found2 = true;
               } else if ( temp.equals( "port" ) ) {
  -                port = c[ i ].getValue();
  +                port = request.getHeader( temp );
                   found3 = true;
               } else if ( temp.equals( "servletpath" ) ) {
  -                path = c[ i ].getValue().replace( '_', '/' );
  +                path = request.getHeader( temp ).replace( '_', '/' );
                   found4 = true;
               }
  -            i++;
           }
   
           if ( ( found1 ) && ( found2 ) && ( found3 ) && ( found4
) ) {
  @@ -124,6 +121,7 @@
               StringBuffer sresult = request.getRequestURL();
   
               if ( sresult.length() > 0 ) {
  +
                   String result = sresult.toString();
   
                   if ( result.equals( expectedResult ) || result.equals( expectedResult2
) ) {
  
  
  

--
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