hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1463938 [1/2] - in /httpcomponents/httpclient/trunk: httpclient-cache/src/main/java/org/apache/http/impl/client/cache/ httpclient/src/main/java/org/apache/http/client/methods/ httpclient/src/main/java/org/apache/http/client/protocol/ httpc...
Date Wed, 03 Apr 2013 11:56:35 GMT
Author: olegk
Date: Wed Apr  3 11:56:34 2013
New Revision: 1463938

URL: http://svn.apache.org/r1463938
Log:
Deprecated ClientContext; removed references to deprecated methods

Modified:
    httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingExec.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/methods/HttpRequestWrapper.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/ClientContext.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/HttpClientContext.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/auth/GGSSchemeBase.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpRequestRetryHandler.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRedirectStrategy.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/HttpClientConnectionOperator.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MinimalClientExec.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/TestRequestAuthCache.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestClientConnControl.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestExpectContinue.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestResponseProcessCookies.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestAuthenticationStrategy.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestDefaultHttpRequestRetryHandler.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestDefaultRedirectStrategy.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestAbortHandling.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthentication.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientReauthentication.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientRequestExecution.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestConnectionAutoRelease.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestConnectionManagement.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestCookie2Support.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestCookieVirtualHost.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestRedirects.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestStatefulConnManagement.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestHttpAuthenticator.java
    httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestProtocolExec.java

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingExec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingExec.java?rev=1463938&r1=1463937&r2=1463938&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingExec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/main/java/org/apache/http/impl/client/cache/CachingExec.java Wed Apr  3 11:56:34 2013
@@ -56,14 +56,12 @@ import org.apache.http.client.cache.Reso
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpExecutionAware;
 import org.apache.http.client.methods.HttpRequestWrapper;
-import org.apache.http.client.protocol.ClientContext;
 import org.apache.http.client.protocol.HttpClientContext;
 import org.apache.http.conn.routing.HttpRoute;
 import org.apache.http.impl.cookie.DateParseException;
 import org.apache.http.impl.cookie.DateUtils;
 import org.apache.http.impl.execchain.ClientExecChain;
 import org.apache.http.message.BasicHttpResponse;
-import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HTTP;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.util.Args;
@@ -291,11 +289,11 @@ public class CachingExec implements Clie
             log.debug("Cache entry not usable; calling backend");
             return callBackend(route, request, context, execAware);
         }
-        context.setAttribute(ClientContext.ROUTE, route);
-        context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, target);
-        context.setAttribute(ExecutionContext.HTTP_REQUEST, request);
-        context.setAttribute(ExecutionContext.HTTP_RESPONSE, out);
-        context.setAttribute(ExecutionContext.HTTP_REQ_SENT, Boolean.TRUE);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, route);
+        context.setAttribute(HttpClientContext.HTTP_TARGET_HOST, target);
+        context.setAttribute(HttpClientContext.HTTP_REQUEST, request);
+        context.setAttribute(HttpClientContext.HTTP_RESPONSE, out);
+        context.setAttribute(HttpClientContext.HTTP_REQ_SENT, Boolean.TRUE);
         return out;
     }
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/methods/HttpRequestWrapper.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/methods/HttpRequestWrapper.java?rev=1463938&r1=1463937&r2=1463938&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/methods/HttpRequestWrapper.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/methods/HttpRequestWrapper.java Wed Apr  3 11:56:34 2013
@@ -48,6 +48,7 @@ import org.apache.http.protocol.HTTP;
  *
  * @since 4.3
  */
