hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1724315 [13/14] - in /httpcomponents/httpclient/trunk: ./ fluent-hc/src/examples/org/apache/http/client/fluent/ fluent-hc/src/main/java/org/apache/http/client/fluent/ fluent-hc/src/test/java/org/apache/http/client/fluent/ httpclient-cache/...
Date Tue, 12 Jan 2016 20:43:42 GMT
Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestPublicSuffixListParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestPublicSuffixListParser.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestPublicSuffixListParser.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestPublicSuffixListParser.java Tue Jan 12 20:43:36 2016
@@ -29,8 +29,8 @@ package org.apache.http.impl.cookie;
 
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
 
-import org.apache.http.Consts;
 import org.apache.http.conn.util.PublicSuffixList;
 import org.apache.http.conn.util.PublicSuffixMatcher;
 import org.apache.http.cookie.Cookie;
@@ -53,7 +53,7 @@ public class TestPublicSuffixListParser
         final PublicSuffixList suffixList;
         try {
             final org.apache.http.conn.util.PublicSuffixListParser parser = new org.apache.http.conn.util.PublicSuffixListParser();
-            suffixList = parser.parse(new InputStreamReader(in, Consts.UTF_8));
+            suffixList = parser.parse(new InputStreamReader(in, StandardCharsets.UTF_8));
         } finally {
             in.close();
         }

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestRFC6265CookieSpec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestRFC6265CookieSpec.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestRFC6265CookieSpec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/cookie/TestRFC6265CookieSpec.java Tue Jan 12 20:43:36 2016
@@ -30,13 +30,13 @@ package org.apache.http.impl.cookie;
 import java.util.Arrays;
 import java.util.List;
 
-import org.apache.http.Header;
+import org.apache.hc.core5.http.Header;
+import org.apache.hc.core5.http.message.BasicHeader;
 import org.apache.http.cookie.CommonCookieAttributeHandler;
 import org.apache.http.cookie.Cookie;
 import org.apache.http.cookie.CookieOrigin;
 import org.apache.http.cookie.MalformedCookieException;
 import org.apache.http.cookie.SetCookie;
-import org.apache.http.message.BasicHeader;
 import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Mockito;

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestConnectionHolder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestConnectionHolder.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestConnectionHolder.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestConnectionHolder.java Tue Jan 12 20:43:36 2016
@@ -30,7 +30,7 @@ import java.io.IOException;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.commons.logging.Log;
-import org.apache.http.HttpClientConnection;
+import org.apache.hc.core5.http.io.HttpClientConnection;
 import org.apache.http.conn.HttpClientConnectionManager;
 import org.junit.Assert;
 import org.junit.Before;

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestMainClientExec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestMainClientExec.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestMainClientExec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestMainClientExec.java Tue Jan 12 20:43:36 2016
@@ -36,15 +36,21 @@ import java.util.Map;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.http.ConnectionReuseStrategy;
-import org.apache.http.HttpClientConnection;
-import org.apache.http.HttpEntityEnclosingRequest;
-import org.apache.http.HttpException;
-import org.apache.http.HttpHeaders;
-import org.apache.http.HttpHost;
-import org.apache.http.HttpRequest;
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpVersion;
+import org.apache.hc.core5.concurrent.Cancellable;
+import org.apache.hc.core5.http.ConnectionReuseStrategy;
+import org.apache.hc.core5.http.HttpException;
+import org.apache.hc.core5.http.HttpHeaders;
+import org.apache.hc.core5.http.HttpHost;
+import org.apache.hc.core5.http.HttpRequest;
+import org.apache.hc.core5.http.HttpResponse;
+import org.apache.hc.core5.http.HttpVersion;
+import org.apache.hc.core5.http.entity.EntityUtils;
+import org.apache.hc.core5.http.entity.StringEntity;
+import org.apache.hc.core5.http.impl.io.HttpRequestExecutor;
+import org.apache.hc.core5.http.io.HttpClientConnection;
+import org.apache.hc.core5.http.message.BasicHttpResponse;
+import org.apache.hc.core5.http.protocol.HttpContext;
+import org.apache.hc.core5.http.protocol.HttpProcessor;
 import org.apache.http.auth.AuthChallenge;
 import org.apache.http.auth.AuthExchange;
 import org.apache.http.auth.AuthScheme;
@@ -62,22 +68,15 @@ import org.apache.http.client.methods.Ht
 import org.apache.http.client.methods.HttpPost;
 import org.apache.http.client.methods.HttpRequestWrapper;
 import org.apache.http.client.protocol.HttpClientContext;
-import org.apache.http.concurrent.Cancellable;
 import org.apache.http.conn.ConnectionKeepAliveStrategy;
 import org.apache.http.conn.ConnectionRequest;
 import org.apache.http.conn.HttpClientConnectionManager;
 import org.apache.http.conn.routing.HttpRoute;
 import org.apache.http.conn.routing.RouteInfo;
-import org.apache.http.entity.StringEntity;
 import org.apache.http.impl.auth.BasicScheme;
 import org.apache.http.impl.auth.NTLMScheme;
 import org.apache.http.impl.client.BasicCredentialsProvider;
 import org.apache.http.impl.conn.ConnectionShutdownException;
