hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r558477 - in /jakarta/httpcomponents/httpclient/trunk/module-client/src: main/java/org/apache/http/cookie/ main/java/org/apache/http/impl/cookie/ test/java/org/apache/http/cookie/ test/java/org/apache/http/impl/cookie/
Date Sun, 22 Jul 2007 12:54:08 GMT
Author: olegk
Date: Sun Jul 22 05:54:07 2007
New Revision: 558477

URL: http://svn.apache.org/viewvc?view=rev&rev=558477
Log:
Made Cookie an interface

Added:
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/BasicCookie.java
      - copied, changed from r558476, jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/Cookie.java
Modified:
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/Cookie.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/CookieSpecBase.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/cookie/TestCookiePathComparator.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestBasicCookieAttribHandlers.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestBrowserCompatSpec.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestCookieNetscapeDraft.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestCookieRFC2109Spec.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestNetscapeCookieAttribHandlers.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestRFC2109CookieAttribHandlers.java

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/Cookie.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/Cookie.java?view=diff&rev=558477&r1=558476&r2=558477
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/Cookie.java (original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/Cookie.java Sun Jul 22 05:54:07 2007
@@ -33,62 +33,30 @@
 
 import java.util.Date;
 
-import org.apache.http.util.CharArrayBuffer;
-
 /**
- * <p>
  * HTTP "magic-cookie" represents a piece of state information
  * that the HTTP agent and the target server can exchange to maintain 
  * a session.
- * </p>
  * 
- * @author B.C. Holmes
- * @author <a href="mailto:jericho@thinkfree.com">Park, Sung-Gu</a>
- * @author <a href="mailto:dsale@us.britannica.com">Doug Sale</a>
- * @author Rod Waldhoff
- * @author dIon Gillard
- * @author Sean C. Sullivan
- * @author <a href="mailto:JEvans@Cyveillance.com">John Evans</a>
- * @author Marc A. Saegesser
  * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
- * @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a>
  * 
- * @version $Revision$
+ * @since 4.0
  */
-public class Cookie {
-
-    /**
-     * Default Constructor taking a name and a value. The value may be null.
-     * 
-     * @param name The name.
-     * @param value The value.
-     */
-    public Cookie(final String name, final String value) {
-        super();
-        if (name == null) {
-            throw new IllegalArgumentException("Name may not be null");
-        }
-        this.name = name;
-        this.value = value;
-    }
+public interface Cookie {
 
     /**
      * Returns the name.
      *
      * @return String name The name
      */
-    public String getName() {
-        return this.name;
-    }
+    String getName();
 
     /**
      * Returns the value.
      *
      * @return String value The current value.
      */
-    public String getValue() {
-        return this.value;
-    }
+    String getValue();
 
     /**
      * Returns the comment describing the purpose of this cookie, or
@@ -98,9 +66,7 @@
      *
      * @see #setComment(String)
      */
-    public String getComment() {
-        return cookieComment;
-    }
+    String getComment();
 
     /**
      * If a user agent (web browser) presents this cookie to a user, the
@@ -110,9 +76,7 @@
      *  
      * @see #getComment()
      */
-    public void setComment(String comment) {
-        cookieComment = comment;
-    }
+    void setComment(String comment);
 
     /**
      * Returns the expiration {@link Date} of the cookie, or <tt>null</tt>
@@ -125,9 +89,7 @@
      * @see #setExpiryDate(java.util.Date)
      *
      */
-    public Date getExpiryDate() {
-        return cookieExpiryDate;
-    }
+    Date getExpiryDate();
 
     /**
      * Sets expiration date.
@@ -140,9 +102,7 @@
      * @see #getExpiryDate
      *
      */
-    public void setExpiryDate (Date expiryDate) {
-        cookieExpiryDate = expiryDate;
-    }
+    void setExpiryDate (Date expiryDate);
 
 
     /**
@@ -152,9 +112,7 @@
      * @return <tt>false</tt> if the cookie should be discarded at the end
      *         of the "session"; <tt>true</tt> otherwise
      */
-    public boolean isPersistent() {
-        return (null != cookieExpiryDate);
-    }
+    boolean isPersistent();
 
 
     /**
@@ -164,9 +122,7 @@
      *
      * @see #setDomain(java.lang.String)
      */
-    public String getDomain() {
-        return cookieDomain;
-    }
+    String getDomain();
 
     /**
      * Sets the domain attribute.
@@ -175,13 +131,7 @@
      *
      * @see #getDomain
      */
-    public void setDomain(String domain) {
-        if (domain != null) {
-            cookieDomain = domain.toLowerCase();
-        } else {
-            cookieDomain = null;
-        }
-    }
+    void setDomain(String domain);
 
 
     /**
@@ -191,9 +141,7 @@
      * 
      * @see #setPath(java.lang.String)
      */
-    public String getPath() {
-        return cookiePath;
-    }
+    String getPath();
 
     /**
      * Sets the path attribute.
@@ -203,17 +151,13 @@
      * @see #getPath
      *
      */
-    public void setPath(String path) {
-        cookiePath = path;
-    }
+    void setPath(String path);
 
     /**
      * @return <code>true</code> if this cookie should only be sent over secure connections.
      * @see #setSecure(boolean)
      */
-    public boolean isSecure() {
-        return isSecure;
-    }
+    boolean isSecure();
 
     /**
      * Sets the secure attribute of the cookie.
@@ -227,9 +171,7 @@
      * 
      * @see #isSecure()
      */
-    public void setSecure (boolean secure) {
-        isSecure = secure;
-    }
+    void setSecure (boolean secure);
 
     /**
      * Returns the version of the cookie specification to which this
@@ -240,9 +182,7 @@
      * @see #setVersion(int)
      *
      */
-    public int getVersion() {
-        return cookieVersion;
-    }
+    int getVersion();
 
     /**
      * Sets the version of the cookie specification to which this
@@ -252,9 +192,7 @@
      * 
      * @see #getVersion
      */
-    public void setVersion(int version) {
-        cookieVersion = version;
-    }
+    void setVersion(int version);
 
     /**
      * Returns true if this cookie has expired.
@@ -262,13 +200,7 @@
      * 
      * @return <tt>true</tt> if the cookie has expired.
      */
-    public boolean isExpired(final Date date) {
-        if (date == null) {
-            throw new IllegalArgumentException("Date may not be null");
-        }
-        return (cookieExpiryDate != null  
-            && cookieExpiryDate.getTime() <= date.getTime());
-    }
+    boolean isExpired(final Date date);
 
     /**
      * Indicates whether the cookie had a path specified in a 
@@ -283,9 +215,7 @@
      * 
      * @see #isPathAttributeSpecified
      */
-    public void setPathAttributeSpecified(boolean value) {
-        hasPathAttribute = value;
-    }
+    public void setPathAttributeSpecified(boolean value);
 
     /**
      * Returns <tt>true</tt> if cookie's path was set via a path attribute
@@ -296,9 +226,7 @@
      * 
      * @see #setPathAttributeSpecified
      */
-    public boolean isPathAttributeSpecified() {
-        return hasPathAttribute;
-    }
+    boolean isPathAttributeSpecified();
 
     /**
      * Indicates whether the cookie had a domain specified in a 
@@ -313,9 +241,7 @@
      *
      * @see #isDomainAttributeSpecified
      */
-    public void setDomainAttributeSpecified(boolean value) {
-        hasDomainAttribute = value;
-    }
+    void setDomainAttributeSpecified(boolean value);
 
     /**
      * Returns <tt>true</tt> if cookie's domain was set via a domain 
@@ -326,69 +252,7 @@
      *
      * @see #setDomainAttributeSpecified
      */
-    public boolean isDomainAttributeSpecified() {
-        return hasDomainAttribute;
-    }
-
-    public String toString() {
-        CharArrayBuffer buffer = new CharArrayBuffer(64);
-        buffer.append("[version: ");
-        buffer.append(Integer.toString(this.cookieVersion));
-        buffer.append("]");
-        buffer.append("[name: ");
-        buffer.append(this.name);
-        buffer.append("]");
-        buffer.append("[name: ");
-        buffer.append(this.value);
-        buffer.append("]");
-        buffer.append("[domain: ");
-        buffer.append(this.cookieDomain);
-        buffer.append("]");
-        buffer.append("[path: ");
-        buffer.append(this.cookiePath);
-        buffer.append("]");
-        buffer.append("[expiry: ");
-        buffer.append(this.cookieExpiryDate);
-        buffer.append("]");
-        return buffer.toString();
-    }
-    
-    
-   // ----------------------------------------------------- Instance Variables
-
-
-    private final String name;
-    private final String value;
-
-   /** Comment attribute. */
-   private String  cookieComment;
-
-   /** Domain attribute. */
-   private String  cookieDomain;
-
-   /** Expiration {@link Date}. */
-   private Date    cookieExpiryDate;
-
-   /** Path attribute. */
-   private String  cookiePath;
-
-   /** My secure flag. */
-   private boolean isSecure;
-
-   /**
-    * Specifies if the set-cookie header included a Path attribute for this
-    * cookie
-    */
-   private boolean hasPathAttribute = false;
-
-   /**
-    * Specifies if the set-cookie header included a Domain attribute for this
-    * cookie
-    */
-   private boolean hasDomainAttribute = false;
-
-   /** The version of the cookie specification I was created from. */
-   private int     cookieVersion = 0;
+    boolean isDomainAttributeSpecified();
 
 }
 

Copied: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/BasicCookie.java (from r558476, jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/Cookie.java)
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/BasicCookie.java?view=diff&rev=558477&p1=jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/Cookie.java&r1=558476&p2=jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/BasicCookie.java&r2=558477
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/Cookie.java (original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/BasicCookie.java Sun Jul 22 05:54:07 2007
@@ -29,10 +29,11 @@
  *
  */
 
-package org.apache.http.cookie;
+package org.apache.http.impl.cookie;
 
 import java.util.Date;
 
+import org.apache.http.cookie.Cookie;
 import org.apache.http.util.CharArrayBuffer;
 
 /**
@@ -55,7 +56,7 @@
  * 
  * @version $Revision$
  */
-public class Cookie {
+public class BasicCookie implements Cookie {
 
     /**
      * Default Constructor taking a name and a value. The value may be null.
@@ -63,7 +64,7 @@
      * @param name The name.
      * @param value The value.
      */
-    public Cookie(final String name, final String value) {
+    public BasicCookie(final String name, final String value) {
         super();
         if (name == null) {
             throw new IllegalArgumentException("Name may not be null");

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/CookieSpecBase.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/CookieSpecBase.java?view=diff&rev=558477&r1=558476&r2=558477
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/CookieSpecBase.java (original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/cookie/CookieSpecBase.java Sun Jul 22 05:54:07 2007
@@ -78,7 +78,7 @@
                 throw new MalformedCookieException("Cookie name may not be empty");
             }
             
-            Cookie cookie = new Cookie(name, value);
+            Cookie cookie = new BasicCookie(name, value);
             cookie.setPath(getDefaultPath(origin));
             cookie.setDomain(getDefaultDomain(origin));
             

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/cookie/TestCookiePathComparator.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/cookie/TestCookiePathComparator.java?view=diff&rev=558477&r1=558476&r2=558477
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/cookie/TestCookiePathComparator.java (original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/cookie/TestCookiePathComparator.java Sun Jul 22 05:54:07 2007
@@ -32,6 +32,8 @@
 
 import java.util.Comparator;
 
+import org.apache.http.impl.cookie.BasicCookie;
+
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
@@ -55,9 +57,9 @@
     }
 
     public void testUnequality1() {
-        Cookie cookie1 = new Cookie("name1", "value");
+        Cookie cookie1 = new BasicCookie("name1", "value");
         cookie1.setPath("/a/b/");
-        Cookie cookie2 = new Cookie("name1", "value");
+        Cookie cookie2 = new BasicCookie("name1", "value");
         cookie2.setPath("/a/");
         Comparator comparator = new CookiePathComparator();
         assertTrue(comparator.compare(cookie1, cookie2) < 0);
@@ -65,9 +67,9 @@
     }
 
     public void testUnequality2() {
-        Cookie cookie1 = new Cookie("name1", "value");
+        Cookie cookie1 = new BasicCookie("name1", "value");
         cookie1.setPath("/a/b");
-        Cookie cookie2 = new Cookie("name1", "value");
+        Cookie cookie2 = new BasicCookie("name1", "value");
         cookie2.setPath("/a");
         Comparator comparator = new CookiePathComparator();
         assertTrue(comparator.compare(cookie1, cookie2) < 0);
@@ -75,9 +77,9 @@
     }
 
     public void testEquality1() {
-        Cookie cookie1 = new Cookie("name1", "value");
+        Cookie cookie1 = new BasicCookie("name1", "value");
         cookie1.setPath("/a");
-        Cookie cookie2 = new Cookie("name1", "value");
+        Cookie cookie2 = new BasicCookie("name1", "value");
         cookie2.setPath("/a");
         Comparator comparator = new CookiePathComparator();
         assertTrue(comparator.compare(cookie1, cookie2) == 0);
@@ -85,9 +87,9 @@
     }
 
     public void testEquality2() {
-        Cookie cookie1 = new Cookie("name1", "value");
+        Cookie cookie1 = new BasicCookie("name1", "value");
         cookie1.setPath("/a/");
-        Cookie cookie2 = new Cookie("name1", "value");
+        Cookie cookie2 = new BasicCookie("name1", "value");
         cookie2.setPath("/a");
         Comparator comparator = new CookiePathComparator();
         assertTrue(comparator.compare(cookie1, cookie2) == 0);
@@ -95,9 +97,9 @@
     }
 
     public void testEquality3() {
-        Cookie cookie1 = new Cookie("name1", "value");
+        Cookie cookie1 = new BasicCookie("name1", "value");
         cookie1.setPath(null);
-        Cookie cookie2 = new Cookie("name1", "value");
+        Cookie cookie2 = new BasicCookie("name1", "value");
         cookie2.setPath("/");
         Comparator comparator = new CookiePathComparator();
         assertTrue(comparator.compare(cookie1, cookie2) == 0);
@@ -105,9 +107,9 @@
     }
 
     public void testEquality4() {
-        Cookie cookie1 = new Cookie("name1", "value");
+        Cookie cookie1 = new BasicCookie("name1", "value");
         cookie1.setPath("/this");
-        Cookie cookie2 = new Cookie("name1", "value");
+        Cookie cookie2 = new BasicCookie("name1", "value");
         cookie2.setPath("/that");
         Comparator comparator = new CookiePathComparator();
         assertTrue(comparator.compare(cookie1, cookie2) == 0);

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestBasicCookieAttribHandlers.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestBasicCookieAttribHandlers.java?view=diff&rev=558477&r1=558476&r2=558477
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestBasicCookieAttribHandlers.java (original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestBasicCookieAttribHandlers.java Sun Jul 22 05:54:07 2007
@@ -62,7 +62,7 @@
     }
 
     public void testBasicDomainParse() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieAttributeHandler h = new BasicDomainHandler();
         h.parse(cookie, "www.somedomain.com");
         assertEquals("www.somedomain.com", cookie.getDomain());
@@ -70,7 +70,7 @@
     }
 
     public void testBasicDomainParseInvalid() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieAttributeHandler h = new BasicDomainHandler();
         try {
             h.parse(cookie, "");
@@ -87,7 +87,7 @@
     }
 
     public void testBasicDomainValidate1() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieOrigin origin = new CookieOrigin("www.somedomain.com", 80, "/", false); 
         CookieAttributeHandler h = new BasicDomainHandler();
         
@@ -111,7 +111,7 @@
     }
 
     public void testBasicDomainValidate2() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieOrigin origin = new CookieOrigin("somehost", 80, "/", false); 
         CookieAttributeHandler h = new BasicDomainHandler();
         
@@ -128,7 +128,7 @@
     }
 
     public void testBasicDomainValidate3() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieOrigin origin = new CookieOrigin("somedomain.com", 80, "/", false); 
         CookieAttributeHandler h = new BasicDomainHandler();
         
@@ -137,7 +137,7 @@
     }
 
     public void testBasicDomainValidate4() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieOrigin origin = new CookieOrigin("somedomain.com", 80, "/", false); 
         CookieAttributeHandler h = new BasicDomainHandler();
         
@@ -151,7 +151,7 @@
     }
     
     public void testBasicDomainMatch1() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieOrigin origin = new CookieOrigin("somedomain.com", 80, "/", false); 
         CookieAttributeHandler h = new BasicDomainHandler();
 
@@ -163,7 +163,7 @@
     }
 
     public void testBasicDomainMatch2() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieOrigin origin = new CookieOrigin("www.somedomain.com", 80, "/", false); 
         CookieAttributeHandler h = new BasicDomainHandler();
 
@@ -192,7 +192,7 @@
             // expected
         }
         try {
-            h.validate(new Cookie("name", "value"), null);
+            h.validate(new BasicCookie("name", "value"), null);
             fail("IllegalArgumentException must have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
@@ -204,7 +204,7 @@
             // expected
         }
         try {
-            h.match(new Cookie("name", "value"), null);
+            h.match(new BasicCookie("name", "value"), null);
             fail("IllegalArgumentException must have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
@@ -212,7 +212,7 @@
     }
 
     public void testBasicPathParse() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieAttributeHandler h = new BasicPathHandler();
         h.parse(cookie, "stuff");
         assertEquals("stuff", cookie.getPath());
@@ -226,7 +226,7 @@
     }
 
     public void testBasicPathMatch1() throws Exception {
-        Cookie cookie = new Cookie("name", "value");
+        Cookie cookie = new BasicCookie("name", "value");
         CookieOrigin origin = new CookieOrigin("somehost", 80, "/stuff", false); 
         CookieAttributeHandler h = new BasicPathHandler();
         cookie.setPath("/stuff");
@@ -234,7 +234,7 @@
     }
     
     public void testBasicPathMatch2() throws Exception {
-        Cookie cookie = new Cookie("name", "value");
+        Cookie cookie = new BasicCookie("name", "value");
         CookieOrigin origin = new CookieOrigin("somehost", 80, "/stuff/", false); 
         CookieAttributeHandler h = new BasicPathHandler();
         cookie.setPath("/stuff");
@@ -242,7 +242,7 @@
     }
     
     public void testBasicPathMatch3() throws Exception {
-        Cookie cookie = new Cookie("name", "value");
+        Cookie cookie = new BasicCookie("name", "value");
         CookieOrigin origin = new CookieOrigin("somehost", 80, "/stuff/more-stuff", false); 
         CookieAttributeHandler h = new BasicPathHandler();
         cookie.setPath("/stuff");
@@ -250,7 +250,7 @@
     }
     
     public void testBasicPathMatch4() throws Exception {
-        Cookie cookie = new Cookie("name", "value");
+        Cookie cookie = new BasicCookie("name", "value");
         CookieOrigin origin = new CookieOrigin("somehost", 80, "/stuffed", false); 
         CookieAttributeHandler h = new BasicPathHandler();
         cookie.setPath("/stuff");
@@ -258,7 +258,7 @@
     }
 
     public void testBasicPathMatch5() throws Exception {
-        Cookie cookie = new Cookie("name", "value");
+        Cookie cookie = new BasicCookie("name", "value");
         CookieOrigin origin = new CookieOrigin("somehost", 80, "/otherstuff", false); 
         CookieAttributeHandler h = new BasicPathHandler();
         cookie.setPath("/stuff");
@@ -266,7 +266,7 @@
     }
 
     public void testBasicPathMatch6() throws Exception {
-        Cookie cookie = new Cookie("name", "value");
+        Cookie cookie = new BasicCookie("name", "value");
         CookieOrigin origin = new CookieOrigin("somehost", 80, "/stuff", false); 
         CookieAttributeHandler h = new BasicPathHandler();
         cookie.setPath("/stuff/");
@@ -274,14 +274,14 @@
     }
 
     public void testBasicPathMatch7() throws Exception {
-        Cookie cookie = new Cookie("name", "value");
+        Cookie cookie = new BasicCookie("name", "value");
         CookieOrigin origin = new CookieOrigin("somehost", 80, "/stuff", false); 
         CookieAttributeHandler h = new BasicPathHandler();
         assertTrue(h.match(cookie, origin));
     }
 
     public void testBasicPathValidate() throws Exception {
-        Cookie cookie = new Cookie("name", "value");
+        Cookie cookie = new BasicCookie("name", "value");
         CookieOrigin origin = new CookieOrigin("somehost", 80, "/stuff", false); 
         CookieAttributeHandler h = new BasicPathHandler();
         cookie.setPath("/stuff");
@@ -310,7 +310,7 @@
             // expected
         }
         try {
-            h.match(new Cookie("name", "value"), null);
+            h.match(new BasicCookie("name", "value"), null);
             fail("IllegalArgumentException must have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
@@ -318,14 +318,14 @@
     }
 
     public void testBasicMaxAgeParse() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieAttributeHandler h = new BasicMaxAgeHandler();
         h.parse(cookie, "2000");
         assertNotNull(cookie.getExpiryDate());
     }
 
     public void testBasicMaxAgeParseInvalid() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieAttributeHandler h = new BasicMaxAgeHandler();
         try {
             h.parse(cookie, "garbage");
@@ -352,7 +352,7 @@
     }
 
     public void testBasicCommentParse() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieAttributeHandler h = new BasicCommentHandler();
         h.parse(cookie, "whatever");
         assertEquals("whatever", cookie.getComment());
@@ -371,7 +371,7 @@
     }
     
     public void testBasicSecureParse() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieAttributeHandler h = new BasicSecureHandler();
         h.parse(cookie, "whatever");
         assertTrue(cookie.isSecure());
@@ -380,7 +380,7 @@
     }
 
     public void testBasicSecureMatch() throws Exception {
-        Cookie cookie = new Cookie("name", "value");
+        Cookie cookie = new BasicCookie("name", "value");
         CookieAttributeHandler h = new BasicSecureHandler();
 
         CookieOrigin origin1 = new CookieOrigin("somehost", 80, "/stuff", false); 
@@ -411,7 +411,7 @@
             // expected
         }
         try {
-            h.match(new Cookie("name", "value"), null);
+            h.match(new BasicCookie("name", "value"), null);
             fail("IllegalArgumentException must have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
@@ -419,7 +419,7 @@
     }
 
     public void testBasicExpiresParse() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieAttributeHandler h = new BasicExpiresHandler(new String[] {DateUtils.PATTERN_RFC1123});
         
         DateFormat dateformat = new SimpleDateFormat(DateUtils.PATTERN_RFC1123, Locale.US);
@@ -432,7 +432,7 @@
     }
     
     public void testBasicExpiresParseInvalid() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieAttributeHandler h = new BasicExpiresHandler(new String[] {DateUtils.PATTERN_RFC1123});
         try {
             h.parse(cookie, "garbage");

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestBrowserCompatSpec.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestBrowserCompatSpec.java?view=diff&rev=558477&r1=558476&r2=558477
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestBrowserCompatSpec.java (original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestBrowserCompatSpec.java Sun Jul 22 05:54:07 2007
@@ -658,7 +658,7 @@
      * browser compatibility mode.
      */
     public void testSecondDomainLevelCookie() throws Exception {
-        Cookie cookie = new Cookie("name", null);
+        Cookie cookie = new BasicCookie("name", null);
         cookie.setDomain(".sourceforge.net");
         cookie.setDomainAttributeSpecified(true);
         cookie.setPath("/");
@@ -670,7 +670,7 @@
     }
 
     public void testSecondDomainLevelCookieMatch1() throws Exception {
-        Cookie cookie = new Cookie("name", null);
+        Cookie cookie = new BasicCookie("name", null);
         cookie.setDomain(".sourceforge.net");
         cookie.setDomainAttributeSpecified(true);
         cookie.setPath("/");
@@ -682,7 +682,7 @@
     }
 
     public void testSecondDomainLevelCookieMatch2() throws Exception {
-        Cookie cookie = new Cookie("name", null);
+        Cookie cookie = new BasicCookie("name", null);
         cookie.setDomain("sourceforge.net");
         cookie.setDomainAttributeSpecified(true);
         cookie.setPath("/");
@@ -694,7 +694,7 @@
     }
 
     public void testSecondDomainLevelCookieMatch3() throws Exception {
-        Cookie cookie = new Cookie("name", null);
+        Cookie cookie = new BasicCookie("name", null);
         cookie.setDomain(".sourceforge.net");
         cookie.setDomainAttributeSpecified(true);
         cookie.setPath("/");
@@ -706,7 +706,7 @@
     }
          
     public void testInvalidSecondDomainLevelCookieMatch1() throws Exception {
-        Cookie cookie = new Cookie("name", null);
+        Cookie cookie = new BasicCookie("name", null);
         cookie.setDomain(".sourceforge.net");
         cookie.setDomainAttributeSpecified(true);
         cookie.setPath("/");
@@ -718,7 +718,7 @@
     }
 
     public void testInvalidSecondDomainLevelCookieMatch2() throws Exception {
-        Cookie cookie = new Cookie("name", null);
+        Cookie cookie = new BasicCookie("name", null);
         cookie.setDomain("sourceforge.net");
         cookie.setDomainAttributeSpecified(true);
         cookie.setPath("/");
@@ -731,7 +731,7 @@
 
     public void testMatchBlankPath() throws Exception {
         CookieSpec cookiespec = new BrowserCompatSpec();
-        Cookie cookie = new Cookie("name", "value");
+        Cookie cookie = new BasicCookie("name", "value");
         cookie.setDomain("host");
         cookie.setPath("/");
         CookieOrigin origin = new CookieOrigin("host", 80, "  ", false);
@@ -740,7 +740,7 @@
 
     public void testMatchNullCookieDomain() throws Exception {
         CookieSpec cookiespec = new BrowserCompatSpec();
-        Cookie cookie = new Cookie("name", "value");
+        Cookie cookie = new BasicCookie("name", "value");
         cookie.setPath("/");
         CookieOrigin origin = new CookieOrigin("host", 80, "/", false);
         assertFalse(cookiespec.match(cookie, origin));
@@ -748,7 +748,7 @@
 
     public void testMatchNullCookiePath() throws Exception {
         CookieSpec cookiespec = new BrowserCompatSpec();
-        Cookie cookie = new Cookie("name", "value");
+        Cookie cookie = new BasicCookie("name", "value");
         cookie.setDomain("host");
         CookieOrigin origin = new CookieOrigin("host", 80, "/", false);
         assertTrue(cookiespec.match(cookie, origin));
@@ -756,7 +756,7 @@
     
     public void testCookieMatch1() throws Exception {
         CookieSpec cookiespec = new BrowserCompatSpec();
-        Cookie cookie = new Cookie("name", "value");
+        Cookie cookie = new BasicCookie("name", "value");
         cookie.setDomain("host");
         cookie.setPath("/");
         CookieOrigin origin = new CookieOrigin("host", 80, "/", false);
@@ -765,7 +765,7 @@
     
     public void testCookieMatch2() throws Exception {
         CookieSpec cookiespec = new BrowserCompatSpec();
-        Cookie cookie = new Cookie("name", "value");
+        Cookie cookie = new BasicCookie("name", "value");
         cookie.setDomain(".whatever.com");
         cookie.setPath("/");
         CookieOrigin origin = new CookieOrigin(".whatever.com", 80, "/", false);
@@ -774,7 +774,7 @@
     
     public void testCookieMatch3() throws Exception {
         CookieSpec cookiespec = new BrowserCompatSpec();
-        Cookie cookie = new Cookie("name", "value");
+        Cookie cookie = new BasicCookie("name", "value");
         cookie.setDomain(".whatever.com");
         cookie.setPath("/");
         CookieOrigin origin = new CookieOrigin(".really.whatever.com", 80, "/", false);
@@ -783,7 +783,7 @@
     
     public void testCookieMatch4() throws Exception {
         CookieSpec cookiespec = new BrowserCompatSpec();
-        Cookie cookie = new Cookie("name", "value");
+        Cookie cookie = new BasicCookie("name", "value");
         cookie.setDomain("host");
         cookie.setPath("/");
         CookieOrigin origin = new CookieOrigin("host", 80, "/foobar", false);
@@ -792,7 +792,7 @@
     
     public void testCookieMismatch1() throws Exception {
         CookieSpec cookiespec = new BrowserCompatSpec();
-        Cookie cookie = new Cookie("name", "value");
+        Cookie cookie = new BasicCookie("name", "value");
         cookie.setDomain("host1");
         cookie.setPath("/");
         CookieOrigin origin = new CookieOrigin("host2", 80, "/", false);
@@ -801,7 +801,7 @@
     
     public void testCookieMismatch2() throws Exception {
         CookieSpec cookiespec = new BrowserCompatSpec();
-        Cookie cookie = new Cookie("name", "value");
+        Cookie cookie = new BasicCookie("name", "value");
         cookie.setDomain(".aaaaaaaaa.com");
         cookie.setPath("/");
         CookieOrigin origin = new CookieOrigin(".bbbbbbbb.com", 80, "/", false);
@@ -810,7 +810,7 @@
     
     public void testCookieMismatch3() throws Exception {
         CookieSpec cookiespec = new BrowserCompatSpec();
-        Cookie cookie = new Cookie("name", "value");
+        Cookie cookie = new BasicCookie("name", "value");
         cookie.setDomain("host");
         cookie.setPath("/foobar");
         CookieOrigin origin = new CookieOrigin("host", 80, "/foo", false);
@@ -819,7 +819,7 @@
     
     public void testCookieMismatch4() throws Exception {
         CookieSpec cookiespec = new BrowserCompatSpec();
-        Cookie cookie = new Cookie("name", "value");
+        Cookie cookie = new BasicCookie("name", "value");
         cookie.setDomain("host");
         cookie.setPath("/foobar");
         CookieOrigin origin = new CookieOrigin("host", 80, "/foobar/", false);
@@ -828,7 +828,7 @@
     
     public void testCookieMatch5() throws Exception {
         CookieSpec cookiespec = new BrowserCompatSpec();
-        Cookie cookie = new Cookie("name", "value");
+        Cookie cookie = new BasicCookie("name", "value");
         cookie.setDomain("host");
         cookie.setPath("/foobar/r");
         CookieOrigin origin = new CookieOrigin("host", 80, "/foobar/", false);
@@ -837,7 +837,7 @@
     
     public void testCookieMismatch6() throws Exception {
         CookieSpec cookiespec = new BrowserCompatSpec();
-        Cookie cookie = new Cookie("name", "value");
+        Cookie cookie = new BasicCookie("name", "value");
         cookie.setDomain("host");
         cookie.setPath("/foobar");
         cookie.setSecure(true);
@@ -846,7 +846,7 @@
     }
     
     public void testInvalidMatchDomain() throws Exception {
-        Cookie cookie = new Cookie("name", null); 
+        Cookie cookie = new BasicCookie("name", null); 
         cookie.setDomain("beta.gamma.com");
         cookie.setDomainAttributeSpecified(true);
         cookie.setPath("/");
@@ -878,14 +878,14 @@
      * Tests if null cookie values are handled correctly.
      */
     public void testNullCookieValueFormatting() {
-        Cookie cookie = new Cookie("name", null);
+        Cookie cookie = new BasicCookie("name", null);
         cookie.setDomain(".whatever.com");
         cookie.setDomainAttributeSpecified(true);
         cookie.setPath("/");
         cookie.setPathAttributeSpecified(true);
 
         CookieSpec cookiespec = new BrowserCompatSpec();
-        Header[] headers = cookiespec.formatCookies(new Cookie[]{cookie});
+        Header[] headers = cookiespec.formatCookies(new Cookie[]{ cookie });
         assertNotNull(headers);
         assertEquals(1, headers.length);
         assertEquals("name=", headers[0].getValue());
@@ -933,7 +933,7 @@
             // expected
         }
         try {
-            cookiespec.validate(new Cookie("name", null), null);
+            cookiespec.validate(new BasicCookie("name", null), null);
             fail("IllegalArgumentException must have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
@@ -945,7 +945,7 @@
             // expected
         }
         try {
-            cookiespec.match(new Cookie("name", null), null);
+            cookiespec.match(new BasicCookie("name", null), null);
             fail("IllegalArgumentException must have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
@@ -957,7 +957,7 @@
             // expected
         }
         try {
-            cookiespec.formatCookies(new Cookie[] {});
+            cookiespec.formatCookies(new BasicCookie[] {});
             fail("IllegalArgumentException must have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestCookieNetscapeDraft.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestCookieNetscapeDraft.java?view=diff&rev=558477&r1=558476&r2=558477
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestCookieNetscapeDraft.java (original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestCookieNetscapeDraft.java Sun Jul 22 05:54:07 2007
@@ -209,14 +209,14 @@
     }
  
     public void testFormatCookies() throws Exception {
-        Cookie c1 = new Cookie("name1", "value1");
+        Cookie c1 = new BasicCookie("name1", "value1");
         c1.setDomain(".whatever.com");
         c1.setDomainAttributeSpecified(true);
         c1.setPath("/");
         c1.setPathAttributeSpecified(true);
 
-        Cookie c2 = new Cookie("name2", "value2");
-        Cookie c3 = new Cookie("name3", null);
+        Cookie c2 = new BasicCookie("name2", "value2");
+        Cookie c3 = new BasicCookie("name3", null);
         
         CookieSpec cookiespec = new NetscapeDraftSpec();
         Header[] headers = cookiespec.formatCookies(new Cookie[] {c1, c2, c3});
@@ -246,7 +246,7 @@
             // expected
         }
         try {
-            cookiespec.formatCookies(new Cookie[] {});
+            cookiespec.formatCookies(new BasicCookie[] {});
             fail("IllegalArgumentException must have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestCookieRFC2109Spec.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestCookieRFC2109Spec.java?view=diff&rev=558477&r1=558476&r2=558477
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestCookieRFC2109Spec.java (original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestCookieRFC2109Spec.java Sun Jul 22 05:54:07 2007
@@ -169,7 +169,7 @@
      * browser compatibility mode.
      */
     public void testSecondDomainLevelCookie() throws Exception {
-        Cookie cookie = new Cookie("name", null);
+        Cookie cookie = new BasicCookie("name", null);
         cookie.setDomain(".sourceforge.net");
         cookie.setPath("/");
         cookie.setDomainAttributeSpecified(true);
@@ -186,7 +186,7 @@
     }    
 
     public void testSecondDomainLevelCookieMatch() throws Exception {
-        Cookie cookie = new Cookie("name", null);
+        Cookie cookie = new BasicCookie("name", null);
         cookie.setDomain(".sourceforge.net");
         cookie.setPath("/");
         cookie.setDomainAttributeSpecified(true);
@@ -361,7 +361,7 @@
      * Tests if null cookie values are handled correctly.
      */
     public void testNullCookieValueFormatting() {
-        Cookie cookie = new Cookie("name", null);
+        Cookie cookie = new BasicCookie("name", null);
         cookie.setDomain(".whatever.com");
         cookie.setPath("/");
         cookie.setDomainAttributeSpecified(true);
@@ -383,7 +383,7 @@
     }
 
     public void testCookieNullDomainNullPathFormatting() {
-        Cookie cookie = new Cookie("name", null); 
+        Cookie cookie = new BasicCookie("name", null); 
         cookie.setDomainAttributeSpecified(true);
         cookie.setPath("/");
         cookie.setPathAttributeSpecified(true);
@@ -403,16 +403,16 @@
     }
 
     public void testCookieOrderingByPath() {
-        Cookie c1 = new Cookie("name1", "value1");
+        Cookie c1 = new BasicCookie("name1", "value1");
         c1.setPath("/a/b/c");
         c1.setPathAttributeSpecified(true);
-        Cookie c2 = new Cookie("name2", "value2");
+        Cookie c2 = new BasicCookie("name2", "value2");
         c2.setPath("/a/b");
         c2.setPathAttributeSpecified(true);
-        Cookie c3 = new Cookie("name3", "value3");
+        Cookie c3 = new BasicCookie("name3", "value3");
         c3.setPath("/a");
         c3.setPathAttributeSpecified(true);
-        Cookie c4 = new Cookie("name4", "value4");
+        Cookie c4 = new BasicCookie("name4", "value4");
         c4.setPath("/");
         c4.setPathAttributeSpecified(true);
 
@@ -453,7 +453,7 @@
             // expected
         }
         try {
-            cookiespec.formatCookies(new Cookie[] {});
+            cookiespec.formatCookies(new BasicCookie[] {});
             fail("IllegalArgumentException must have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestNetscapeCookieAttribHandlers.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestNetscapeCookieAttribHandlers.java?view=diff&rev=558477&r1=558476&r2=558477
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestNetscapeCookieAttribHandlers.java (original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestNetscapeCookieAttribHandlers.java Sun Jul 22 05:54:07 2007
@@ -56,7 +56,7 @@
     }
 
     public void testNetscapeDomainValidate1() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieOrigin origin = new CookieOrigin("somehost", 80, "/", false); 
         CookieAttributeHandler h = new NetscapeDomainHandler();
         
@@ -73,7 +73,7 @@
     }
 
     public void testNetscapeDomainValidate2() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieOrigin origin = new CookieOrigin("www.somedomain.com", 80, "/", false); 
         CookieAttributeHandler h = new NetscapeDomainHandler();
         
@@ -97,7 +97,7 @@
     }
 
     public void testNetscapeDomainValidate3() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieOrigin origin = new CookieOrigin("www.a.com", 80, "/", false); 
         CookieAttributeHandler h = new NetscapeDomainHandler();
         
@@ -114,7 +114,7 @@
     }
 
     public void testNetscapeDomainValidate4() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieOrigin origin = new CookieOrigin("www.a.b.c", 80, "/", false); 
         CookieAttributeHandler h = new NetscapeDomainHandler();
         
@@ -131,7 +131,7 @@
     }
     
     public void testNetscapeDomainMatch1() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieOrigin origin = new CookieOrigin("www.somedomain.com", 80, "/", false); 
         CookieAttributeHandler h = new NetscapeDomainHandler();
 
@@ -143,7 +143,7 @@
     }
 
     public void testNetscapeDomainMatch2() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieOrigin origin = new CookieOrigin("www.whatever.somedomain.com", 80, "/", false); 
         CookieAttributeHandler h = new NetscapeDomainHandler();
 
@@ -160,7 +160,7 @@
             // expected
         }
         try {
-            h.match(new Cookie("name", "value"), null);
+            h.match(new BasicCookie("name", "value"), null);
             fail("IllegalArgumentException must have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestRFC2109CookieAttribHandlers.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestRFC2109CookieAttribHandlers.java?view=diff&rev=558477&r1=558476&r2=558477
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestRFC2109CookieAttribHandlers.java (original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/cookie/TestRFC2109CookieAttribHandlers.java Sun Jul 22 05:54:07 2007
@@ -56,7 +56,7 @@
     }
 
     public void testRFC2109DomainParse() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieAttributeHandler h = new RFC2109DomainHandler();
         
         h.parse(cookie, "somehost");
@@ -77,7 +77,7 @@
     }
 
     public void testRFC2109DomainValidate1() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieOrigin origin = new CookieOrigin("somehost", 80, "/", false); 
         CookieAttributeHandler h = new RFC2109DomainHandler();
         
@@ -101,7 +101,7 @@
     }
 
     public void testRFC2109DomainValidate2() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieOrigin origin = new CookieOrigin("www.somedomain.com", 80, "/", false); 
         CookieAttributeHandler h = new RFC2109DomainHandler();
         
@@ -125,7 +125,7 @@
     }
 
     public void testRFC2109DomainValidate3() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieOrigin origin = new CookieOrigin("www.a.com", 80, "/", false); 
         CookieAttributeHandler h = new RFC2109DomainHandler();
         
@@ -142,7 +142,7 @@
     }
 
     public void testRFC2109DomainValidate4() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieOrigin origin = new CookieOrigin("www.a.b.c", 80, "/", false); 
         CookieAttributeHandler h = new RFC2109DomainHandler();
         
@@ -166,7 +166,7 @@
     }
     
     public void testRFC2109DomainMatch1() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieOrigin origin = new CookieOrigin("www.somedomain.com", 80, "/", false); 
         CookieAttributeHandler h = new RFC2109DomainHandler();
 
@@ -178,7 +178,7 @@
     }
 
     public void testRFC2109DomainMatch2() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieOrigin origin = new CookieOrigin("www.whatever.somedomain.com", 80, "/", false); 
         CookieAttributeHandler h = new RFC2109DomainHandler();
 
@@ -187,7 +187,7 @@
     }
 
     public void testRFC2109DomainMatch3() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieOrigin origin = new CookieOrigin("somedomain.com", 80, "/", false); 
         CookieAttributeHandler h = new RFC2109DomainHandler();
 
@@ -196,7 +196,7 @@
     }
 
     public void testRFC2109DomainMatch4() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieOrigin origin = new CookieOrigin("www.somedomain.com", 80, "/", false); 
         CookieAttributeHandler h = new RFC2109DomainHandler();
 
@@ -219,7 +219,7 @@
             // expected
         }
         try {
-            h.validate(new Cookie("name", "value"), null);
+            h.validate(new BasicCookie("name", "value"), null);
             fail("IllegalArgumentException must have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
@@ -231,7 +231,7 @@
             // expected
         }
         try {
-            h.match(new Cookie("name", "value"), null);
+            h.match(new BasicCookie("name", "value"), null);
             fail("IllegalArgumentException must have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
@@ -239,14 +239,14 @@
     }
  
     public void testRFC2109VersionParse() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieAttributeHandler h = new RFC2109VersionHandler();
         h.parse(cookie, "12");
         assertEquals(12, cookie.getVersion());
     }
 
     public void testRFC2109VersionParseInvalid() throws Exception {
-        Cookie cookie = new Cookie("name", "value"); 
+        Cookie cookie = new BasicCookie("name", "value"); 
         CookieAttributeHandler h = new RFC2109VersionHandler();
         try {
             h.parse(cookie, "garbage");
@@ -269,7 +269,7 @@
     }
 
     public void testRFC2109VersionValidate() throws Exception {
-        Cookie cookie = new Cookie("name", "value");
+        Cookie cookie = new BasicCookie("name", "value");
         CookieOrigin origin = new CookieOrigin("somedomain.com", 80, "/", false); 
         CookieAttributeHandler h = new RFC2109VersionHandler();
 



Mime
View raw message