hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1620939 - in /httpcomponents/httpclient/trunk/httpclient/src: examples/org/apache/http/examples/client/ main/java-deprecated/org/apache/http/impl/cookie/ main/java/org/apache/http/client/config/ main/java/org/apache/http/client/protocol/ m...
Date Wed, 27 Aug 2014 17:07:35 GMT
Author: olegk
Date: Wed Aug 27 17:07:34 2014
New Revision: 1620939

URL: http://svn.apache.org/r1620939
Log:
Replaced BEST_MATCH with DEFAULT policy

Added:
    httpcomponents/httpclient/trunk/httpclient/src/main/java-deprecated/org/apache/http/impl/cookie/BestMatchSpec.java
      - copied, changed from r1620787, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/config/CookieSpecs.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java-deprecated/org/apache/http/impl/cookie/BestMatchSpecFactory.java
  (contents, props changed)
      - copied, changed from r1620787, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BestMatchSpecFactory.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/DefaultCookieSpec.java
  (contents, props changed)
      - copied, changed from r1620787, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BestMatchSpec.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/DefaultCookieSpecProvider.java
      - copied, changed from r1620787, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/config/CookieSpecs.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestDefaultCookieSpec.java
  (contents, props changed)
      - copied, changed from r1620787, httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestCookieBestMatchSpec.java
Removed:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BestMatchSpec.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BestMatchSpecFactory.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestCookieBestMatchSpec.java
Modified:
    httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientConfiguration.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/config/CookieSpecs.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAddCookies.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestAddCookies.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestResponseProcessCookies.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientConfiguration.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientConfiguration.java?rev=1620939&r1=1620938&r2=1620939&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientConfiguration.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientConfiguration.java