-import org.apache.http.message.BasicHttpResponse;
-import org.apache.http.protocol.HttpContext;
-import org.apache.http.protocol.HttpProcessor;
-import org.apache.http.protocol.HttpRequestExecutor;
-import org.apache.http.util.EntityUtils;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -142,7 +141,7 @@ public class TestMainClientExec {
                 .setConnectionRequestTimeout(345)
                 .build();
         context.setRequestConfig(config);
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
         final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
         Mockito.when(requestExecutor.execute(
                 Mockito.same(request),
@@ -172,7 +171,7 @@ public class TestMainClientExec {
     public void testExecRequestPersistentConnection() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
         final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
 
         Mockito.when(managedConn.isOpen()).thenReturn(Boolean.TRUE);
@@ -182,6 +181,7 @@ public class TestMainClientExec {
                 Mockito.<HttpClientConnection>any(),
                 Mockito.<HttpClientContext>any())).thenReturn(response);
         Mockito.when(reuseStrategy.keepAlive(
+                Mockito.same(request),
                 Mockito.same(response),
                 Mockito.<HttpClientContext>any())).thenReturn(Boolean.TRUE);
         Mockito.when(keepAliveStrategy.getKeepAliveDuration(
@@ -204,7 +204,7 @@ public class TestMainClientExec {
     public void testExecRequestPersistentStatefulConnection() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
         final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
 
         Mockito.when(managedConn.isOpen()).thenReturn(Boolean.TRUE);
@@ -214,6 +214,7 @@ public class TestMainClientExec {
                 Mockito.<HttpClientConnection>any(),
                 Mockito.<HttpClientContext>any())).thenReturn(response);
         Mockito.when(reuseStrategy.keepAlive(
+                Mockito.same(request),
                 Mockito.same(response),
                 Mockito.<HttpClientContext>any())).thenReturn(Boolean.TRUE);
         Mockito.when(userTokenHandler.getUserToken(
@@ -234,7 +235,7 @@ public class TestMainClientExec {
     public void testExecRequestConnectionRelease() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
         final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
         // The entity is streaming
         response.setEntity(EntityBuilder.create()
@@ -248,6 +249,7 @@ public class TestMainClientExec {
                 Mockito.<HttpClientConnection>any(),
                 Mockito.<HttpClientContext>any())).thenReturn(response);
         Mockito.when(reuseStrategy.keepAlive(
+                Mockito.same(request),
                 Mockito.same(response),
                 Mockito.<HttpClientContext>any())).thenReturn(Boolean.FALSE);
 
@@ -277,7 +279,7 @@ public class TestMainClientExec {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
         final RequestConfig config = RequestConfig.custom().setSocketTimeout(3000).build();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
         context.setRequestConfig(config);
         final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
         Mockito.when(managedConn.isOpen()).thenReturn(true);
@@ -294,7 +296,7 @@ public class TestMainClientExec {
     public void testSocketTimeoutReset() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
         final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
         Mockito.when(managedConn.isOpen()).thenReturn(Boolean.TRUE);
         Mockito.when(requestExecutor.execute(
@@ -310,7 +312,7 @@ public class TestMainClientExec {
     public void testExecAbortedPriorToConnectionLease() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
 
         Mockito.when(managedConn.isOpen()).thenReturn(Boolean.FALSE);
         Mockito.when(execAware.isAborted()).thenReturn(Boolean.TRUE);
@@ -326,7 +328,7 @@ public class TestMainClientExec {
     public void testExecAbortedPriorToConnectionSetup() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
 
         Mockito.when(managedConn.isOpen()).thenReturn(Boolean.FALSE);
         Mockito.when(execAware.isAborted()).thenReturn(Boolean.FALSE, Boolean.TRUE);
@@ -348,7 +350,7 @@ public class TestMainClientExec {
     public void testExecAbortedPriorToRequestExecution() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
 
         Mockito.when(managedConn.isOpen()).thenReturn(Boolean.FALSE);
         Mockito.when(execAware.isAborted()).thenReturn(Boolean.FALSE, Boolean.FALSE, Boolean.TRUE);
@@ -369,7 +371,7 @@ public class TestMainClientExec {
     public void testExecConnectionRequestFailed() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
 
         Mockito.when(connRequest.get(Mockito.anyInt(), Mockito.<TimeUnit>any()))
                 .thenThrow(new ExecutionException("Opppsie", null));
@@ -380,7 +382,7 @@ public class TestMainClientExec {
     public void testExecRequestRetryOnAuthChallenge() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
         final HttpResponse response1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, 401, "Huh?");
         response1.setHeader(HttpHeaders.WWW_AUTHENTICATE, "Basic realm=test");
         final InputStream instream1 = Mockito.spy(new ByteArrayInputStream(new byte[] {1, 2, 3}));
@@ -404,6 +406,7 @@ public class TestMainClientExec {
                 Mockito.<HttpClientConnection>any(),
                 Mockito.<HttpClientContext>any())).thenReturn(response1, response2);
         Mockito.when(reuseStrategy.keepAlive(
+                Mockito.same(request),
                 Mockito.<HttpResponse>any(),
                 Mockito.<HttpClientContext>any())).thenReturn(Boolean.TRUE);
         Mockito.when(targetAuthStrategy.select(
@@ -424,7 +427,7 @@ public class TestMainClientExec {
     @Test
     public void testExecEntityEnclosingRequestRetryOnAuthChallenge() throws Exception {
         final HttpRoute route = new HttpRoute(target, proxy);
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
         final HttpResponse response1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, 401, "Huh?");
         response1.setHeader(HttpHeaders.WWW_AUTHENTICATE, "Basic realm=test");
         final InputStream instream1 = Mockito.spy(new ByteArrayInputStream(new byte[] {1, 2, 3}));
@@ -455,6 +458,7 @@ public class TestMainClientExec {
                 Mockito.<HttpClientConnection>any(),
                 Mockito.<HttpClientContext>any())).thenReturn(response1, response2);
         Mockito.when(reuseStrategy.keepAlive(
+                Mockito.same(request),
                 Mockito.<HttpResponse>any(),
                 Mockito.<HttpClientContext>any())).thenReturn(Boolean.FALSE);
 
@@ -483,7 +487,7 @@ public class TestMainClientExec {
         post.setEntity(EntityBuilder.create()
                 .setStream(instream0)
                 .build());
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(post);
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(post, target);
 
         final HttpResponse response1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, 401, "Huh?");
         response1.setHeader(HttpHeaders.WWW_AUTHENTICATE, "Basic realm=test");
@@ -506,13 +510,14 @@ public class TestMainClientExec {
             @Override
             public HttpResponse answer(final InvocationOnMock invocationOnMock) throws Throwable {
                 final Object[] args = invocationOnMock.getArguments();
-                final HttpEntityEnclosingRequest requestEE = (HttpEntityEnclosingRequest) args[0];
+                final HttpRequest requestEE = (HttpRequest) args[0];
                 requestEE.getEntity().writeTo(new ByteArrayOutputStream());
                 return response1;
             }
 
         });
         Mockito.when(reuseStrategy.keepAlive(
+                Mockito.same(request),
                 Mockito.<HttpResponse>any(),
                 Mockito.<HttpClientContext>any())).thenReturn(Boolean.TRUE);
 
@@ -528,7 +533,7 @@ public class TestMainClientExec {
     public void testExecConnectionShutDown() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
 
         Mockito.when(requestExecutor.execute(
                 Mockito.<HttpRequest>any(),
@@ -542,7 +547,7 @@ public class TestMainClientExec {
     public void testExecRuntimeException() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
 
         Mockito.when(requestExecutor.execute(
                 Mockito.<HttpRequest>any(),
@@ -562,7 +567,7 @@ public class TestMainClientExec {
     public void testExecHttpException() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
 
         Mockito.when(requestExecutor.execute(
                 Mockito.<HttpRequest>any(),
@@ -582,7 +587,7 @@ public class TestMainClientExec {
     public void testExecIOException() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
 
         Mockito.when(requestExecutor.execute(
                 Mockito.<HttpRequest>any(),
@@ -602,7 +607,7 @@ public class TestMainClientExec {
     public void testEstablishDirectRoute() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
 
         Mockito.when(managedConn.isOpen()).thenReturn(Boolean.TRUE);
 
@@ -616,7 +621,7 @@ public class TestMainClientExec {
     public void testEstablishRouteDirectProxy() throws Exception {
         final HttpRoute route = new HttpRoute(target, null, proxy, false);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
 
         Mockito.when(managedConn.isOpen()).thenReturn(Boolean.TRUE);
 
@@ -634,7 +639,7 @@ public class TestMainClientExec {
                 .setConnectTimeout(321)
                 .build();
         context.setRequestConfig(config);
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
         final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
 
         Mockito.when(managedConn.isOpen()).thenReturn(Boolean.TRUE);
@@ -663,7 +668,7 @@ public class TestMainClientExec {
     public void testEstablishRouteViaProxyTunnelUnexpectedResponse() throws Exception {
         final HttpRoute route = new HttpRoute(target, null, proxy, true);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
         final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 101, "Lost");
 
         Mockito.when(managedConn.isOpen()).thenReturn(Boolean.TRUE);
@@ -679,7 +684,7 @@ public class TestMainClientExec {
     public void testEstablishRouteViaProxyTunnelFailure() throws Exception {
         final HttpRoute route = new HttpRoute(target, null, proxy, true);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
         final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 500, "Boom");
         response.setEntity(new StringEntity("Ka-boom"));
 
@@ -705,7 +710,7 @@ public class TestMainClientExec {
     public void testEstablishRouteViaProxyTunnelRetryOnAuthChallengePersistentConnection() throws Exception {
         final HttpRoute route = new HttpRoute(target, null, proxy, true);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
         final HttpResponse response1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, 407, "Huh?");
         response1.setHeader(HttpHeaders.PROXY_AUTHENTICATE, "Basic realm=test");
         final InputStream instream1 = Mockito.spy(new ByteArrayInputStream(new byte[] {1, 2, 3}));
@@ -720,6 +725,7 @@ public class TestMainClientExec {
 
         Mockito.when(managedConn.isOpen()).thenReturn(Boolean.TRUE);
         Mockito.when(reuseStrategy.keepAlive(
+                Mockito.same(request),
                 Mockito.<HttpResponse>any(),
                 Mockito.<HttpClientContext>any())).thenReturn(Boolean.TRUE);
         Mockito.when(requestExecutor.execute(
@@ -743,7 +749,7 @@ public class TestMainClientExec {
     public void testEstablishRouteViaProxyTunnelRetryOnAuthChallengeNonPersistentConnection() throws Exception {
         final HttpRoute route = new HttpRoute(target, null, proxy, true);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
         final HttpResponse response1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, 407, "Huh?");
         response1.setHeader(HttpHeaders.PROXY_AUTHENTICATE, "Basic realm=test");
         final InputStream instream1 = Mockito.spy(new ByteArrayInputStream(new byte[] {1, 2, 3}));
@@ -758,6 +764,7 @@ public class TestMainClientExec {
 
         Mockito.when(managedConn.isOpen()).thenReturn(Boolean.TRUE);
         Mockito.when(reuseStrategy.keepAlive(
+                Mockito.same(request),
                 Mockito.<HttpResponse>any(),
                 Mockito.<HttpClientContext>any())).thenReturn(Boolean.FALSE);
         Mockito.when(requestExecutor.execute(
@@ -785,7 +792,7 @@ public class TestMainClientExec {
         final HttpRoute route = new HttpRoute(target, null, new HttpHost[] {proxy1, proxy2},
                 true, RouteInfo.TunnelType.TUNNELLED, RouteInfo.LayerType.LAYERED);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
 
         Mockito.when(managedConn.isOpen()).thenReturn(Boolean.TRUE);
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestMinimalClientExec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestMinimalClientExec.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestMinimalClientExec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestMinimalClientExec.java Tue Jan 12 20:43:36 2016
@@ -32,13 +32,16 @@ import java.io.InterruptedIOException;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.http.ConnectionReuseStrategy;
-import org.apache.http.HttpClientConnection;
-import org.apache.http.HttpException;
-import org.apache.http.HttpHost;
-import org.apache.http.HttpRequest;
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpVersion;
+import org.apache.hc.core5.concurrent.Cancellable;
+import org.apache.hc.core5.http.ConnectionReuseStrategy;
+import org.apache.hc.core5.http.HttpException;
+import org.apache.hc.core5.http.HttpHost;
+import org.apache.hc.core5.http.HttpRequest;
+import org.apache.hc.core5.http.HttpResponse;
+import org.apache.hc.core5.http.HttpVersion;
+import org.apache.hc.core5.http.impl.io.HttpRequestExecutor;
+import org.apache.hc.core5.http.io.HttpClientConnection;
+import org.apache.hc.core5.http.message.BasicHttpResponse;
 import org.apache.http.client.config.RequestConfig;
 import org.apache.http.client.entity.EntityBuilder;
 import org.apache.http.client.methods.CloseableHttpResponse;
@@ -46,14 +49,11 @@ import org.apache.http.client.methods.Ht
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.methods.HttpRequestWrapper;
 import org.apache.http.client.protocol.HttpClientContext;
-import org.apache.http.concurrent.Cancellable;
 import org.apache.http.conn.ConnectionKeepAliveStrategy;
 import org.apache.http.conn.ConnectionRequest;
 import org.apache.http.conn.HttpClientConnectionManager;
 import org.apache.http.conn.routing.HttpRoute;
 import org.apache.http.impl.conn.ConnectionShutdownException;
-import org.apache.http.message.BasicHttpResponse;
-import org.apache.http.protocol.HttpRequestExecutor;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -106,7 +106,7 @@ public class TestMinimalClientExec {
                 .setConnectionRequestTimeout(345)
                 .build();
         context.setRequestConfig(config);
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
         final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
         Mockito.when(requestExecutor.execute(
                 Mockito.same(request),
@@ -135,7 +135,7 @@ public class TestMinimalClientExec {
     public void testExecRequestPersistentConnection() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
         final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
 
         Mockito.when(managedConn.isOpen()).thenReturn(Boolean.TRUE);
@@ -145,6 +145,7 @@ public class TestMinimalClientExec {
                 Mockito.<HttpClientConnection>any(),
                 Mockito.<HttpClientContext>any())).thenReturn(response);
         Mockito.when(reuseStrategy.keepAlive(
+                Mockito.same(request),
                 Mockito.same(response),
                 Mockito.<HttpClientContext>any())).thenReturn(Boolean.TRUE);
         Mockito.when(keepAliveStrategy.getKeepAliveDuration(
@@ -167,7 +168,7 @@ public class TestMinimalClientExec {
     public void testExecRequestConnectionRelease() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
         final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
         // The entity is streaming
         response.setEntity(EntityBuilder.create()
@@ -181,6 +182,7 @@ public class TestMinimalClientExec {
                 Mockito.<HttpClientConnection>any(),
                 Mockito.<HttpClientContext>any())).thenReturn(response);
         Mockito.when(reuseStrategy.keepAlive(
+                Mockito.same(request),
                 Mockito.same(response),
                 Mockito.<HttpClientContext>any())).thenReturn(Boolean.FALSE);
 
@@ -210,7 +212,7 @@ public class TestMinimalClientExec {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
         final RequestConfig config = RequestConfig.custom().setSocketTimeout(3000).build();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
         context.setRequestConfig(config);
         final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
         Mockito.when(managedConn.isOpen()).thenReturn(true);
@@ -227,7 +229,7 @@ public class TestMinimalClientExec {
     public void testSocketTimeoutReset() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
         final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
         Mockito.when(managedConn.isOpen()).thenReturn(Boolean.TRUE);
         Mockito.when(requestExecutor.execute(
@@ -243,7 +245,7 @@ public class TestMinimalClientExec {
     public void testExecAbortedPriorToConnectionLease() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
 
         Mockito.when(managedConn.isOpen()).thenReturn(Boolean.FALSE);
         Mockito.when(execAware.isAborted()).thenReturn(Boolean.TRUE);
@@ -259,7 +261,7 @@ public class TestMinimalClientExec {
     public void testExecConnectionRequestFailed() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
 
         Mockito.when(connRequest.get(Mockito.anyInt(), Mockito.<TimeUnit>any()))
                 .thenThrow(new ExecutionException("Opppsie", null));
@@ -270,7 +272,7 @@ public class TestMinimalClientExec {
     public void testExecConnectionShutDown() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
 
         Mockito.when(requestExecutor.execute(
                 Mockito.<HttpRequest>any(),
@@ -284,7 +286,7 @@ public class TestMinimalClientExec {
     public void testExecRuntimeException() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
 
         Mockito.when(requestExecutor.execute(
                 Mockito.<HttpRequest>any(),
@@ -304,7 +306,7 @@ public class TestMinimalClientExec {
     public void testExecHttpException() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
 
         Mockito.when(requestExecutor.execute(
                 Mockito.<HttpRequest>any(),
@@ -324,7 +326,7 @@ public class TestMinimalClientExec {
     public void testExecIOException() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
 
         Mockito.when(requestExecutor.execute(
                 Mockito.<HttpRequest>any(),
@@ -344,7 +346,7 @@ public class TestMinimalClientExec {
     public void absoluteUriIsRewrittenToRelativeBeforeBeingPassedInRequestLine() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpClientContext context = new HttpClientContext();
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("http://bar/test"), target);
 
         final HttpResponse response = Mockito.mock(HttpResponse.class);
         Mockito.when(requestExecutor.execute(

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestProtocolExec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestProtocolExec.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestProtocolExec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestProtocolExec.java Tue Jan 12 20:43:36 2016
@@ -29,8 +29,11 @@ package org.apache.http.impl.execchain;
 import java.io.IOException;
 import java.net.URI;
 
-import org.apache.http.HttpException;
-import org.apache.http.HttpHost;
+import org.apache.hc.core5.http.HttpException;
+import org.apache.hc.core5.http.HttpHost;
+import org.apache.hc.core5.http.message.BasicHttpRequest;
+import org.apache.hc.core5.http.protocol.HttpContext;
+import org.apache.hc.core5.http.protocol.HttpProcessor;
 import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.Credentials;
 import org.apache.http.auth.CredentialsProvider;
@@ -41,9 +44,6 @@ import org.apache.http.client.methods.Ht
 import org.apache.http.client.protocol.HttpClientContext;
 import org.apache.http.conn.routing.HttpRoute;
 import org.apache.http.impl.client.BasicCredentialsProvider;
-import org.apache.http.message.BasicHttpRequest;
-import org.apache.http.protocol.HttpContext;
-import org.apache.http.protocol.HttpProcessor;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -76,7 +76,7 @@ public class TestProtocolExec {
     @Test
     public void testFundamentals() throws Exception {
         final HttpRoute route = new HttpRoute(target);
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("/test"), target);
         final HttpClientContext context = HttpClientContext.create();
 
         final CloseableHttpResponse response = Mockito.mock(CloseableHttpResponse.class);
@@ -104,7 +104,7 @@ public class TestProtocolExec {
     public void testRewriteAbsoluteRequestURI() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpRequestWrapper request = HttpRequestWrapper.wrap(
-                new HttpGet("http://foo/test"));
+                new HttpGet("http://foo/test"), target);
         protocolExec.rewriteRequestURI(request, route);
         Assert.assertEquals(new URI("/test"), request.getURI());
     }
@@ -113,7 +113,7 @@ public class TestProtocolExec {
     public void testRewriteEmptyRequestURI() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpRequestWrapper request = HttpRequestWrapper.wrap(
-                new HttpGet(""));
+                new HttpGet(""), target);
         protocolExec.rewriteRequestURI(request, route);
         Assert.assertEquals(new URI("/"), request.getURI());
     }
@@ -122,7 +122,7 @@ public class TestProtocolExec {
     public void testRewriteAbsoluteRequestURIViaPRoxy() throws Exception {
         final HttpRoute route = new HttpRoute(target, proxy);
         final HttpRequestWrapper request = HttpRequestWrapper.wrap(
-                new HttpGet("http://foo/test"));
+                new HttpGet("http://foo/test"), target);
         protocolExec.rewriteRequestURI(request, route);
         Assert.assertEquals(new URI("http://foo/test"), request.getURI());
     }
@@ -131,7 +131,7 @@ public class TestProtocolExec {
     public void testRewriteRelativeRequestURIViaPRoxy() throws Exception {
         final HttpRoute route = new HttpRoute(target, proxy);
         final HttpRequestWrapper request = HttpRequestWrapper.wrap(
-                new HttpGet("/test"));
+                new HttpGet("/test"), target);
         protocolExec.rewriteRequestURI(request, route);
         Assert.assertEquals(new URI("http://foo:80/test"), request.getURI());
     }
@@ -140,7 +140,7 @@ public class TestProtocolExec {
     public void testHostHeaderUriRequest() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpRequestWrapper request = HttpRequestWrapper.wrap(
-                new HttpGet("http://bar/test"));
+                new HttpGet("http://bar/test"), target);
         final HttpClientContext context = HttpClientContext.create();
         protocolExec.execute(route, request, context, execAware);
         // ProtocolExect should have extracted the host from request URI
@@ -151,7 +151,7 @@ public class TestProtocolExec {
     public void testHostHeaderWhenNonUriRequest() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpRequestWrapper request = HttpRequestWrapper.wrap(
-                new BasicHttpRequest("GET", "http://bar/test"));
+                new BasicHttpRequest("GET", "http://bar/test"), target);
         final HttpClientContext context = HttpClientContext.create();
         protocolExec.execute(route, request, context, execAware);
         // ProtocolExect should have extracted the host from request URI
@@ -162,7 +162,7 @@ public class TestProtocolExec {
     public void testHostHeaderWhenNonUriRequestAndInvalidUri() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpRequestWrapper request = HttpRequestWrapper.wrap(
-                new BasicHttpRequest("GET", "http://bar/test|"));
+                new BasicHttpRequest("GET", "http://bar/test|"), target);
         final HttpClientContext context = HttpClientContext.create();
         protocolExec.execute(route, request, context, execAware);
         // ProtocolExect should have fall back to physical host as request URI
@@ -172,19 +172,19 @@ public class TestProtocolExec {
 
     @Test
     public void testHostHeaderImplicitHost() throws Exception {
-        final HttpRoute route = new HttpRoute(new HttpHost("somehost", 8080));
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(
-                new HttpGet("/test"));
+        final HttpHost somehost = new HttpHost("somehost", 8080);
+        final HttpRoute route = new HttpRoute(somehost);
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("/test"), somehost);
         final HttpClientContext context = HttpClientContext.create();
         protocolExec.execute(route, request, context, execAware);
-        Assert.assertEquals(new HttpHost("somehost", 8080), context.getTargetHost());
+        Assert.assertEquals(somehost, context.getTargetHost());
     }
 
     @Test
     public void testUserInfoInRequestURI() throws Exception {
         final HttpRoute route = new HttpRoute(new HttpHost("somehost", 8080));
         final HttpRequestWrapper request = HttpRequestWrapper.wrap(
-                new HttpGet("http://somefella:secret@bar/test"));
+                new HttpGet("http://somefella:secret@bar/test"), target);
         final HttpClientContext context = HttpClientContext.create();
         context.setCredentialsProvider(new BasicCredentialsProvider());
         protocolExec.execute(route, request, context, execAware);
@@ -199,7 +199,7 @@ public class TestProtocolExec {
     @Test(expected = HttpException.class)
     public void testPostProcessHttpException() throws Exception {
         final HttpRoute route = new HttpRoute(target);
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("/test"), target);
         final HttpClientContext context = HttpClientContext.create();
 
         final CloseableHttpResponse response = Mockito.mock(CloseableHttpResponse.class);
@@ -222,7 +222,7 @@ public class TestProtocolExec {
     @Test(expected = IOException.class)
     public void testPostProcessIOException() throws Exception {
         final HttpRoute route = new HttpRoute(target);
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("/test"), target);
         final HttpClientContext context = HttpClientContext.create();
 
         final CloseableHttpResponse response = Mockito.mock(CloseableHttpResponse.class);
@@ -244,7 +244,7 @@ public class TestProtocolExec {
     @Test(expected = RuntimeException.class)
     public void testPostProcessRuntimeException() throws Exception {
         final HttpRoute route = new HttpRoute(target);
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("/test"), target);
         final HttpClientContext context = HttpClientContext.create();
 
         final CloseableHttpResponse response = Mockito.mock(CloseableHttpResponse.class);

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestRedirectExec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestRedirectExec.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestRedirectExec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestRedirectExec.java Tue Jan 12 20:43:36 2016
@@ -30,13 +30,13 @@ import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 import java.util.List;
 
-import org.apache.http.Header;
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpException;
-import org.apache.http.HttpHost;
-import org.apache.http.HttpRequest;
-import org.apache.http.HttpResponse;
-import org.apache.http.ProtocolException;
+import org.apache.hc.core5.http.Header;
+import org.apache.hc.core5.http.HttpEntity;
+import org.apache.hc.core5.http.HttpException;
+import org.apache.hc.core5.http.HttpHost;
+import org.apache.hc.core5.http.HttpRequest;
+import org.apache.hc.core5.http.HttpResponse;
+import org.apache.hc.core5.http.ProtocolException;
 import org.apache.http.auth.AuthExchange;
 import org.apache.http.client.RedirectException;
 import org.apache.http.client.RedirectStrategy;
@@ -89,7 +89,7 @@ public class TestRedirectExec {
         final HttpGet get = new HttpGet("/test");
         get.addHeader("header", "this");
         get.addHeader("header", "that");
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(get);
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(get, target);
         final HttpClientContext context = HttpClientContext.create();
 
         final CloseableHttpResponse response1 = Mockito.mock(CloseableHttpResponse.class);
@@ -160,7 +160,7 @@ public class TestRedirectExec {
     public void testMaxRedirect() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpGet get = new HttpGet("/test");
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(get);
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(get, target);
         final HttpClientContext context = HttpClientContext.create();
         final RequestConfig config = RequestConfig.custom()
                 .setRedirectsEnabled(true)
@@ -196,7 +196,7 @@ public class TestRedirectExec {
     public void testRelativeRedirect() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpGet get = new HttpGet("/test");
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(get);
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(get, target);
         final HttpClientContext context = HttpClientContext.create();
 
         final CloseableHttpResponse response1 = Mockito.mock(CloseableHttpResponse.class);
@@ -234,7 +234,7 @@ public class TestRedirectExec {
         final HttpHost proxy = new HttpHost("proxy");
         final HttpRoute route = new HttpRoute(target, proxy);
         final HttpGet get = new HttpGet("/test");
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(get);
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(get, target);
         final HttpClientContext context = HttpClientContext.create();
 
         final AuthExchange targetAuthExchange = new AuthExchange();
@@ -288,7 +288,7 @@ public class TestRedirectExec {
     public void testRedirectRuntimeException() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpGet get = new HttpGet("/test");
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(get);
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(get, target);
         final HttpClientContext context = HttpClientContext.create();
 
         final CloseableHttpResponse response1 = Mockito.mock(CloseableHttpResponse.class);
@@ -318,7 +318,7 @@ public class TestRedirectExec {
     public void testRedirectProtocolException() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpGet get = new HttpGet("/test");
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(get);
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(get, target);
         final HttpClientContext context = HttpClientContext.create();
 
         final CloseableHttpResponse response1 = Mockito.mock(CloseableHttpResponse.class);

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestResponseEntityWrapper.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestResponseEntityWrapper.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestResponseEntityWrapper.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestResponseEntityWrapper.java Tue Jan 12 20:43:36 2016
@@ -31,8 +31,8 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.SocketException;
 
-import org.apache.http.HttpEntity;
-import org.apache.http.util.EntityUtils;
+import org.apache.hc.core5.http.HttpEntity;
+import org.apache.hc.core5.http.entity.EntityUtils;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestRetryExec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestRetryExec.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestRetryExec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestRetryExec.java Tue Jan 12 20:43:36 2016
@@ -26,10 +26,14 @@
  */
 package org.apache.http.impl.execchain;
 
-import org.apache.http.Header;
-import org.apache.http.HttpEntityEnclosingRequest;
-import org.apache.http.HttpHost;
-import org.apache.http.HttpRequest;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+import org.apache.hc.core5.http.Header;
+import org.apache.hc.core5.http.HttpHost;
+import org.apache.hc.core5.http.HttpRequest;
+import org.apache.hc.core5.http.protocol.HttpContext;
 import org.apache.http.client.HttpRequestRetryHandler;
 import org.apache.http.client.NonRepeatableRequestException;
 import org.apache.http.client.entity.EntityBuilder;
@@ -39,7 +43,6 @@ import org.apache.http.client.methods.Ht
 import org.apache.http.client.methods.HttpRequestWrapper;
 import org.apache.http.client.protocol.HttpClientContext;
 import org.apache.http.conn.routing.HttpRoute;
-import org.apache.http.protocol.HttpContext;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -49,10 +52,6 @@ import org.mockito.MockitoAnnotations;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-
 @SuppressWarnings({"boxing","static-access"}) // test code
 public class TestRetryExec {
 
@@ -79,7 +78,7 @@ public class TestRetryExec {
         final HttpGet get = new HttpGet("/test");
         get.addHeader("header", "this");
         get.addHeader("header", "that");
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(get);
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(get, target);
         final HttpClientContext context = HttpClientContext.create();
 
         Mockito.when(requestExecutor.execute(
@@ -122,7 +121,7 @@ public class TestRetryExec {
     public void testAbortedRequest() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpGet get = new HttpGet("/test");
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(get);
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(get, target);
         final HttpClientContext context = HttpClientContext.create();
 
         Mockito.when(requestExecutor.execute(
@@ -157,7 +156,7 @@ public class TestRetryExec {
         post.setEntity(EntityBuilder.create()
                 .setStream(new ByteArrayInputStream(new byte[]{}))
                 .build());
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(post);
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(post, target);
         final HttpClientContext context = HttpClientContext.create();
 
         Mockito.when(requestExecutor.execute(
@@ -169,7 +168,7 @@ public class TestRetryExec {
             @Override
             public Object answer(final InvocationOnMock invocationOnMock) throws Throwable {
                 final Object[] args = invocationOnMock.getArguments();
-                final HttpEntityEnclosingRequest req = (HttpEntityEnclosingRequest) args[1];
+                final HttpRequest req = (HttpRequest) args[1];
                 req.getEntity().writeTo(new ByteArrayOutputStream());
                 throw new IOException("Ka-boom");
             }

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestServiceUnavailableRetryExec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestServiceUnavailableRetryExec.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestServiceUnavailableRetryExec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/execchain/TestServiceUnavailableRetryExec.java Tue Jan 12 20:43:36 2016
@@ -26,8 +26,9 @@
  */
 package org.apache.http.impl.execchain;
 
-import org.apache.http.HttpHost;
-import org.apache.http.HttpResponse;
+import org.apache.hc.core5.http.HttpHost;
+import org.apache.hc.core5.http.HttpResponse;
+import org.apache.hc.core5.http.protocol.HttpContext;
 import org.apache.http.client.ServiceUnavailableRetryStrategy;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpExecutionAware;
@@ -35,7 +36,6 @@ import org.apache.http.client.methods.Ht
 import org.apache.http.client.methods.HttpRequestWrapper;
 import org.apache.http.client.protocol.HttpClientContext;
 import org.apache.http.conn.routing.HttpRoute;
-import org.apache.http.protocol.HttpContext;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mock;
@@ -66,7 +66,7 @@ public class TestServiceUnavailableRetry
     public void testFundamentals() throws Exception {
         final HttpRoute route = new HttpRoute(target);
         final HttpGet get = new HttpGet("/test");
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(get);
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(get, target);
         final HttpClientContext context = HttpClientContext.create();
 
         final CloseableHttpResponse response = Mockito.mock(CloseableHttpResponse.class);
@@ -97,7 +97,7 @@ public class TestServiceUnavailableRetry
     @Test(expected = RuntimeException.class)
     public void testStrategyRuntimeException() throws Exception {
         final HttpRoute route = new HttpRoute(target);
-        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("/test"));
+        final HttpRequestWrapper request = HttpRequestWrapper.wrap(new HttpGet("/test"), target);
         final HttpClientContext context = HttpClientContext.create();
 
         final CloseableHttpResponse response = Mockito.mock(CloseableHttpResponse.class);

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/BasicAuthTokenExtractor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/BasicAuthTokenExtractor.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/BasicAuthTokenExtractor.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/BasicAuthTokenExtractor.java Tue Jan 12 20:43:36 2016
@@ -27,15 +27,16 @@
 
 package org.apache.http.localserver;
 
+import java.nio.charset.StandardCharsets;
+
 import org.apache.commons.codec.BinaryDecoder;
 import org.apache.commons.codec.DecoderException;
 import org.apache.commons.codec.binary.Base64;
-import org.apache.http.Header;
-import org.apache.http.HttpException;
-import org.apache.http.HttpHeaders;
-import org.apache.http.HttpRequest;
-import org.apache.http.ProtocolException;
-import org.apache.http.util.EncodingUtils;
+import org.apache.hc.core5.http.Header;
+import org.apache.hc.core5.http.HttpException;
+import org.apache.hc.core5.http.HttpHeaders;
+import org.apache.hc.core5.http.HttpRequest;
+import org.apache.hc.core5.http.ProtocolException;
 
 public class BasicAuthTokenExtractor {
 
@@ -59,9 +60,9 @@ public class BasicAuthTokenExtractor {
             if (authscheme.equalsIgnoreCase("basic")) {
                 final String s = auth.substring(i + 1).trim();
                 try {
-                    final byte[] credsRaw = EncodingUtils.getAsciiBytes(s);
+                    final byte[] credsRaw = s.getBytes(StandardCharsets.US_ASCII);
                     final BinaryDecoder codec = new Base64();
-                    auth = EncodingUtils.getAsciiString(codec.decode(credsRaw));
+                    auth = new String(codec.decode(credsRaw), StandardCharsets.US_ASCII);
                 } catch (final DecoderException ex) {
                     throw new ProtocolException("Malformed BASIC credentials");
                 }

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/EchoHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/EchoHandler.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/EchoHandler.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/EchoHandler.java Tue Jan 12 20:43:36 2016
@@ -30,31 +30,21 @@ package org.apache.http.localserver;
 import java.io.IOException;
 import java.util.Locale;
 
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpEntityEnclosingRequest;
-import org.apache.http.HttpException;
-import org.apache.http.HttpRequest;
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpStatus;
-import org.apache.http.MethodNotSupportedException;
-import org.apache.http.entity.ByteArrayEntity;
-import org.apache.http.protocol.HttpContext;
-import org.apache.http.protocol.HttpRequestHandler;
-import org.apache.http.util.EntityUtils;
-
-
+import org.apache.hc.core5.http.HttpEntity;
+import org.apache.hc.core5.http.HttpException;
+import org.apache.hc.core5.http.HttpRequest;
+import org.apache.hc.core5.http.HttpResponse;
+import org.apache.hc.core5.http.HttpStatus;
+import org.apache.hc.core5.http.MethodNotSupportedException;
+import org.apache.hc.core5.http.entity.ByteArrayEntity;
+import org.apache.hc.core5.http.entity.EntityUtils;
+import org.apache.hc.core5.http.io.HttpRequestHandler;
+import org.apache.hc.core5.http.protocol.HttpContext;
 
 /**
  * A handler that echos the incoming request entity.
- *
- *
- *
- * <!-- empty lines to avoid 'svn diff' problems -->
  */
-public class EchoHandler
-    implements HttpRequestHandler {
-
-    // public default constructor
+public class EchoHandler implements HttpRequestHandler {
 
     /**
      * Handles a request by echoing the incoming request entity.
@@ -82,10 +72,7 @@ public class EchoHandler
                 (method + " not supported by " + getClass().getName());
         }
 
-        HttpEntity entity = null;
-        if (request instanceof HttpEntityEnclosingRequest) {
-            entity = ((HttpEntityEnclosingRequest)request).getEntity();
-        }
+        HttpEntity entity = request.getEntity();
 
         // For some reason, just putting the incoming entity into
         // the response will not work. We have to buffer the message.
@@ -104,8 +91,6 @@ public class EchoHandler
 
         response.setStatusCode(HttpStatus.SC_OK);
         response.setEntity(entity);
+    }
 
-    } // handle
-
-
-} // class EchoHandler
+}

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/LocalServerTestBase.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/LocalServerTestBase.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/LocalServerTestBase.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/LocalServerTestBase.java Tue Jan 12 20:43:36 2016
@@ -29,10 +29,10 @@ package org.apache.http.localserver;
 
 import java.util.concurrent.TimeUnit;
 
-import org.apache.http.HttpHost;
-import org.apache.http.config.SocketConfig;
-import org.apache.http.impl.bootstrap.HttpServer;
-import org.apache.http.impl.bootstrap.ServerBootstrap;
+import org.apache.hc.core5.http.HttpHost;
+import org.apache.hc.core5.http.bootstrap.io.HttpServer;
+import org.apache.hc.core5.http.bootstrap.io.ServerBootstrap;
+import org.apache.hc.core5.http.config.SocketConfig;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClientBuilder;
 import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
@@ -40,8 +40,7 @@ import org.junit.After;
 import org.junit.Before;
 
 /**
- * Base class for tests using {@link LocalTestServer}. The server will not be started
- * per default.
+ * Base class for tests using local test server. The server will not be started per default.
  */
 public abstract class LocalServerTestBase {
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/RandomHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/RandomHandler.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/RandomHandler.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/RandomHandler.java Tue Jan 12 20:43:36 2016
@@ -30,17 +30,17 @@ package org.apache.http.localserver;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.nio.charset.StandardCharsets;
 import java.util.Locale;
 
-import org.apache.http.Consts;
-import org.apache.http.HttpException;
-import org.apache.http.HttpRequest;
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpStatus;
-import org.apache.http.MethodNotSupportedException;
-import org.apache.http.entity.AbstractHttpEntity;
-import org.apache.http.protocol.HttpContext;
-import org.apache.http.protocol.HttpRequestHandler;
+import org.apache.hc.core5.http.HttpException;
+import org.apache.hc.core5.http.HttpRequest;
+import org.apache.hc.core5.http.HttpResponse;
+import org.apache.hc.core5.http.HttpStatus;
+import org.apache.hc.core5.http.MethodNotSupportedException;
+import org.apache.hc.core5.http.entity.AbstractHttpEntity;
+import org.apache.hc.core5.http.io.HttpRequestHandler;
+import org.apache.hc.core5.http.protocol.HttpContext;
 
 /**
  * A handler that generates random data.
@@ -123,7 +123,7 @@ public class RandomHandler implements Ht
 
         /** The range from which to generate random data. */
         private final static byte[] RANGE = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
-                .getBytes(Consts.ASCII);
+                .getBytes(StandardCharsets.US_ASCII);
 
         /** The length of the random data to generate. */
         protected final long length;

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/RequestBasicAuth.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/RequestBasicAuth.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/RequestBasicAuth.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/RequestBasicAuth.java Tue Jan 12 20:43:36 2016
@@ -29,10 +29,10 @@ package org.apache.http.localserver;
 
 import java.io.IOException;
 
-import org.apache.http.HttpException;
-import org.apache.http.HttpRequest;
-import org.apache.http.HttpRequestInterceptor;
-import org.apache.http.protocol.HttpContext;
+import org.apache.hc.core5.http.HttpException;
+import org.apache.hc.core5.http.HttpRequest;
+import org.apache.hc.core5.http.HttpRequestInterceptor;
+import org.apache.hc.core5.http.protocol.HttpContext;
 
 public class RequestBasicAuth implements HttpRequestInterceptor {
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/ResponseBasicUnauthorized.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/ResponseBasicUnauthorized.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/ResponseBasicUnauthorized.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/ResponseBasicUnauthorized.java Tue Jan 12 20:43:36 2016
@@ -29,12 +29,12 @@ package org.apache.http.localserver;
 
 import java.io.IOException;
 
-import org.apache.http.HttpException;
-import org.apache.http.HttpHeaders;
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpResponseInterceptor;
-import org.apache.http.HttpStatus;
-import org.apache.http.protocol.HttpContext;
+import org.apache.hc.core5.http.HttpException;
+import org.apache.hc.core5.http.HttpHeaders;
+import org.apache.hc.core5.http.HttpResponse;
+import org.apache.hc.core5.http.HttpResponseInterceptor;
+import org.apache.hc.core5.http.HttpStatus;
+import org.apache.hc.core5.http.protocol.HttpContext;
 
 public class ResponseBasicUnauthorized implements HttpResponseInterceptor {
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/SSLTestContexts.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/SSLTestContexts.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/SSLTestContexts.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/localserver/SSLTestContexts.java Tue Jan 12 20:43:36 2016
@@ -29,7 +29,7 @@ package org.apache.http.localserver;
 
 import javax.net.ssl.SSLContext;
 
-import org.apache.http.ssl.SSLContexts;
+import org.apache.hc.core5.ssl.SSLContexts;
 
 public class SSLTestContexts {
 

Modified: httpcomponents/httpclient/trunk/httpmime/src/examples/org/apache/http/examples/entity/mime/ClientMultipartFormPost.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpmime/src/examples/org/apache/http/examples/entity/mime/ClientMultipartFormPost.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpmime/src/examples/org/apache/http/examples/entity/mime/ClientMultipartFormPost.java (original)
+++ httpcomponents/httpclient/trunk/httpmime/src/examples/org/apache/http/examples/entity/mime/ClientMultipartFormPost.java Tue Jan 12 20:43:36 2016
@@ -28,16 +28,16 @@ package org.apache.http.examples.entity.
 
 import java.io.File;
 
-import org.apache.http.HttpEntity;
+import org.apache.hc.core5.http.HttpEntity;
+import org.apache.hc.core5.http.entity.ContentType;
+import org.apache.hc.core5.http.entity.EntityUtils;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.ContentType;
 import org.apache.http.entity.mime.MultipartEntityBuilder;
 import org.apache.http.entity.mime.content.FileBody;
 import org.apache.http.entity.mime.content.StringBody;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
-import org.apache.http.util.EntityUtils;
 
 /**
  * Example how to use multipart/form encoded POST request.

Modified: httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/AbstractMultipartForm.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/AbstractMultipartForm.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/AbstractMultipartForm.java (original)
+++ httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/AbstractMultipartForm.java Tue Jan 12 20:43:36 2016
@@ -33,11 +33,12 @@ import java.io.OutputStream;
 import java.nio.ByteBuffer;
 import java.nio.CharBuffer;
 import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 import java.util.List;
 
+import org.apache.hc.core5.util.Args;
+import org.apache.hc.core5.util.ByteArrayBuffer;
 import org.apache.http.entity.mime.content.ContentBody;
-import org.apache.http.util.Args;
-import org.apache.http.util.ByteArrayBuffer;
 
 /**
  * HttpMultipart represents a collection of MIME multipart encoded content bodies. This class is
@@ -69,7 +70,7 @@ abstract class AbstractMultipartForm {
 
     private static void writeBytes(
             final String s, final OutputStream out) throws IOException {
-        final ByteArrayBuffer b = encode(MIME.DEFAULT_CHARSET, s);
+        final ByteArrayBuffer b = encode(StandardCharsets.ISO_8859_1, s);
         writeBytes(b, out);
     }
 
@@ -89,9 +90,9 @@ abstract class AbstractMultipartForm {
         writeBytes(CR_LF, out);
     }
 
-    private static final ByteArrayBuffer FIELD_SEP = encode(MIME.DEFAULT_CHARSET, ": ");
-    private static final ByteArrayBuffer CR_LF = encode(MIME.DEFAULT_CHARSET, "\r\n");
-    private static final ByteArrayBuffer TWO_DASHES = encode(MIME.DEFAULT_CHARSET, "--");
+    private static final ByteArrayBuffer FIELD_SEP = encode(StandardCharsets.ISO_8859_1, ": ");
+    private static final ByteArrayBuffer CR_LF = encode(StandardCharsets.ISO_8859_1, "\r\n");
+    private static final ByteArrayBuffer TWO_DASHES = encode(StandardCharsets.ISO_8859_1, "--");
 
     final Charset charset;
     final String boundary;
@@ -99,14 +100,14 @@ abstract class AbstractMultipartForm {
     /**
      * Creates an instance with the specified settings.
      *
-     * @param charset the character set to use. May be {@code null}, in which case {@link MIME#DEFAULT_CHARSET} - i.e. US-ASCII - is used.
+     * @param charset the character set to use. May be {@code null}, in which case {@link StandardCharsets#ISO_8859_1} is used.
      * @param boundary to use  - must not be {@code null}
      * @throws IllegalArgumentException if charset is null or boundary is null
      */
     public AbstractMultipartForm(final Charset charset, final String boundary) {
         super();
         Args.notNull(boundary, "Multipart boundary");
-        this.charset = charset != null ? charset : MIME.DEFAULT_CHARSET;
+        this.charset = charset != null ? charset : StandardCharsets.ISO_8859_1;
         this.boundary = boundary;
     }
 

Modified: httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/FormBodyPart.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/FormBodyPart.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/FormBodyPart.java (original)
+++ httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/FormBodyPart.java Tue Jan 12 20:43:36 2016
@@ -27,8 +27,8 @@
 
 package org.apache.http.entity.mime;
 
+import org.apache.hc.core5.util.Args;
 import org.apache.http.entity.mime.content.ContentBody;
-import org.apache.http.util.Args;
 
 /**
  * FormBodyPart class represents a content body that can be used as a part of multipart encoded

Modified: httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/FormBodyPartBuilder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/FormBodyPartBuilder.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/FormBodyPartBuilder.java (original)
+++ httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/FormBodyPartBuilder.java Tue Jan 12 20:43:36 2016
@@ -29,11 +29,11 @@ package org.apache.http.entity.mime;
 
 import java.util.List;
 
-import org.apache.http.entity.ContentType;
+import org.apache.hc.core5.http.entity.ContentType;
+import org.apache.hc.core5.util.Args;
+import org.apache.hc.core5.util.Asserts;
 import org.apache.http.entity.mime.content.AbstractContentBody;
 import org.apache.http.entity.mime.content.ContentBody;
-import org.apache.http.util.Args;
-import org.apache.http.util.Asserts;
 
 /**
  * Builder for individual {@link org.apache.http.entity.mime.FormBodyPart}s.

Modified: httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/HttpRFC6532Multipart.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/HttpRFC6532Multipart.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/HttpRFC6532Multipart.java (original)
+++ httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/HttpRFC6532Multipart.java Tue Jan 12 20:43:36 2016
@@ -30,6 +30,7 @@ package org.apache.http.entity.mime;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 import java.util.List;
 
 /**
@@ -64,7 +65,7 @@ class HttpRFC6532Multipart extends Abstr
         // For RFC6532, we output all fields with UTF-8 encoding.
         final Header header = part.getHeader();
         for (final MinimalField field: header) {
-            writeField(field, MIME.UTF8_CHARSET, out);
+            writeField(field, StandardCharsets.UTF_8, out);
         }
     }
 

Modified: httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MIME.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MIME.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MIME.java (original)
+++ httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MIME.java Tue Jan 12 20:43:36 2016
@@ -27,10 +27,6 @@
 
 package org.apache.http.entity.mime;
 
-import org.apache.http.Consts;
-
-import java.nio.charset.Charset;
-
 /**
  *
  * @since 4.0
@@ -44,10 +40,4 @@ public final class MIME {
     public static final String ENC_8BIT              = "8bit";
     public static final String ENC_BINARY            = "binary";
 
-    /** The default character set to be used, i.e. "US-ASCII" */
-    public static final Charset DEFAULT_CHARSET      = Consts.ASCII;
-
-    /** UTF-8 is used for RFC6532 */
-    public static final Charset UTF8_CHARSET         = Consts.UTF_8;
-
 }

Modified: httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntityBuilder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntityBuilder.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntityBuilder.java (original)
+++ httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MultipartEntityBuilder.java Tue Jan 12 20:43:36 2016
@@ -35,16 +35,16 @@ import java.util.Collections;
 import java.util.List;
 import java.util.Random;
 
-import org.apache.http.HttpEntity;
-import org.apache.http.NameValuePair;
-import org.apache.http.entity.ContentType;
+import org.apache.hc.core5.http.HttpEntity;
+import org.apache.hc.core5.http.NameValuePair;
+import org.apache.hc.core5.http.entity.ContentType;
+import org.apache.hc.core5.http.message.BasicNameValuePair;
+import org.apache.hc.core5.util.Args;
 import org.apache.http.entity.mime.content.ByteArrayBody;
 import org.apache.http.entity.mime.content.ContentBody;
 import org.apache.http.entity.mime.content.FileBody;
 import org.apache.http.entity.mime.content.InputStreamBody;
 import org.apache.http.entity.mime.content.StringBody;
-import org.apache.http.message.BasicNameValuePair;
-import org.apache.http.util.Args;
 
 /**
  * Builder for multipart {@link HttpEntity}s.

Modified: httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MultipartFormEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MultipartFormEntity.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MultipartFormEntity.java (original)
+++ httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/MultipartFormEntity.java Tue Jan 12 20:43:36 2016
@@ -32,18 +32,17 @@ import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.util.Set;
 
-import org.apache.http.ContentTooLongException;
-import org.apache.http.Header;
-import org.apache.http.HttpEntity;
-import org.apache.http.entity.ContentType;
-import org.apache.http.message.BasicHeader;
-import org.apache.http.protocol.HTTP;
+import org.apache.hc.core5.http.ContentTooLongException;
+import org.apache.hc.core5.http.HttpEntity;
+import org.apache.hc.core5.http.TrailerSupplier;
+import org.apache.hc.core5.http.entity.ContentType;
 
 class MultipartFormEntity implements HttpEntity {
 
     private final AbstractMultipartForm multipart;
-    private final Header contentType;
+    private final ContentType contentType;
     private final long contentLength;
 
     MultipartFormEntity(
@@ -52,7 +51,7 @@ class MultipartFormEntity implements Htt
             final long contentLength) {
         super();
         this.multipart = multipart;
-        this.contentType = new BasicHeader(HTTP.CONTENT_TYPE, contentType.toString());
+        this.contentType = contentType;
         this.contentLength = contentLength;
     }
 
@@ -81,20 +80,16 @@ class MultipartFormEntity implements Htt
     }
 
     @Override
-    public Header getContentType() {
-        return this.contentType;
+    public String getContentType() {
+        return this.contentType != null ? this.contentType.toString() : null;
     }
 
     @Override
-    public Header getContentEncoding() {
+    public String getContentEncoding() {
         return null;
     }
 
     @Override
-    public void consumeContent() {
-    }
-
-    @Override
     public InputStream getContent() throws IOException {
         if (this.contentLength < 0) {
             throw new ContentTooLongException("Content length is unknown");
@@ -112,4 +107,14 @@ class MultipartFormEntity implements Htt
         this.multipart.writeTo(outstream);
     }
 
+    @Override
+    public TrailerSupplier getTrailers() {
+        return null;
+    }
+
+    @Override
+    public Set<String> getTrailerNames() {
+        return null;
+    }
+
 }

Modified: httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/AbstractContentBody.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/AbstractContentBody.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/AbstractContentBody.java (original)
+++ httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/AbstractContentBody.java Tue Jan 12 20:43:36 2016
@@ -29,8 +29,8 @@ package org.apache.http.entity.mime.cont
 
 import java.nio.charset.Charset;
 
-import org.apache.http.entity.ContentType;
-import org.apache.http.util.Args;
+import org.apache.hc.core5.http.entity.ContentType;
+import org.apache.hc.core5.util.Args;
 
 /**
  *

Modified: httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/ByteArrayBody.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/ByteArrayBody.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/ByteArrayBody.java (original)
+++ httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/ByteArrayBody.java Tue Jan 12 20:43:36 2016
@@ -29,9 +29,9 @@ package org.apache.http.entity.mime.cont
 import java.io.IOException;
 import java.io.OutputStream;
 
-import org.apache.http.entity.ContentType;
+import org.apache.hc.core5.http.entity.ContentType;
+import org.apache.hc.core5.util.Args;
 import org.apache.http.entity.mime.MIME;
-import org.apache.http.util.Args;
 
 /**
  * Binary body part backed by a byte array.

Modified: httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/FileBody.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/FileBody.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/FileBody.java (original)
+++ httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/FileBody.java Tue Jan 12 20:43:36 2016
@@ -33,9 +33,9 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 
-import org.apache.http.entity.ContentType;
+import org.apache.hc.core5.http.entity.ContentType;
+import org.apache.hc.core5.util.Args;
 import org.apache.http.entity.mime.MIME;
-import org.apache.http.util.Args;
 
 /**
  * Binary body part backed by a file.

Modified: httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/InputStreamBody.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/InputStreamBody.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/InputStreamBody.java (original)
+++ httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/InputStreamBody.java Tue Jan 12 20:43:36 2016
@@ -31,9 +31,9 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 
-import org.apache.http.entity.ContentType;
+import org.apache.hc.core5.http.entity.ContentType;
+import org.apache.hc.core5.util.Args;
 import org.apache.http.entity.mime.MIME;
-import org.apache.http.util.Args;
 
 /**
  * Binary body part backed by an input stream.

Modified: httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/StringBody.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/StringBody.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/StringBody.java (original)
+++ httpcomponents/httpclient/trunk/httpmime/src/main/java/org/apache/http/entity/mime/content/StringBody.java Tue Jan 12 20:43:36 2016
@@ -34,11 +34,11 @@ import java.io.InputStreamReader;
 import java.io.OutputStream;
 import java.io.Reader;
 import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 
-import org.apache.http.Consts;
-import org.apache.http.entity.ContentType;
+import org.apache.hc.core5.http.entity.ContentType;
+import org.apache.hc.core5.util.Args;
 import org.apache.http.entity.mime.MIME;
-import org.apache.http.util.Args;
 
 /**
  * Text body part backed by a byte array.
@@ -58,14 +58,14 @@ public class StringBody extends Abstract
         super(contentType);
         Args.notNull(text, "Text");
         final Charset charset = contentType.getCharset();
-        this.content = text.getBytes(charset != null ? charset : Consts.ASCII);
+        this.content = text.getBytes(charset != null ? charset : StandardCharsets.US_ASCII);
     }
 
     public Reader getReader() {
         final Charset charset = getContentType().getCharset();
         return new InputStreamReader(
                 new ByteArrayInputStream(this.content),
-                charset != null ? charset : Consts.ASCII);
+                charset != null ? charset : StandardCharsets.US_ASCII);
     }
 
     @Override




Mime
View raw message