+@SuppressWarnings("deprecation")
 @NotThreadSafe
 public class HttpRequestWrapper extends AbstractHttpMessage implements HttpRequest {
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/ClientContext.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/ClientContext.java?rev=1463938&r1=1463937&r2=1463938&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/ClientContext.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/ClientContext.java Wed Apr  3 11:56:34 2013
@@ -37,6 +37,7 @@ import org.apache.http.cookie.CookieSpec
  *
  * @since 4.0
  */
+@Deprecated
 public interface ClientContext {
 
     /**

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/HttpClientContext.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/HttpClientContext.java?rev=1463938&r1=1463937&r2=1463938&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/HttpClientContext.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/protocol/HttpClientContext.java Wed Apr  3 11:56:34 2013
@@ -52,7 +52,89 @@ import org.apache.http.protocol.HttpCore
  * @since 4.3
  */
 @NotThreadSafe
-public class HttpClientContext extends HttpCoreContext implements ClientContext {
+public class HttpClientContext extends HttpCoreContext {
+
+    /**
+     * Attribute name of a {@link org.apache.http.conn.routing.RouteInfo}
+     * object that represents the actual connection route.
+     */
+    public static final String HTTP_ROUTE   = "http.route";
+
+    /**
+     * Attribute name of a {@link org.apache.http.config.Lookup} object that represents
+     * the actual {@link CookieSpecProvider} registry.
+     */
+    public static final String COOKIESPEC_REGISTRY   = "http.cookiespec-registry";
+
+    /**
+     * Attribute name of a {@link org.apache.http.cookie.CookieSpec}
+     * object that represents the actual cookie specification.
+     */
+    public static final String COOKIE_SPEC           = "http.cookie-spec";
+
+    /**
+     * Attribute name of a {@link org.apache.http.cookie.CookieOrigin}
+     * object that represents the actual details of the origin server.
+     */
+    public static final String COOKIE_ORIGIN         = "http.cookie-origin";
+
+    /**
+     * Attribute name of a {@link org.apache.http.client.CookieStore}
+     * object that represents the actual cookie store.
+     */
+    public static final String COOKIE_STORE          = "http.cookie-store";
+
+    /**
+     * Attribute name of a {@link org.apache.http.client.CredentialsProvider}
+     * object that represents the actual credentials provider.
+     */
+    public static final String CREDS_PROVIDER        = "http.auth.credentials-provider";
+
+    /**
+     * Attribute name of a {@link org.apache.http.client.AuthCache} object
+     * that represents the auth scheme cache.
+     */
+    public static final String AUTH_CACHE            = "http.auth.auth-cache";
+
+    /**
+     * Attribute name of a {@link org.apache.http.auth.AuthState}
+     * object that represents the actual target authentication state.
+     */
+    public static final String TARGET_AUTH_STATE     = "http.auth.target-scope";
+
+    /**
+     * Attribute name of a {@link org.apache.http.auth.AuthState}
+     * object that represents the actual proxy authentication state.
+     */
+    public static final String PROXY_AUTH_STATE      = "http.auth.proxy-scope";
+
+    /**
+     * Attribute name of a {@link java.lang.Object} object that represents
+     * the actual user identity such as user {@link java.security.Principal}.
+     */
+    public static final String USER_TOKEN            = "http.user-token";
+
+    /**
+     * Attribute name of a {@link org.apache.http.config.Lookup} object that represents
+     * the actual {@link AuthSchemeProvider} registry.
+     */
+    public static final String AUTHSCHEME_REGISTRY   = "http.authscheme-registry";
+
+    /**
+     * Attribute name of a {@link org.apache.http.config.Lookup} object that represents
+     * the actual {@link ConnectionSocketFactory} registry.
+     *
+     * @since 4.3
+     */
+    public static final String SOCKET_FACTORY_REGISTRY = "http.socket-factory-registry";
+
+    /**
+     * Attribute name of a {@link org.apache.http.client.config.RequestConfig} object that
+     * represents the actual request configuration.
+     *
+     * @since 4.3
+     */
+    public static final String REQUEST_CONFIG = "http.request-config";
 
     public static HttpClientContext adapt(final HttpContext context) {
         if (context instanceof HttpClientContext) {
@@ -75,7 +157,7 @@ public class HttpClientContext extends H
     }
 
     public RouteInfo getHttpRoute() {
-        return getAttribute(ROUTE, HttpRoute.class);
+        return getAttribute(HTTP_ROUTE, HttpRoute.class);
     }
 
     public CookieStore getCookieStore() {
@@ -96,7 +178,7 @@ public class HttpClientContext extends H
 
     @SuppressWarnings("unchecked")
     protected <T> Lookup<T> getLookup(final String name, final Class<T> clazz) {
-        return (Lookup<T>) getAttribute(name, Lookup.class);
+        return getAttribute(name, Lookup.class);
     }
 
     public Lookup<CookieSpecProvider> getCookieSpecRegistry() {

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=1463938&r1=1463937&r2=1463938&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 Apr  3 11:56:34 2013
@@ -192,8 +192,8 @@ public class RequestAddCookies implement
 
         // Stick the CookieSpec and CookieOrigin instances to the HTTP context
         // so they could be obtained by the response interceptor
-        context.setAttribute(ClientContext.COOKIE_SPEC, cookieSpec);
-        context.setAttribute(ClientContext.COOKIE_ORIGIN, cookieOrigin);
+        context.setAttribute(HttpClientContext.COOKIE_SPEC, cookieSpec);
+        context.setAttribute(HttpClientContext.COOKIE_ORIGIN, cookieOrigin);
     }
 
 }

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/auth/GGSSchemeBase.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/auth/GGSSchemeBase.java?rev=1463938&r1=1463937&r2=1463938&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/auth/GGSSchemeBase.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/auth/GGSSchemeBase.java Wed Apr  3 11:56:34 2013
@@ -38,7 +38,7 @@ import org.apache.http.auth.ContextAware
 import org.apache.http.auth.Credentials;
 import org.apache.http.auth.InvalidCredentialsException;
 import org.apache.http.auth.MalformedChallengeException;
-import org.apache.http.client.protocol.ClientContext;
+import org.apache.http.client.protocol.HttpClientContext;
 import org.apache.http.conn.routing.HttpRoute;
 import org.apache.http.message.BufferedHeader;
 import org.apache.http.protocol.HttpContext;
@@ -133,7 +133,7 @@ public abstract class GGSSchemeBase exte
             throw new AuthenticationException(getSchemeName() + " authentication has failed");
         case CHALLENGE_RECEIVED:
             try {
-                final HttpRoute route = (HttpRoute) context.getAttribute(ClientContext.ROUTE);
+                final HttpRoute route = (HttpRoute) context.getAttribute(HttpClientContext.HTTP_ROUTE);
                 if (route == null) {
                     throw new AuthenticationException("Connection route is not available");
                 }

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpRequestRetryHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpRequestRetryHandler.java?rev=1463938&r1=1463937&r2=1463938&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpRequestRetryHandler.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpRequestRetryHandler.java Wed Apr  3 11:56:34 2013
@@ -39,8 +39,8 @@ import org.apache.http.HttpRequest;
 import org.apache.http.annotation.Immutable;
 import org.apache.http.client.HttpRequestRetryHandler;
 import org.apache.http.client.methods.HttpUriRequest;
-import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpContext;
+import org.apache.http.protocol.HttpCoreContext;
 import org.apache.http.util.Args;
 
 /**
@@ -106,7 +106,7 @@ public class DefaultHttpRequestRetryHand
         }
 
         final HttpRequest request = (HttpRequest)
-            context.getAttribute(ExecutionContext.HTTP_REQUEST);
+            context.getAttribute(HttpCoreContext.HTTP_REQUEST);
 
         if(requestIsAborted(request)){
             return false;
@@ -118,7 +118,7 @@ public class DefaultHttpRequestRetryHand
         }
 
         final Boolean b = (Boolean)
-            context.getAttribute(ExecutionContext.HTTP_REQ_SENT);
+            context.getAttribute(HttpCoreContext.HTTP_REQ_SENT);
         final boolean sent = (b != null && b.booleanValue());
 
         if (!sent || this.requestSentRetryEnabled) {

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRedirectStrategy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRedirectStrategy.java?rev=1463938&r1=1463937&r2=1463938&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRedirectStrategy.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultRedirectStrategy.java Wed Apr  3 11:56:34 2013
@@ -48,8 +48,8 @@ import org.apache.http.client.methods.Ht
 import org.apache.http.client.methods.RequestBuilder;
 import org.apache.http.client.protocol.HttpClientContext;
 import org.apache.http.client.utils.URIUtils;
-import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpContext;
+import org.apache.http.protocol.HttpCoreContext;
 import org.apache.http.util.Args;
 import org.apache.http.util.Asserts;
 
@@ -149,7 +149,7 @@ public class DefaultRedirectStrategy imp
                             + uri + "' not allowed");
                 }
                 // Adjust location URI
-                final HttpHost target = (HttpHost) context.getAttribute(ExecutionContext.HTTP_TARGET_HOST);
+                final HttpHost target = (HttpHost) context.getAttribute(HttpCoreContext.HTTP_TARGET_HOST);
                 Asserts.notNull(target, "Target host");
                 final URI requestURI = new URI(request.getRequestLine().getUri());
                 final URI absoluteRequestURI = URIUtils.rewriteURI(requestURI, target, true);

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/HttpClientConnectionOperator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/HttpClientConnectionOperator.java?rev=1463938&r1=1463937&r2=1463938&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/HttpClientConnectionOperator.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/HttpClientConnectionOperator.java Wed Apr  3 11:56:34 2013
@@ -36,7 +36,6 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.http.HttpHost;
 import org.apache.http.annotation.Immutable;
-import org.apache.http.client.protocol.ClientContext;
 import org.apache.http.client.protocol.HttpClientContext;
 import org.apache.http.config.Lookup;
 import org.apache.http.config.SocketConfig;
@@ -44,8 +43,8 @@ import org.apache.http.conn.ConnectTimeo
 import org.apache.http.conn.DnsResolver;
 import org.apache.http.conn.HttpClientConnectionManager;
 import org.apache.http.conn.HttpHostConnectException;
-import org.apache.http.conn.SchemePortResolver;
 import org.apache.http.conn.ManagedHttpClientConnection;
+import org.apache.http.conn.SchemePortResolver;
 import org.apache.http.conn.socket.ConnectionSocketFactory;
 import org.apache.http.conn.socket.LayeredConnectionSocketFactory;
 import org.apache.http.conn.socket.PlainSocketFactory;
@@ -78,7 +77,7 @@ class HttpClientConnectionOperator {
     @SuppressWarnings("unchecked")
     private Lookup<ConnectionSocketFactory> getSocketFactoryRegistry(final HttpContext context) {
         Lookup<ConnectionSocketFactory> reg = (Lookup<ConnectionSocketFactory>)
-            context.getAttribute(ClientContext.SOCKET_FACTORY_REGISTRY);
+            context.getAttribute(HttpClientContext.SOCKET_FACTORY_REGISTRY);
         if (reg == null) {
             reg = this.socketFactoryRegistry;
         }

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java?rev=1463938&r1=1463937&r2=1463938&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java Wed Apr  3 11:56:34 2013
@@ -54,7 +54,6 @@ import org.apache.http.client.config.Req
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpExecutionAware;
 import org.apache.http.client.methods.HttpRequestWrapper;
-import org.apache.http.client.protocol.ClientContext;
 import org.apache.http.client.protocol.HttpClientContext;
 import org.apache.http.client.protocol.RequestClientConnControl;
 import org.apache.http.conn.ConnectionKeepAliveStrategy;
@@ -67,7 +66,6 @@ import org.apache.http.conn.routing.Rout
 import org.apache.http.entity.BufferedHttpEntity;
 import org.apache.http.impl.conn.ConnectionShutdownException;
 import org.apache.http.message.BasicHttpRequest;
-import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpProcessor;
 import org.apache.http.protocol.HttpRequestExecutor;
 import org.apache.http.protocol.ImmutableHttpProcessor;
@@ -137,12 +135,12 @@ public class MainClientExec implements C
         AuthState targetAuthState = context.getTargetAuthState();
         if (targetAuthState == null) {
             targetAuthState = new AuthState();
-            context.setAttribute(ClientContext.TARGET_AUTH_STATE, targetAuthState);
+            context.setAttribute(HttpClientContext.TARGET_AUTH_STATE, targetAuthState);
         }
         AuthState proxyAuthState = context.getProxyAuthState();
         if (proxyAuthState == null) {
             proxyAuthState = new AuthState();
-            context.setAttribute(ClientContext.PROXY_AUTH_STATE, proxyAuthState);
+            context.setAttribute(HttpClientContext.PROXY_AUTH_STATE, proxyAuthState);
         }
 
         if (request instanceof HttpEntityEnclosingRequest) {
@@ -178,7 +176,7 @@ public class MainClientExec implements C
             throw new RequestAbortedException("Request execution failed", cause);
         }
 
-        context.setAttribute(ExecutionContext.HTTP_CONNECTION, managedConn);
+        context.setAttribute(HttpClientContext.HTTP_CONNECTION, managedConn);
 
         if (config.isStaleConnectionCheckEnabled()) {
             // validate connection
@@ -306,7 +304,7 @@ public class MainClientExec implements C
 
             if (userToken == null) {
                 userToken = userTokenHandler.getUserToken(context);
-                context.setAttribute(ClientContext.USER_TOKEN, userToken);
+                context.setAttribute(HttpClientContext.USER_TOKEN, userToken);
             }
             if (userToken != null) {
                 connHolder.setState(userToken);

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MinimalClientExec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MinimalClientExec.java?rev=1463938&r1=1463937&r2=1463938&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MinimalClientExec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MinimalClientExec.java Wed Apr  3 11:56:34 2013
@@ -49,7 +49,6 @@ import org.apache.http.client.methods.Cl
 import org.apache.http.client.methods.HttpExecutionAware;
 import org.apache.http.client.methods.HttpRequestWrapper;
 import org.apache.http.client.methods.HttpUriRequest;
-import org.apache.http.client.protocol.ClientContext;
 import org.apache.http.client.protocol.HttpClientContext;
 import org.apache.http.client.protocol.RequestClientConnControl;
 import org.apache.http.conn.ConnectionKeepAliveStrategy;
@@ -57,7 +56,6 @@ import org.apache.http.conn.ConnectionRe
 import org.apache.http.conn.HttpClientConnectionManager;
 import org.apache.http.conn.routing.HttpRoute;
 import org.apache.http.impl.conn.ConnectionShutdownException;
-import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpProcessor;
 import org.apache.http.protocol.HttpRequestExecutor;
 import org.apache.http.protocol.ImmutableHttpProcessor;
@@ -177,10 +175,10 @@ public class MinimalClientExec implement
                 target = route.getTargetHost();
             }
 
-            context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, target);
-            context.setAttribute(ExecutionContext.HTTP_REQUEST, request);
-            context.setAttribute(ExecutionContext.HTTP_CONNECTION, managedConn);
-            context.setAttribute(ClientContext.ROUTE, route);
+            context.setAttribute(HttpClientContext.HTTP_TARGET_HOST, target);
+            context.setAttribute(HttpClientContext.HTTP_REQUEST, request);
+            context.setAttribute(HttpClientContext.HTTP_CONNECTION, managedConn);
+            context.setAttribute(HttpClientContext.HTTP_ROUTE, route);
 
             httpProcessor.process(request, context);
             final HttpResponse response = requestExecutor.execute(request, managedConn, context);

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=1463938&r1=1463937&r2=1463938&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 Apr  3 11:56:34 2013
@@ -55,9 +55,6 @@ import org.apache.http.impl.cookie.Netsc
 import org.apache.http.impl.cookie.RFC2109SpecFactory;
 import org.apache.http.impl.cookie.RFC2965SpecFactory;
 import org.apache.http.message.BasicHttpRequest;
-import org.apache.http.protocol.BasicHttpContext;
-import org.apache.http.protocol.ExecutionContext;
-import org.apache.http.protocol.HttpContext;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -95,7 +92,7 @@ public class TestRequestAddCookies {
 
     @Test(expected=IllegalArgumentException.class)
     public void testRequestParameterCheck() throws Exception {
-        final HttpContext context = new BasicHttpContext();
+        final HttpClientContext context = HttpClientContext.create();
         final HttpRequestInterceptor interceptor = new RequestAddCookies();
         interceptor.process(null, context);
     }
@@ -113,11 +110,11 @@ public class TestRequestAddCookies {
 
         final HttpRoute route = new HttpRoute(this.target, null, false);
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, this.target);
-        context.setAttribute(ClientContext.ROUTE, route);
-        context.setAttribute(ClientContext.COOKIE_STORE, this.cookieStore);
-        context.setAttribute(ClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.HTTP_TARGET_HOST, this.target);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, route);
+        context.setAttribute(HttpClientContext.COOKIE_STORE, this.cookieStore);
+        context.setAttribute(HttpClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
 
         final HttpRequestInterceptor interceptor = new RequestAddCookies();
         interceptor.process(request, context);
@@ -131,8 +128,7 @@ public class TestRequestAddCookies {
         Assert.assertNotNull(headers2);
         Assert.assertEquals(0, headers2.length);
 
-        final CookieOrigin cookieOrigin = (CookieOrigin) context.getAttribute(
-                ClientContext.COOKIE_ORIGIN);
+        final CookieOrigin cookieOrigin = context.getCookieOrigin();
         Assert.assertNotNull(cookieOrigin);
         Assert.assertEquals(this.target.getHostName(), cookieOrigin.getHost());
         Assert.assertEquals(this.target.getPort(), cookieOrigin.getPort());
@@ -146,11 +142,11 @@ public class TestRequestAddCookies {
 
         final HttpRoute route = new HttpRoute(this.target, null, false);
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, this.target);
-        context.setAttribute(ClientContext.ROUTE, route);
-        context.setAttribute(ClientContext.COOKIE_STORE, this.cookieStore);
-        context.setAttribute(ClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.HTTP_TARGET_HOST, this.target);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, route);
+        context.setAttribute(HttpClientContext.COOKIE_STORE, this.cookieStore);
+        context.setAttribute(HttpClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
 
         final HttpRequestInterceptor interceptor = new RequestAddCookies();
         interceptor.process(request, context);
@@ -169,11 +165,11 @@ public class TestRequestAddCookies {
 
         final HttpRoute route = new HttpRoute(this.target, null, false);
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, this.target);
-        context.setAttribute(ClientContext.ROUTE, route);
-        context.setAttribute(ClientContext.COOKIE_STORE, null);
-        context.setAttribute(ClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.HTTP_TARGET_HOST, this.target);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, route);
+        context.setAttribute(HttpClientContext.COOKIE_STORE, null);
+        context.setAttribute(HttpClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
 
         final HttpRequestInterceptor interceptor = new RequestAddCookies();
         interceptor.process(request, context);
@@ -192,11 +188,11 @@ public class TestRequestAddCookies {
 
         final HttpRoute route = new HttpRoute(this.target, null, false);
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, this.target);
-        context.setAttribute(ClientContext.ROUTE, route);
-        context.setAttribute(ClientContext.COOKIE_STORE, this.cookieStore);
-        context.setAttribute(ClientContext.COOKIESPEC_REGISTRY, null);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.HTTP_TARGET_HOST, this.target);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, route);
+        context.setAttribute(HttpClientContext.COOKIE_STORE, this.cookieStore);
+        context.setAttribute(HttpClientContext.COOKIESPEC_REGISTRY, null);
 
         final HttpRequestInterceptor interceptor = new RequestAddCookies();
         interceptor.process(request, context);
@@ -215,11 +211,11 @@ public class TestRequestAddCookies {
 
         final HttpRoute route = new HttpRoute(this.target, null, false);
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, null);
-        context.setAttribute(ClientContext.ROUTE, route);
-        context.setAttribute(ClientContext.COOKIE_STORE, this.cookieStore);
-        context.setAttribute(ClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.HTTP_TARGET_HOST, null);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, route);
+        context.setAttribute(HttpClientContext.COOKIE_STORE, this.cookieStore);
+        context.setAttribute(HttpClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
 
         final HttpRequestInterceptor interceptor = new RequestAddCookies();
         interceptor.process(request, context);
@@ -236,11 +232,11 @@ public class TestRequestAddCookies {
     public void testNoHttpConnection() throws Exception {
         final HttpRequest request = new BasicHttpRequest("GET", "/");
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, this.target);
-        context.setAttribute(ExecutionContext.HTTP_CONNECTION, null);
-        context.setAttribute(ClientContext.COOKIE_STORE, this.cookieStore);
-        context.setAttribute(ClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.HTTP_TARGET_HOST, this.target);
+        context.setAttribute(HttpClientContext.HTTP_CONNECTION, null);
+        context.setAttribute(HttpClientContext.COOKIE_STORE, this.cookieStore);
+        context.setAttribute(HttpClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
 
         final HttpRequestInterceptor interceptor = new RequestAddCookies();
         interceptor.process(request, context);
@@ -260,18 +256,17 @@ public class TestRequestAddCookies {
             .setCookieSpec(CookieSpecs.BROWSER_COMPATIBILITY).build();
         final HttpRoute route = new HttpRoute(this.target, null, false);
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, this.target);
-        context.setAttribute(ClientContext.ROUTE, route);
-        context.setAttribute(ClientContext.REQUEST_CONFIG, config);
-        context.setAttribute(ClientContext.COOKIE_STORE, this.cookieStore);
-        context.setAttribute(ClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.HTTP_TARGET_HOST, this.target);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, route);
+        context.setAttribute(HttpClientContext.REQUEST_CONFIG, config);
+        context.setAttribute(HttpClientContext.COOKIE_STORE, this.cookieStore);
+        context.setAttribute(HttpClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
 
         final HttpRequestInterceptor interceptor = new RequestAddCookies();
         interceptor.process(request, context);
 
-        final CookieSpec cookieSpec = (CookieSpec) context.getAttribute(
-                ClientContext.COOKIE_SPEC);
+        final CookieSpec cookieSpec = context.getCookieSpec();
         Assert.assertTrue(cookieSpec instanceof BrowserCompatSpec);
 
         final Header[] headers1 = request.getHeaders(SM.COOKIE);
@@ -286,11 +281,11 @@ public class TestRequestAddCookies {
 
         final HttpRoute route = new HttpRoute(this.target, null, false);
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, this.target);
-        context.setAttribute(ClientContext.ROUTE, route);
-        context.setAttribute(ClientContext.COOKIE_STORE, this.cookieStore);
-        context.setAttribute(ClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.HTTP_TARGET_HOST, this.target);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, route);
+        context.setAttribute(HttpClientContext.COOKIE_STORE, this.cookieStore);
+        context.setAttribute(HttpClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
 
         final HttpRequestInterceptor interceptor = new RequestAddCookies();
         interceptor.process(request, context);
@@ -303,17 +298,16 @@ public class TestRequestAddCookies {
         this.target = new HttpHost("localhost.local");
         final HttpRoute route = new HttpRoute(new HttpHost("localhost.local", 1234), null, false);
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, this.target);
-        context.setAttribute(ClientContext.ROUTE, route);
-        context.setAttribute(ClientContext.COOKIE_STORE, this.cookieStore);
-        context.setAttribute(ClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.HTTP_TARGET_HOST, this.target);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, route);
+        context.setAttribute(HttpClientContext.COOKIE_STORE, this.cookieStore);
+        context.setAttribute(HttpClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
 
         final HttpRequestInterceptor interceptor = new RequestAddCookies();
         interceptor.process(request, context);
 
-        final CookieOrigin cookieOrigin = (CookieOrigin) context.getAttribute(
-                ClientContext.COOKIE_ORIGIN);
+        final CookieOrigin cookieOrigin = context.getCookieOrigin();
         Assert.assertNotNull(cookieOrigin);
         Assert.assertEquals(this.target.getHostName(), cookieOrigin.getHost());
         Assert.assertEquals(1234, cookieOrigin.getPort());
@@ -329,17 +323,16 @@ public class TestRequestAddCookies {
         final HttpRoute route = new HttpRoute(
                 new HttpHost("localhost.local", 80), null, new HttpHost("localhost", 8888), false);
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, this.target);
-        context.setAttribute(ClientContext.ROUTE, route);
-        context.setAttribute(ClientContext.COOKIE_STORE, this.cookieStore);
-        context.setAttribute(ClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.HTTP_TARGET_HOST, this.target);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, route);
+        context.setAttribute(HttpClientContext.COOKIE_STORE, this.cookieStore);
+        context.setAttribute(HttpClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
 
         final HttpRequestInterceptor interceptor = new RequestAddCookies();
         interceptor.process(request, context);
 
-        final CookieOrigin cookieOrigin = (CookieOrigin) context.getAttribute(
-                ClientContext.COOKIE_ORIGIN);
+        final CookieOrigin cookieOrigin = context.getCookieOrigin();
         Assert.assertNotNull(cookieOrigin);
         Assert.assertEquals(this.target.getHostName(), cookieOrigin.getHost());
         Assert.assertEquals(80, cookieOrigin.getPort());
@@ -356,17 +349,16 @@ public class TestRequestAddCookies {
                 new HttpHost("localhost", 443, "https"), null,
                 new HttpHost("localhost", 8888), true, TunnelType.TUNNELLED, LayerType.LAYERED);
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, this.target);
-        context.setAttribute(ClientContext.ROUTE, route);
-        context.setAttribute(ClientContext.COOKIE_STORE, this.cookieStore);
-        context.setAttribute(ClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.HTTP_TARGET_HOST, this.target);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, route);
+        context.setAttribute(HttpClientContext.COOKIE_STORE, this.cookieStore);
+        context.setAttribute(HttpClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
 
         final HttpRequestInterceptor interceptor = new RequestAddCookies();
         interceptor.process(request, context);
 
-        final CookieOrigin cookieOrigin = (CookieOrigin) context.getAttribute(
-                ClientContext.COOKIE_ORIGIN);
+        final CookieOrigin cookieOrigin = context.getCookieOrigin();
         Assert.assertNotNull(cookieOrigin);
         Assert.assertEquals(this.target.getHostName(), cookieOrigin.getHost());
         Assert.assertEquals(443, cookieOrigin.getPort());
@@ -388,11 +380,11 @@ public class TestRequestAddCookies {
 
         final HttpRoute route = new HttpRoute(this.target, null, false);
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, this.target);
-        context.setAttribute(ClientContext.ROUTE, route);
-        context.setAttribute(ClientContext.COOKIE_STORE, this.cookieStore);
-        context.setAttribute(ClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.HTTP_TARGET_HOST, this.target);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, route);
+        context.setAttribute(HttpClientContext.COOKIE_STORE, this.cookieStore);
+        context.setAttribute(HttpClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
 
         final HttpRequestInterceptor interceptor = new RequestAddCookies();
         interceptor.process(request, context);
@@ -419,11 +411,11 @@ public class TestRequestAddCookies {
 
         final HttpRoute route = new HttpRoute(this.target, null, false);
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, this.target);
-        context.setAttribute(ClientContext.ROUTE, route);
-        context.setAttribute(ClientContext.COOKIE_STORE, this.cookieStore);
-        context.setAttribute(ClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.HTTP_TARGET_HOST, this.target);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, route);
+        context.setAttribute(HttpClientContext.COOKIE_STORE, this.cookieStore);
+        context.setAttribute(HttpClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
 
         final HttpRequestInterceptor interceptor = new RequestAddCookies();
         interceptor.process(request, context);
@@ -458,11 +450,11 @@ public class TestRequestAddCookies {
 
         final HttpRoute route = new HttpRoute(this.target, null, false);
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, this.target);
-        context.setAttribute(ClientContext.ROUTE, route);
-        context.setAttribute(ClientContext.COOKIE_STORE, this.cookieStore);
-        context.setAttribute(ClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.HTTP_TARGET_HOST, this.target);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, route);
+        context.setAttribute(HttpClientContext.COOKIE_STORE, this.cookieStore);
+        context.setAttribute(HttpClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
 
         final HttpRequestInterceptor interceptor = new RequestAddCookies();
         interceptor.process(request, context);
@@ -492,11 +484,11 @@ public class TestRequestAddCookies {
 
         final HttpRoute route = new HttpRoute(this.target, null, false);
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, this.target);
-        context.setAttribute(ClientContext.ROUTE, route);
-        context.setAttribute(ClientContext.COOKIE_STORE, this.cookieStore);
-        context.setAttribute(ClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.HTTP_TARGET_HOST, this.target);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, route);
+        context.setAttribute(HttpClientContext.COOKIE_STORE, this.cookieStore);
+        context.setAttribute(HttpClientContext.COOKIESPEC_REGISTRY, this.cookieSpecRegistry);
 
         final HttpRequestInterceptor interceptor = new RequestAddCookies();
         interceptor.process(request, context);

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestAuthCache.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestAuthCache.java?rev=1463938&r1=1463937&r2=1463938&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestAuthCache.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestAuthCache.java Wed Apr  3 11:56:34 2013
@@ -40,9 +40,6 @@ import org.apache.http.impl.auth.BasicSc
 import org.apache.http.impl.client.BasicAuthCache;
 import org.apache.http.impl.client.BasicCredentialsProvider;
 import org.apache.http.message.BasicHttpRequest;
-import org.apache.http.protocol.BasicHttpContext;
-import org.apache.http.protocol.ExecutionContext;
-import org.apache.http.protocol.HttpContext;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -83,7 +80,7 @@ public class TestRequestAuthCache {
 
     @Test(expected=IllegalArgumentException.class)
     public void testRequestParameterCheck() throws Exception {
-        final HttpContext context = new BasicHttpContext();
+        final HttpClientContext context = HttpClientContext.create();
         final HttpRequestInterceptor interceptor = new RequestAuthCache();
         interceptor.process(null, context);
     }
@@ -99,18 +96,18 @@ public class TestRequestAuthCache {
     public void testPreemptiveTargetAndProxyAuth() throws Exception {
         final HttpRequest request = new BasicHttpRequest("GET", "/");
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ClientContext.CREDS_PROVIDER, this.credProvider);
-        context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, this.target);
-        context.setAttribute(ClientContext.ROUTE, new HttpRoute(this.target, null, this.proxy, false));
-        context.setAttribute(ClientContext.TARGET_AUTH_STATE, this.targetState);
-        context.setAttribute(ClientContext.PROXY_AUTH_STATE, this.proxyState);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.CREDS_PROVIDER, this.credProvider);
+        context.setAttribute(HttpClientContext.HTTP_TARGET_HOST, this.target);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, new HttpRoute(this.target, null, this.proxy, false));
+        context.setAttribute(HttpClientContext.TARGET_AUTH_STATE, this.targetState);
+        context.setAttribute(HttpClientContext.PROXY_AUTH_STATE, this.proxyState);
 
         final AuthCache authCache = new BasicAuthCache();
         authCache.put(this.target, this.authscheme1);
         authCache.put(this.proxy, this.authscheme2);
 
-        context.setAttribute(ClientContext.AUTH_CACHE, authCache);
+        context.setAttribute(HttpClientContext.AUTH_CACHE, authCache);
 
         final HttpRequestInterceptor interceptor = new RequestAuthCache();
         interceptor.process(request, context);
@@ -124,18 +121,18 @@ public class TestRequestAuthCache {
     public void testCredentialsProviderNotSet() throws Exception {
         final HttpRequest request = new BasicHttpRequest("GET", "/");
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ClientContext.CREDS_PROVIDER, null);
-        context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, this.target);
-        context.setAttribute(ClientContext.ROUTE, new HttpRoute(this.target, null, this.proxy, false));
-        context.setAttribute(ClientContext.TARGET_AUTH_STATE, this.targetState);
-        context.setAttribute(ClientContext.PROXY_AUTH_STATE, this.proxyState);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.CREDS_PROVIDER, null);
+        context.setAttribute(HttpClientContext.HTTP_TARGET_HOST, this.target);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, new HttpRoute(this.target, null, this.proxy, false));
+        context.setAttribute(HttpClientContext.TARGET_AUTH_STATE, this.targetState);
+        context.setAttribute(HttpClientContext.PROXY_AUTH_STATE, this.proxyState);
 
         final AuthCache authCache = new BasicAuthCache();
         authCache.put(this.target, this.authscheme1);
         authCache.put(this.proxy, this.authscheme2);
 
-        context.setAttribute(ClientContext.AUTH_CACHE, authCache);
+        context.setAttribute(HttpClientContext.AUTH_CACHE, authCache);
 
         final HttpRequestInterceptor interceptor = new RequestAuthCache();
         interceptor.process(request, context);
@@ -149,13 +146,13 @@ public class TestRequestAuthCache {
     public void testAuthCacheNotSet() throws Exception {
         final HttpRequest request = new BasicHttpRequest("GET", "/");
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ClientContext.CREDS_PROVIDER, this.credProvider);
-        context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, this.target);
-        context.setAttribute(ClientContext.ROUTE, new HttpRoute(this.target, null, this.proxy, false));
-        context.setAttribute(ClientContext.TARGET_AUTH_STATE, this.targetState);
-        context.setAttribute(ClientContext.PROXY_AUTH_STATE, this.proxyState);
-        context.setAttribute(ClientContext.AUTH_CACHE, null);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.CREDS_PROVIDER, this.credProvider);
+        context.setAttribute(HttpClientContext.HTTP_TARGET_HOST, this.target);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, new HttpRoute(this.target, null, this.proxy, false));
+        context.setAttribute(HttpClientContext.TARGET_AUTH_STATE, this.targetState);
+        context.setAttribute(HttpClientContext.PROXY_AUTH_STATE, this.proxyState);
+        context.setAttribute(HttpClientContext.AUTH_CACHE, null);
 
         final HttpRequestInterceptor interceptor = new RequestAuthCache();
         interceptor.process(request, context);
@@ -169,15 +166,15 @@ public class TestRequestAuthCache {
     public void testAuthCacheEmpty() throws Exception {
         final HttpRequest request = new BasicHttpRequest("GET", "/");
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ClientContext.CREDS_PROVIDER, this.credProvider);
-        context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, this.target);
-        context.setAttribute(ClientContext.ROUTE, new HttpRoute(this.target, null, this.proxy, false));
-        context.setAttribute(ClientContext.TARGET_AUTH_STATE, this.targetState);
-        context.setAttribute(ClientContext.PROXY_AUTH_STATE, this.proxyState);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.CREDS_PROVIDER, this.credProvider);
+        context.setAttribute(HttpClientContext.HTTP_TARGET_HOST, this.target);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, new HttpRoute(this.target, null, this.proxy, false));
+        context.setAttribute(HttpClientContext.TARGET_AUTH_STATE, this.targetState);
+        context.setAttribute(HttpClientContext.PROXY_AUTH_STATE, this.proxyState);
 
         final AuthCache authCache = new BasicAuthCache();
-        context.setAttribute(ClientContext.AUTH_CACHE, authCache);
+        context.setAttribute(HttpClientContext.AUTH_CACHE, authCache);
 
         final HttpRequestInterceptor interceptor = new RequestAuthCache();
         interceptor.process(request, context);
@@ -193,18 +190,18 @@ public class TestRequestAuthCache {
 
         this.credProvider.clear();
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ClientContext.CREDS_PROVIDER, this.credProvider);
-        context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, this.target);
-        context.setAttribute(ClientContext.ROUTE, new HttpRoute(this.target, null, this.proxy, false));
-        context.setAttribute(ClientContext.TARGET_AUTH_STATE, this.targetState);
-        context.setAttribute(ClientContext.PROXY_AUTH_STATE, this.proxyState);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.CREDS_PROVIDER, this.credProvider);
+        context.setAttribute(HttpClientContext.HTTP_TARGET_HOST, this.target);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, new HttpRoute(this.target, null, this.proxy, false));
+        context.setAttribute(HttpClientContext.TARGET_AUTH_STATE, this.targetState);
+        context.setAttribute(HttpClientContext.PROXY_AUTH_STATE, this.proxyState);
 
         final AuthCache authCache = new BasicAuthCache();
         authCache.put(this.target, this.authscheme1);
         authCache.put(this.proxy, this.authscheme2);
 
-        context.setAttribute(ClientContext.AUTH_CACHE, authCache);
+        context.setAttribute(HttpClientContext.AUTH_CACHE, authCache);
 
         final HttpRequestInterceptor interceptor = new RequestAuthCache();
         interceptor.process(request, context);
@@ -218,18 +215,18 @@ public class TestRequestAuthCache {
     public void testAuthSchemeAlreadySet() throws Exception {
         final HttpRequest request = new BasicHttpRequest("GET", "/");
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ClientContext.CREDS_PROVIDER, this.credProvider);
-        context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, this.target);
-        context.setAttribute(ClientContext.ROUTE, new HttpRoute(this.target, null, this.proxy, false));
-        context.setAttribute(ClientContext.TARGET_AUTH_STATE, this.targetState);
-        context.setAttribute(ClientContext.PROXY_AUTH_STATE, this.proxyState);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.CREDS_PROVIDER, this.credProvider);
+        context.setAttribute(HttpClientContext.HTTP_TARGET_HOST, this.target);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, new HttpRoute(this.target, null, this.proxy, false));
+        context.setAttribute(HttpClientContext.TARGET_AUTH_STATE, this.targetState);
+        context.setAttribute(HttpClientContext.PROXY_AUTH_STATE, this.proxyState);
 
         final AuthCache authCache = new BasicAuthCache();
         authCache.put(this.target, this.authscheme1);
         authCache.put(this.proxy, this.authscheme2);
 
-        context.setAttribute(ClientContext.AUTH_CACHE, authCache);
+        context.setAttribute(HttpClientContext.AUTH_CACHE, authCache);
 
         this.targetState.setState(AuthProtocolState.CHALLENGED);
         this.targetState.update(new BasicScheme(), new UsernamePasswordCredentials("user3", "secret3"));

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestClientConnControl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestClientConnControl.java?rev=1463938&r1=1463937&r2=1463938&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestClientConnControl.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestClientConnControl.java Wed Apr  3 11:56:34 2013
@@ -34,9 +34,7 @@ import org.apache.http.conn.routing.Http
 import org.apache.http.conn.routing.RouteInfo.LayerType;
 import org.apache.http.conn.routing.RouteInfo.TunnelType;
 import org.apache.http.message.BasicHttpRequest;
-import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.HTTP;
-import org.apache.http.protocol.HttpContext;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -44,7 +42,7 @@ public class TestRequestClientConnContro
 
     @Test(expected=IllegalArgumentException.class)
     public void testRequestParameterCheck() throws Exception {
-        final HttpContext context = new BasicHttpContext();
+        final HttpClientContext context = HttpClientContext.create();
         final HttpRequestInterceptor interceptor = new RequestClientConnControl();
         interceptor.process(null, context);
     }
@@ -52,7 +50,7 @@ public class TestRequestClientConnContro
     @Test
     public void testConnectionKeepAliveForConnectRequest() throws Exception {
         final HttpRequest request = new BasicHttpRequest("CONNECT", "www.somedomain.com");
-        final HttpContext context = new BasicHttpContext();
+        final HttpClientContext context = HttpClientContext.create();
 
         final HttpRequestInterceptor interceptor = new RequestClientConnControl();
         interceptor.process(request, context);
@@ -66,12 +64,12 @@ public class TestRequestClientConnContro
     @Test
     public void testConnectionKeepAliveForDirectRequests() throws Exception {
         final HttpRequest request = new BasicHttpRequest("GET", "/");
-        final HttpContext context = new BasicHttpContext();
+        final HttpClientContext context = HttpClientContext.create();
 
         final HttpHost target = new HttpHost("localhost", 80, "http");
         final HttpRoute route = new HttpRoute(target, null, false);
 
-        context.setAttribute(ClientContext.ROUTE, route);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, route);
 
         final HttpRequestInterceptor interceptor = new RequestClientConnControl();
         interceptor.process(request, context);
@@ -86,14 +84,14 @@ public class TestRequestClientConnContro
     @Test
     public void testConnectionKeepAliveForTunneledRequests() throws Exception {
         final HttpRequest request = new BasicHttpRequest("GET", "/");
-        final HttpContext context = new BasicHttpContext();
+        final HttpClientContext context = HttpClientContext.create();
 
         final HttpHost target = new HttpHost("localhost", 443, "https");
         final HttpHost proxy = new HttpHost("localhost", 8080);
         final HttpRoute route = new HttpRoute(target, null, proxy, true,
                 TunnelType.TUNNELLED, LayerType.LAYERED);
 
-        context.setAttribute(ClientContext.ROUTE, route);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, route);
 
         final HttpRequestInterceptor interceptor = new RequestClientConnControl();
         interceptor.process(request, context);
@@ -108,14 +106,14 @@ public class TestRequestClientConnContro
     @Test
     public void testProxyConnectionKeepAliveForRequestsOverProxy() throws Exception {
         final HttpRequest request = new BasicHttpRequest("GET", "/");
-        final HttpContext context = new BasicHttpContext();
+        final HttpClientContext context = HttpClientContext.create();
 
         final HttpHost target = new HttpHost("localhost", 80, "http");
         final HttpHost proxy = new HttpHost("localhost", 8080);
         final HttpRoute route = new HttpRoute(target, null, proxy, false,
                 TunnelType.PLAIN, LayerType.PLAIN);
 
-        context.setAttribute(ClientContext.ROUTE, route);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, route);
 
         final HttpRequestInterceptor interceptor = new RequestClientConnControl();
         interceptor.process(request, context);
@@ -131,14 +129,14 @@ public class TestRequestClientConnContro
     public void testPreserveCustomConnectionHeader() throws Exception {
         final HttpRequest request = new BasicHttpRequest("GET", "/");
         request.addHeader(HTTP.CONN_DIRECTIVE, HTTP.CONN_CLOSE);
-        final HttpContext context = new BasicHttpContext();
+        final HttpClientContext context = HttpClientContext.create();
 
         final HttpHost target = new HttpHost("localhost", 443, "https");
         final HttpHost proxy = new HttpHost("localhost", 8080);
         final HttpRoute route = new HttpRoute(target, null, proxy, true,
                 TunnelType.TUNNELLED, LayerType.LAYERED);
 
-        context.setAttribute(ClientContext.ROUTE, route);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, route);
 
         final HttpRequestInterceptor interceptor = new RequestClientConnControl();
         interceptor.process(request, context);
@@ -154,14 +152,14 @@ public class TestRequestClientConnContro
     public void testPreserveCustomProxyConnectionHeader() throws Exception {
         final HttpRequest request = new BasicHttpRequest("GET", "/");
         request.addHeader("Proxy-Connection", HTTP.CONN_CLOSE);
-        final HttpContext context = new BasicHttpContext();
+        final HttpClientContext context = HttpClientContext.create();
 
         final HttpHost target = new HttpHost("localhost", 80, "http");
         final HttpHost proxy = new HttpHost("localhost", 8080);
         final HttpRoute route = new HttpRoute(target, null, proxy, false,
                 TunnelType.PLAIN, LayerType.PLAIN);
 
-        context.setAttribute(ClientContext.ROUTE, route);
+        context.setAttribute(HttpClientContext.HTTP_ROUTE, route);
 
         final HttpRequestInterceptor interceptor = new RequestClientConnControl();
         interceptor.process(request, context);

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestExpectContinue.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestExpectContinue.java?rev=1463938&r1=1463937&r2=1463938&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestExpectContinue.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestExpectContinue.java Wed Apr  3 11:56:34 2013
@@ -43,9 +43,9 @@ public class TestRequestExpectContinue {
 
     @Test
     public void testRequestExpectContinueGenerated() throws Exception {
-        final HttpContext context = new BasicHttpContext();
+        final HttpClientContext context = HttpClientContext.create();
         final RequestConfig config = RequestConfig.custom().setExpectContinueEnabled(true).build();
-        context.setAttribute(ClientContext.REQUEST_CONFIG, config);
+        context.setAttribute(HttpClientContext.REQUEST_CONFIG, config);
         final BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest("POST", "/");
         final String s = "whatever";
         final StringEntity entity = new StringEntity(s, "US-ASCII");
@@ -61,7 +61,7 @@ public class TestRequestExpectContinue {
     public void testRequestExpectContinueNotGenerated() throws Exception {
         final HttpContext context = new BasicHttpContext(null);
         final RequestConfig config = RequestConfig.custom().setExpectContinueEnabled(false).build();
-        context.setAttribute(ClientContext.REQUEST_CONFIG, config);
+        context.setAttribute(HttpClientContext.REQUEST_CONFIG, config);
         final BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest("POST", "/");
         final String s = "whatever";
         final StringEntity entity = new StringEntity(s, "US-ASCII");
@@ -76,7 +76,7 @@ public class TestRequestExpectContinue {
     public void testRequestExpectContinueHTTP10() throws Exception {
         final HttpContext context = new BasicHttpContext(null);
         final RequestConfig config = RequestConfig.custom().setExpectContinueEnabled(true).build();
-        context.setAttribute(ClientContext.REQUEST_CONFIG, config);
+        context.setAttribute(HttpClientContext.REQUEST_CONFIG, config);
         final BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest(
                 "POST", "/", HttpVersion.HTTP_1_0);
         final String s = "whatever";
@@ -92,7 +92,7 @@ public class TestRequestExpectContinue {
     public void testRequestExpectContinueZeroContent() throws Exception {
         final HttpContext context = new BasicHttpContext(null);
         final RequestConfig config = RequestConfig.custom().setExpectContinueEnabled(true).build();
-        context.setAttribute(ClientContext.REQUEST_CONFIG, config);
+        context.setAttribute(HttpClientContext.REQUEST_CONFIG, config);
         final BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest("POST", "/");
         final String s = "";
         final StringEntity entity = new StringEntity(s, "US-ASCII");

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=1463938&r1=1463937&r2=1463938&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 Apr  3 11:56:34 2013
@@ -39,8 +39,6 @@ import org.apache.http.cookie.SM;
 import org.apache.http.impl.client.BasicCookieStore;
 import org.apache.http.impl.cookie.BestMatchSpec;
 import org.apache.http.message.BasicHttpResponse;
-import org.apache.http.protocol.BasicHttpContext;
-import org.apache.http.protocol.HttpContext;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -60,7 +58,7 @@ public class TestResponseProcessCookies 
 
     @Test(expected=IllegalArgumentException.class)
     public void testResponseParameterCheck() throws Exception {
-        final HttpContext context = new BasicHttpContext();
+        final HttpClientContext context = HttpClientContext.create();
         final HttpResponseInterceptor interceptor = new ResponseProcessCookies();
         interceptor.process(null, context);
     }
@@ -77,10 +75,10 @@ public class TestResponseProcessCookies 
         final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
         response.addHeader(SM.SET_COOKIE, "name1=value1");
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ClientContext.COOKIE_ORIGIN, this.cookieOrigin);
-        context.setAttribute(ClientContext.COOKIE_SPEC, this.cookieSpec);
-        context.setAttribute(ClientContext.COOKIE_STORE, this.cookieStore);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.COOKIE_ORIGIN, this.cookieOrigin);
+        context.setAttribute(HttpClientContext.COOKIE_SPEC, this.cookieSpec);
+        context.setAttribute(HttpClientContext.COOKIE_STORE, this.cookieStore);
 
         final HttpResponseInterceptor interceptor = new ResponseProcessCookies();
         interceptor.process(response, context);
@@ -101,10 +99,10 @@ public class TestResponseProcessCookies 
         final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
         response.addHeader(SM.SET_COOKIE, "name1=value1");
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ClientContext.COOKIE_ORIGIN, null);
-        context.setAttribute(ClientContext.COOKIE_SPEC, this.cookieSpec);
-        context.setAttribute(ClientContext.COOKIE_STORE, this.cookieStore);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.COOKIE_ORIGIN, null);
+        context.setAttribute(HttpClientContext.COOKIE_SPEC, this.cookieSpec);
+        context.setAttribute(HttpClientContext.COOKIE_STORE, this.cookieStore);
 
         final HttpResponseInterceptor interceptor = new ResponseProcessCookies();
         interceptor.process(response, context);
@@ -119,10 +117,10 @@ public class TestResponseProcessCookies 
         final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
         response.addHeader(SM.SET_COOKIE, "name1=value1");
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ClientContext.COOKIE_ORIGIN, this.cookieOrigin);
-        context.setAttribute(ClientContext.COOKIE_SPEC, null);
-        context.setAttribute(ClientContext.COOKIE_STORE, this.cookieStore);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.COOKIE_ORIGIN, this.cookieOrigin);
+        context.setAttribute(HttpClientContext.COOKIE_SPEC, null);
+        context.setAttribute(HttpClientContext.COOKIE_STORE, this.cookieStore);
 
         final HttpResponseInterceptor interceptor = new ResponseProcessCookies();
         interceptor.process(response, context);
@@ -137,10 +135,10 @@ public class TestResponseProcessCookies 
         final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
         response.addHeader(SM.SET_COOKIE, "name1=value1");
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ClientContext.COOKIE_ORIGIN, this.cookieOrigin);
-        context.setAttribute(ClientContext.COOKIE_SPEC, this.cookieSpec);
-        context.setAttribute(ClientContext.COOKIE_STORE, null);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.COOKIE_ORIGIN, this.cookieOrigin);
+        context.setAttribute(HttpClientContext.COOKIE_SPEC, this.cookieSpec);
+        context.setAttribute(HttpClientContext.COOKIE_STORE, null);
 
         final HttpResponseInterceptor interceptor = new ResponseProcessCookies();
         interceptor.process(response, context);
@@ -156,10 +154,10 @@ public class TestResponseProcessCookies 
         response.addHeader(SM.SET_COOKIE, "name1=value1");
         response.addHeader(SM.SET_COOKIE2, "name1=value2; Version=1");
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ClientContext.COOKIE_ORIGIN, this.cookieOrigin);
-        context.setAttribute(ClientContext.COOKIE_SPEC, this.cookieSpec);
-        context.setAttribute(ClientContext.COOKIE_STORE, this.cookieStore);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.COOKIE_ORIGIN, this.cookieOrigin);
+        context.setAttribute(HttpClientContext.COOKIE_SPEC, this.cookieSpec);
+        context.setAttribute(HttpClientContext.COOKIE_STORE, this.cookieStore);
 
         final HttpResponseInterceptor interceptor = new ResponseProcessCookies();
         interceptor.process(response, context);
@@ -180,10 +178,10 @@ public class TestResponseProcessCookies 
         final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
         response.addHeader(SM.SET_COOKIE2, "name=value; Version=crap");
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ClientContext.COOKIE_ORIGIN, this.cookieOrigin);
-        context.setAttribute(ClientContext.COOKIE_SPEC, this.cookieSpec);
-        context.setAttribute(ClientContext.COOKIE_STORE, this.cookieStore);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.COOKIE_ORIGIN, this.cookieOrigin);
+        context.setAttribute(HttpClientContext.COOKIE_SPEC, this.cookieSpec);
+        context.setAttribute(HttpClientContext.COOKIE_STORE, this.cookieStore);
 
         final HttpResponseInterceptor interceptor = new ResponseProcessCookies();
         interceptor.process(response, context);
@@ -198,10 +196,10 @@ public class TestResponseProcessCookies 
         final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
         response.addHeader(SM.SET_COOKIE2, "name=value; Domain=www.somedomain.com; Version=1");
 
-        final HttpContext context = new BasicHttpContext();
-        context.setAttribute(ClientContext.COOKIE_ORIGIN, this.cookieOrigin);
-        context.setAttribute(ClientContext.COOKIE_SPEC, this.cookieSpec);
-        context.setAttribute(ClientContext.COOKIE_STORE, this.cookieStore);
+        final HttpClientContext context = HttpClientContext.create();
+        context.setAttribute(HttpClientContext.COOKIE_ORIGIN, this.cookieOrigin);
+        context.setAttribute(HttpClientContext.COOKIE_SPEC, this.cookieSpec);
+        context.setAttribute(HttpClientContext.COOKIE_STORE, this.cookieStore);
 
         final HttpResponseInterceptor interceptor = new ResponseProcessCookies();
         interceptor.process(response, context);



Mime
View raw message