Wed Aug 27 17:07:34 2014
@@ -205,7 +205,7 @@ public class ClientConfiguration {
         CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
         // Create global request configuration
         RequestConfig defaultRequestConfig = RequestConfig.custom()
-            .setCookieSpec(CookieSpecs.BEST_MATCH)
+            .setCookieSpec(CookieSpecs.DEFAULT)
             .setExpectContinueEnabled(true)
             .setTargetPreferredAuthSchemes(Arrays.asList(AuthSchemes.NTLM, AuthSchemes.DIGEST))
             .setProxyPreferredAuthSchemes(Arrays.asList(AuthSchemes.BASIC))

Copied: httpcomponents/httpclient/trunk/httpclient/src/main/java-deprecated/org/apache/http/impl/cookie/BestMatchSpec.java
(from r1620787, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/config/CookieSpecs.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java-deprecated/org/apache/http/impl/cookie/BestMatchSpec.java?p2=httpcomponents/httpclient/trunk/httpclient/src/main/java-deprecated/org/apache/http/impl/cookie/BestMatchSpec.java&p1=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/config/CookieSpecs.java&r1=1620787&r2=1620939&rev=1620939&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/config/CookieSpecs.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java-deprecated/org/apache/http/impl/cookie/BestMatchSpec.java
Wed Aug 27 17:07:34 2014
@@ -25,45 +25,33 @@
  *
  */
 
-package org.apache.http.client.config;
+package org.apache.http.impl.cookie;
 
-import org.apache.http.annotation.Immutable;
+import org.apache.http.annotation.ThreadSafe;
 
 /**
- * Standard cookie specifications supported by HttpClient.
+ * 'Meta' cookie specification that picks up a cookie policy based on
+ * the format of cookies sent with the HTTP response.
  *
- * @since 4.3
+ * @deprecated (4.4) use {@link org.apache.http.impl.cookie.DefaultCookieSpec}.
+ *
+ * @since 4.0
  */
-@Immutable
-public final class CookieSpecs {
+@ThreadSafe
+@Deprecated
+public class BestMatchSpec extends DefaultCookieSpec {
+
+    public BestMatchSpec(final String[] datepatterns, final boolean oneHeader) {
+        super(datepatterns, oneHeader);
+    }
 
-    /**
-     * The policy that provides high degree of compatibility
-     * with common cookie management of popular HTTP agents.
-     */
-    public static final String BROWSER_COMPATIBILITY = "compatibility";
-
-    /**
-     * The Netscape cookie draft compliant policy.
-     */
-    public static final String NETSCAPE = "netscape";
-
-    /**
-     * The RFC 2965 compliant policy (standard).
-     */
-    public static final String STANDARD = "standard";
-
-    /**
-     * The default 'best match' policy.
-     */
-    public static final String BEST_MATCH = "best-match";
-
-    /**
-     * The policy that ignores cookies.
-     */
-    public static final String IGNORE_COOKIES = "ignoreCookies";
+    public BestMatchSpec() {
+        this(null, false);
+    }
 
-    private CookieSpecs() {
+    @Override
+    public String toString() {
+        return "best-match";
     }
 
 }

Copied: httpcomponents/httpclient/trunk/httpclient/src/main/java-deprecated/org/apache/http/impl/cookie/BestMatchSpecFactory.java
(from r1620787, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BestMatchSpecFactory.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java-deprecated/org/apache/http/impl/cookie/BestMatchSpecFactory.java?p2=httpcomponents/httpclient/trunk/httpclient/src/main/java-deprecated/org/apache/http/impl/cookie/BestMatchSpecFactory.java&p1=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BestMatchSpecFactory.java&r1=1620787&r2=1620939&rev=1620939&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BestMatchSpecFactory.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java-deprecated/org/apache/http/impl/cookie/BestMatchSpecFactory.java
Wed Aug 27 17:07:34 2014
@@ -42,10 +42,12 @@ import org.apache.http.protocol.HttpCont
  * {@link org.apache.http.impl.cookie.BestMatchSpec}. The instance returned by this factory
can
  * be shared by multiple threads.
  *
+ * @deprecated (4.4) use {@link org.apache.http.impl.cookie.DefaultCookieSpecProvider}.
+ *
  * @since 4.0
  */
 @Immutable
-@SuppressWarnings("deprecation")
+@Deprecated
 public class BestMatchSpecFactory implements CookieSpecFactory, CookieSpecProvider {
 
     private final CookieSpec cookieSpec;

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java-deprecated/org/apache/http/impl/cookie/BestMatchSpecFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java-deprecated/org/apache/http/impl/cookie/BestMatchSpecFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java-deprecated/org/apache/http/impl/cookie/BestMatchSpecFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/config/CookieSpecs.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/config/CookieSpecs.java?rev=1620939&r1=1620938&r2=1620939&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/config/CookieSpecs.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/config/CookieSpecs.java
Wed Aug 27 17:07:34 2014
@@ -55,10 +55,17 @@ public final class CookieSpecs {
 
     /**
      * The default 'best match' policy.
+     * @deprecated (4.4) use {@link #DEFAULT}.
      */
+    @Deprecated
     public static final String BEST_MATCH = "best-match";
 
     /**
+     * The default policy.
+     */
+    public static final String DEFAULT = "default";
+
+    /**
      * The policy that ignores cookies.
      */
     public static final String IGNORE_COOKIES = "ignoreCookies";

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAddCookies.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAddCookies.java?rev=1620939&r1=1620938&r2=1620939&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAddCookies.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/RequestAddCookies.java
Wed Aug 27 17:07:34 2014
@@ -117,7 +117,7 @@ public class RequestAddCookies implement
         final RequestConfig config = clientContext.getRequestConfig();
         String policy = config.getCookieSpec();
         if (policy == null) {
-            policy = CookieSpecs.BEST_MATCH;
+            policy = CookieSpecs.DEFAULT;
         }
         if (this.log.isDebugEnabled()) {
             this.log.debug("CookieSpec selected: " + policy);

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java?rev=1620939&r1=1620938&r2=1620939&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java
Wed Aug 27 17:07:34 2014
@@ -97,8 +97,8 @@ import org.apache.http.impl.conn.Default
 import org.apache.http.impl.conn.DefaultSchemePortResolver;
 import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
 import org.apache.http.impl.conn.SystemDefaultRoutePlanner;
-import org.apache.http.impl.cookie.BestMatchSpecFactory;
 import org.apache.http.impl.cookie.BrowserCompatSpecFactory;
+import org.apache.http.impl.cookie.DefaultCookieSpecProvider;
 import org.apache.http.impl.cookie.IgnoreSpecFactory;
 import org.apache.http.impl.cookie.NetscapeDraftSpecFactory;
 import org.apache.http.impl.cookie.RFC2109SpecFactory;
@@ -1049,7 +1049,7 @@ public class HttpClientBuilder {
         Lookup<CookieSpecProvider> cookieSpecRegistryCopy = this.cookieSpecRegistry;
         if (cookieSpecRegistryCopy == null) {
             cookieSpecRegistryCopy = RegistryBuilder.<CookieSpecProvider>create()
-                .register(CookieSpecs.BEST_MATCH, new BestMatchSpecFactory())
+                .register(CookieSpecs.DEFAULT, new DefaultCookieSpecProvider())
                 .register(CookieSpecs.STANDARD, new RFC2965SpecFactory())
                 .register(CookieSpecs.BROWSER_COMPATIBILITY, new BrowserCompatSpecFactory())
                 .register(CookieSpecs.NETSCAPE, new NetscapeDraftSpecFactory())

Copied: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/DefaultCookieSpec.java
(from r1620787, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BestMatchSpec.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/DefaultCookieSpec.java?p2=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/DefaultCookieSpec.java&p1=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BestMatchSpec.java&r1=1620787&r2=1620939&rev=1620939&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BestMatchSpec.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/DefaultCookieSpec.java
Wed Aug 27 17:07:34 2014
@@ -44,19 +44,19 @@ import org.apache.http.util.Args;
 import org.apache.http.util.CharArrayBuffer;
 
 /**
- * 'Meta' cookie specification that picks up a cookie policy based on
+ * Default cookie specification that picks up the bests matching cookie policy based on
  * the format of cookies sent with the HTTP response.
  *
- * @since 4.0
+ * @since 4.4
  */
 @ThreadSafe
-public class BestMatchSpec implements CookieSpec {
+public class DefaultCookieSpec implements CookieSpec {
 
     private final RFC2965Spec strict;
     private final RFC2109Spec obsoleteStrict;
     private final NetscapeDraftSpec netscapeDraft;
 
-    public BestMatchSpec(final String[] datepatterns, final boolean oneHeader) {
+    public DefaultCookieSpec(final String[] datepatterns, final boolean oneHeader) {
         super();
         this.strict = new RFC2965Spec(oneHeader,
                 new RFC2965VersionAttributeHandler(),
@@ -84,7 +84,7 @@ public class BestMatchSpec implements Co
                         datepatterns != null ? datepatterns.clone() : new String[]{NetscapeDraftSpec.EXPIRES_PATTERN}));
     }
 
-    public BestMatchSpec() {
+    public DefaultCookieSpec() {
         this(null, false);
     }
 
@@ -204,7 +204,7 @@ public class BestMatchSpec implements Co
 
     @Override
     public String toString() {
-        return "best-match";
+        return "default";
     }
 
 }

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/DefaultCookieSpec.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/DefaultCookieSpec.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/DefaultCookieSpec.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/DefaultCookieSpecProvider.java
(from r1620787, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/config/CookieSpecs.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/DefaultCookieSpecProvider.java?p2=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/DefaultCookieSpecProvider.java&p1=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/config/CookieSpecs.java&r1=1620787&r2=1620939&rev=1620939&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/config/CookieSpecs.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/DefaultCookieSpecProvider.java
Wed Aug 27 17:07:34 2014
@@ -25,45 +25,37 @@
  *
  */
 
-package org.apache.http.client.config;
+package org.apache.http.impl.cookie;
 
 import org.apache.http.annotation.Immutable;
+import org.apache.http.cookie.CookieSpec;
+import org.apache.http.cookie.CookieSpecProvider;
+import org.apache.http.protocol.HttpContext;
 
 /**
- * Standard cookie specifications supported by HttpClient.
+ * {@link org.apache.http.cookie.CookieSpecProvider} implementation that provides an instance
of
+ * {@link BestMatchSpec}. The instance returned by this factory can
+ * be shared by multiple threads.
  *
- * @since 4.3
+ * @since 4.4
  */
 @Immutable
-public final class CookieSpecs {
+public class DefaultCookieSpecProvider implements CookieSpecProvider {
 
-    /**
-     * The policy that provides high degree of compatibility
-     * with common cookie management of popular HTTP agents.
-     */
-    public static final String BROWSER_COMPATIBILITY = "compatibility";
-
-    /**
-     * The Netscape cookie draft compliant policy.
-     */
-    public static final String NETSCAPE = "netscape";
-
-    /**
-     * The RFC 2965 compliant policy (standard).
-     */
-    public static final String STANDARD = "standard";
-
-    /**
-     * The default 'best match' policy.
-     */
-    public static final String BEST_MATCH = "best-match";
-
-    /**
-     * The policy that ignores cookies.
-     */
-    public static final String IGNORE_COOKIES = "ignoreCookies";
+    private final CookieSpec cookieSpec;
 
-    private CookieSpecs() {
+    public DefaultCookieSpecProvider(final String[] datepatterns, final boolean oneHeader)
{
+        super();
+        this.cookieSpec = new DefaultCookieSpec(datepatterns, oneHeader);;
+    }
+
+    public DefaultCookieSpecProvider() {
+        this(null, false);
+    }
+
+    @Override
+    public CookieSpec create(final HttpContext context) {
+        return this.cookieSpec;
     }
 
 }

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestAddCookies.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestAddCookies.java?rev=1620939&r1=1620938&r2=1620939&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestAddCookies.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestAddCookies.java
Wed Aug 27 17:07:34 2014
@@ -47,9 +47,9 @@ import org.apache.http.cookie.SM;
 import org.apache.http.impl.client.BasicCookieStore;
 import org.apache.http.impl.cookie.BasicClientCookie;
 import org.apache.http.impl.cookie.BasicClientCookie2;
-import org.apache.http.impl.cookie.BestMatchSpecFactory;
 import org.apache.http.impl.cookie.BrowserCompatSpec;
 import org.apache.http.impl.cookie.BrowserCompatSpecFactory;
+import org.apache.http.impl.cookie.DefaultCookieSpecProvider;
 import org.apache.http.impl.cookie.IgnoreSpecFactory;
 import org.apache.http.impl.cookie.NetscapeDraftSpecFactory;
 import org.apache.http.impl.cookie.RFC2965SpecFactory;
@@ -81,7 +81,7 @@ public class TestRequestAddCookies {
         this.cookieStore.addCookie(cookie2);
 
         this.cookieSpecRegistry = RegistryBuilder.<CookieSpecProvider>create()
-            .register(CookieSpecs.BEST_MATCH, new BestMatchSpecFactory())
+            .register(CookieSpecs.DEFAULT, new DefaultCookieSpecProvider())
             .register(CookieSpecs.STANDARD, new RFC2965SpecFactory())
             .register(CookieSpecs.BROWSER_COMPATIBILITY, new BrowserCompatSpecFactory())
             .register(CookieSpecs.NETSCAPE, new NetscapeDraftSpecFactory())

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestResponseProcessCookies.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestResponseProcessCookies.java?rev=1620939&r1=1620938&r2=1620939&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestResponseProcessCookies.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestResponseProcessCookies.java
Wed Aug 27 17:07:34 2014
@@ -37,7 +37,7 @@ import org.apache.http.cookie.CookieOrig
 import org.apache.http.cookie.CookieSpec;
 import org.apache.http.cookie.SM;
 import org.apache.http.impl.client.BasicCookieStore;
-import org.apache.http.impl.cookie.BestMatchSpec;
+import org.apache.http.impl.cookie.DefaultCookieSpec;
 import org.apache.http.message.BasicHttpResponse;
 import org.junit.Assert;
 import org.junit.Before;
@@ -52,7 +52,7 @@ public class TestResponseProcessCookies 
     @Before
     public void setUp() throws Exception {
         this.cookieOrigin = new CookieOrigin("localhost", 80, "/", false);
-        this.cookieSpec = new BestMatchSpec();
+        this.cookieSpec = new DefaultCookieSpec();
         this.cookieStore = new BasicCookieStore();
     }
 

Copied: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestDefaultCookieSpec.java
(from r1620787, httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestCookieBestMatchSpec.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestDefaultCookieSpec.java?p2=httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestDefaultCookieSpec.java&p1=httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestCookieBestMatchSpec.java&r1=1620787&r2=1620939&rev=1620939&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestCookieBestMatchSpec.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestDefaultCookieSpec.java
Wed Aug 27 17:07:34 2014
@@ -44,11 +44,11 @@ import org.junit.Test;
 /**
  * Test cases for 'best match' cookie policy
  */
-public class TestCookieBestMatchSpec {
+public class TestDefaultCookieSpec {
 
     @Test
     public void testCookieBrowserCompatParsing() throws Exception {
-        final CookieSpec cookiespec = new BestMatchSpec();
+        final CookieSpec cookiespec = new DefaultCookieSpec();
         final CookieOrigin origin = new CookieOrigin("a.b.domain.com", 80, "/", false);
 
         // Make sure the lenient (browser compatible) cookie parsing
@@ -63,7 +63,7 @@ public class TestCookieBestMatchSpec {
 
     @Test
     public void testNetscapeCookieParsing() throws Exception {
-        final CookieSpec cookiespec = new BestMatchSpec();
+        final CookieSpec cookiespec = new DefaultCookieSpec();
         final CookieOrigin origin = new CookieOrigin("myhost.mydomain.com", 80, "/", false);
 
         Header header = new BasicHeader("Set-Cookie",
@@ -80,7 +80,7 @@ public class TestCookieBestMatchSpec {
 
     @Test
     public void testCookieStandardCompliantParsing() throws Exception {
-        final CookieSpec cookiespec = new BestMatchSpec();
+        final CookieSpec cookiespec = new DefaultCookieSpec();
         final CookieOrigin origin = new CookieOrigin("a.b.domain.com", 80, "/", false);
 
         // Make sure the strict (RFC2965) cookie parsing
@@ -113,7 +113,7 @@ public class TestCookieBestMatchSpec {
 
     @Test
     public void testCookieStandardCompliantParsingLocalHost() throws Exception {
-        final CookieSpec cookiespec = new BestMatchSpec();
+        final CookieSpec cookiespec = new DefaultCookieSpec();
         final CookieOrigin origin = new CookieOrigin("localhost", 80, "/", false);
 
         final Header header = new BasicHeader("Set-Cookie", "special=\"abcdigh\"; Version=1");
@@ -129,7 +129,7 @@ public class TestCookieBestMatchSpec {
 
     @Test
     public void testCookieStandardCompliantParsingLocalHost2() throws Exception {
-        final CookieSpec cookiespec = new BestMatchSpec();
+        final CookieSpec cookiespec = new DefaultCookieSpec();
         final CookieOrigin origin = new CookieOrigin("localhost", 80, "/", false);
 
         final Header header = new BasicHeader("Set-Cookie2", "special=\"abcdigh\"; Version=1");
@@ -145,7 +145,7 @@ public class TestCookieBestMatchSpec {
 
     @Test
     public void testCookieBrowserCompatMatch() throws Exception {
-        final CookieSpec cookiespec = new BestMatchSpec();
+        final CookieSpec cookiespec = new DefaultCookieSpec();
         final CookieOrigin origin = new CookieOrigin("a.b.domain.com", 80, "/", false);
 
         // Make sure the lenient (browser compatible) cookie matching
@@ -161,7 +161,7 @@ public class TestCookieBestMatchSpec {
 
     @Test
     public void testCookieStandardCompliantMatch() throws Exception {
-        final CookieSpec cookiespec = new BestMatchSpec();
+        final CookieSpec cookiespec = new DefaultCookieSpec();
         final CookieOrigin origin = new CookieOrigin("a.b.domain.com", 80, "/", false);
 
         // Make sure the strict (RFC2965) cookie matching
@@ -182,7 +182,7 @@ public class TestCookieBestMatchSpec {
 
     @Test
     public void testCookieBrowserCompatFormatting() throws Exception {
-        final CookieSpec cookiespec = new BestMatchSpec();
+        final CookieSpec cookiespec = new DefaultCookieSpec();
 
         // Make sure the lenient (browser compatible) cookie formatting
         // is used for Netscape style cookies
@@ -214,7 +214,7 @@ public class TestCookieBestMatchSpec {
 
     @Test
     public void testCookieStandardCompliantFormatting() throws Exception {
-        final CookieSpec cookiespec = new BestMatchSpec(null, true);
+        final CookieSpec cookiespec = new DefaultCookieSpec(null, true);
 
         // Make sure the strict (RFC2965) cookie formatting
         // is used for Netscape style cookies
@@ -249,7 +249,7 @@ public class TestCookieBestMatchSpec {
 
     @Test
     public void testInvalidInput() throws Exception {
-        final CookieSpec cookiespec = new BestMatchSpec();
+        final CookieSpec cookiespec = new DefaultCookieSpec();
         try {
             cookiespec.parse(null, null);
             Assert.fail("IllegalArgumentException must have been thrown");
@@ -279,7 +279,7 @@ public class TestCookieBestMatchSpec {
 
     @Test
     public void testVersion1CookieWithInvalidExpires() throws Exception {
-        final CookieSpec cookiespec = new BestMatchSpec();
+        final CookieSpec cookiespec = new DefaultCookieSpec();
         final CookieOrigin origin = new CookieOrigin("myhost.mydomain.com", 80, "/", false);
 
         final Header origHeader = new BasicHeader("Set-Cookie",

Propchange: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestDefaultCookieSpec.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestDefaultCookieSpec.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestDefaultCookieSpec.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message