commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject cvs commit: jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/cookie TestCookieCompatibilitySpec.java
Date Sat, 24 Apr 2004 23:51:57 GMT
olegk       2004/04/24 16:51:57

  Modified:    httpclient/src/java/org/apache/commons/httpclient/cookie
                        CookieSpecBase.java
               httpclient/src/test/org/apache/commons/httpclient
                        TestMethodsRedirectNoHost.java
               httpclient/src/test/org/apache/commons/httpclient/cookie
                        TestCookieCompatibilitySpec.java
  Log:
  Rolling back a mistake in the path matching logic introduced with my latest patch
  
  Contributed by Oleg Kalnichevski
  
  Revision  Changes    Path
  1.25      +4 -4      jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/cookie/CookieSpecBase.java
  
  Index: CookieSpecBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/cookie/CookieSpecBase.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- CookieSpecBase.java	24 Apr 2004 23:28:04 -0000	1.24
  +++ CookieSpecBase.java	24 Apr 2004 23:51:57 -0000	1.25
  @@ -505,7 +505,7 @@
        * @return true if the paths match
        */
       private static boolean pathMatch(
  -        final String topmostPath, final String path) {
  +        final String path, final String topmostPath) {
               
           boolean match = path.startsWith (topmostPath);
           
  
  
  
  1.11      +5 -5      jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestMethodsRedirectNoHost.java
  
  Index: TestMethodsRedirectNoHost.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestMethodsRedirectNoHost.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- TestMethodsRedirectNoHost.java	22 Feb 2004 18:08:49 -0000	1.10
  +++ TestMethodsRedirectNoHost.java	24 Apr 2004 23:51:57 -0000	1.11
  @@ -243,7 +243,7 @@
                   ++cookiecount;
               }
           }
  -        assertTrue("There can only be one (cookie)", cookiecount == 1);            
  +        assertEquals("There can only be one (cookie)", 1, cookiecount);            
       }
   
   }
  
  
  
  1.3       +14 -8     jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/cookie/TestCookieCompatibilitySpec.java
  
  Index: TestCookieCompatibilitySpec.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/cookie/TestCookieCompatibilitySpec.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestCookieCompatibilitySpec.java	24 Apr 2004 23:28:04 -0000	1.2
  +++ TestCookieCompatibilitySpec.java	24 Apr 2004 23:51:57 -0000	1.3
  @@ -878,8 +878,8 @@
       
       public void testCookieMatch4() throws Exception {
           CookieSpec cookiespec = new CookieSpecBase();
  -        Cookie cookie = new Cookie("host", "name", "value", "/foobar/r", null, false);
  -        assertTrue(cookiespec.match("host", 80, "/foobar/", false, cookie));
  +        Cookie cookie = new Cookie("host", "name", "value", "/", null, false);
  +        assertTrue(cookiespec.match("host", 80, "/foobar", false, cookie));
       }
       
       public void testCookieMismatch1() throws Exception {
  @@ -906,7 +906,13 @@
           assertFalse(cookiespec.match("host", 80, "/foobar/", false, cookie));
       }
       
  -    public void testCookieMismatch5() throws Exception {
  +    public void testCookieMatch5() throws Exception {
  +        CookieSpec cookiespec = new CookieSpecBase();
  +        Cookie cookie = new Cookie("host", "name", "value", "/foobar/r", null, false);
  +        assertFalse(cookiespec.match("host", 80, "/foobar/", false, cookie));
  +    }
  +    
  +    public void testCookieMismatch6() throws Exception {
           CookieSpec cookiespec = new CookieSpecBase();
           Cookie cookie = new Cookie("host", "name", "value", "/foobar", null, true);
           assertFalse(cookiespec.match("host", 80, "/foobar", false, cookie));
  @@ -925,7 +931,7 @@
               new Cookie("host", "name2", "value", "/foobar/yada", null, false),
               new Cookie("host", "name3", "value", "/foobar", null, false),
               new Cookie("host", "name1", "value", "/foobar/yada/yada", null, false)};
  -        Cookie[] matched = cookiespec.match("host", 80, "/foobar", false, cookies);
  +        Cookie[] matched = cookiespec.match("host", 80, "/foobar/yada/yada", false, cookies);
           assertNotNull(matched);
           assertEquals(3, matched.length);
           assertEquals("name1", matched[0].getName());
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message