hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1724315 [6/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/s...
Date Tue, 12 Jan 2016 20:43:42 GMT
Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestRFC5861Compliance.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestRFC5861Compliance.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestRFC5861Compliance.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestRFC5861Compliance.java Tue Jan 12 20:43:36 2016
@@ -33,15 +33,15 @@ import static org.junit.Assert.assertTru
 import java.io.ByteArrayInputStream;
 import java.util.Date;
 
-import org.apache.http.Header;
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpStatus;
-import org.apache.http.HttpVersion;
+import org.apache.hc.core5.http.Header;
+import org.apache.hc.core5.http.HttpEntity;
+import org.apache.hc.core5.http.HttpResponse;
+import org.apache.hc.core5.http.HttpStatus;
+import org.apache.hc.core5.http.HttpVersion;
+import org.apache.hc.core5.http.entity.InputStreamEntity;
+import org.apache.hc.core5.http.message.BasicHttpRequest;
 import org.apache.http.client.methods.HttpRequestWrapper;
 import org.apache.http.client.utils.DateUtils;
-import org.apache.http.entity.InputStreamEntity;
-import org.apache.http.message.BasicHttpRequest;
 import org.junit.Test;
 
 /**
@@ -70,13 +70,13 @@ public class TestRFC5861Compliance exten
     public void testStaleIfErrorInResponseIsTrueReturnsStaleEntryWithWarning()
             throws Exception{
         final Date tenSecondsAgo = new Date(new Date().getTime() - 10 * 1000L);
-        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
         final HttpResponse resp1 = HttpTestUtils.make200Response(tenSecondsAgo,
                 "public, max-age=5, stale-if-error=60");
 
         backendExpectsAnyRequestAndReturn(resp1);
 
-        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
         final HttpResponse resp2 = HttpTestUtils.make500Response();
 
         backendExpectsAnyRequestAndReturn(resp2);
@@ -93,13 +93,13 @@ public class TestRFC5861Compliance exten
     public void testConsumesErrorResponseWhenServingStale()
             throws Exception{
         final Date tenSecondsAgo = new Date(new Date().getTime() - 10 * 1000L);
-        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
         final HttpResponse resp1 = HttpTestUtils.make200Response(tenSecondsAgo,
                 "public, max-age=5, stale-if-error=60");
 
         backendExpectsAnyRequestAndReturn(resp1);
 
-        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
         final HttpResponse resp2 = HttpTestUtils.make500Response();
         final byte[] body101 = HttpTestUtils.getRandomBytes(101);
         final ByteArrayInputStream buf = new ByteArrayInputStream(body101);
@@ -121,13 +121,13 @@ public class TestRFC5861Compliance exten
     public void testStaleIfErrorInResponseYieldsToMustRevalidate()
             throws Exception{
         final Date tenSecondsAgo = new Date(new Date().getTime() - 10 * 1000L);
-        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
         final HttpResponse resp1 = HttpTestUtils.make200Response(tenSecondsAgo,
                 "public, max-age=5, stale-if-error=60, must-revalidate");
 
         backendExpectsAnyRequestAndReturn(resp1);
 
-        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
         final HttpResponse resp2 = HttpTestUtils.make500Response();
 
         backendExpectsAnyRequestAndReturn(resp2);
@@ -145,13 +145,13 @@ public class TestRFC5861Compliance exten
             throws Exception{
         assertTrue(config.isSharedCache());
         final Date tenSecondsAgo = new Date(new Date().getTime() - 10 * 1000L);
-        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
         final HttpResponse resp1 = HttpTestUtils.make200Response(tenSecondsAgo,
                 "public, max-age=5, stale-if-error=60, proxy-revalidate");
 
         backendExpectsAnyRequestAndReturn(resp1);
 
-        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
         final HttpResponse resp2 = HttpTestUtils.make500Response();
 
         backendExpectsAnyRequestAndReturn(resp2);
@@ -172,13 +172,13 @@ public class TestRFC5861Compliance exten
         impl = new CachingExec(mockBackend, new BasicHttpCache(configUnshared), configUnshared);
 
         final Date tenSecondsAgo = new Date(new Date().getTime() - 10 * 1000L);
-        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
         final HttpResponse resp1 = HttpTestUtils.make200Response(tenSecondsAgo,
                 "public, max-age=5, stale-if-error=60, proxy-revalidate");
 
         backendExpectsAnyRequestAndReturn(resp1);
 
-        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
         final HttpResponse resp2 = HttpTestUtils.make500Response();
 
         backendExpectsAnyRequestAndReturn(resp2);
@@ -195,13 +195,13 @@ public class TestRFC5861Compliance exten
     public void testStaleIfErrorInResponseYieldsToExplicitFreshnessRequest()
             throws Exception{
         final Date tenSecondsAgo = new Date(new Date().getTime() - 10 * 1000L);
-        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
         final HttpResponse resp1 = HttpTestUtils.make200Response(tenSecondsAgo,
                 "public, max-age=5, stale-if-error=60");
 
         backendExpectsAnyRequestAndReturn(resp1);
 
-        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
         req2.setHeader("Cache-Control","min-fresh=2");
         final HttpResponse resp2 = HttpTestUtils.make500Response();
 
@@ -219,13 +219,13 @@ public class TestRFC5861Compliance exten
     public void testStaleIfErrorInRequestIsTrueReturnsStaleEntryWithWarning()
             throws Exception{
         final Date tenSecondsAgo = new Date(new Date().getTime() - 10 * 1000L);
-        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
         final HttpResponse resp1 = HttpTestUtils.make200Response(tenSecondsAgo,
                 "public, max-age=5");
 
         backendExpectsAnyRequestAndReturn(resp1);
 
-        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
         req2.setHeader("Cache-Control","public, stale-if-error=60");
         final HttpResponse resp2 = HttpTestUtils.make500Response();
 
@@ -243,14 +243,14 @@ public class TestRFC5861Compliance exten
     public void testStaleIfErrorInRequestIsTrueReturnsStaleNonRevalidatableEntryWithWarning()
         throws Exception {
         final Date tenSecondsAgo = new Date(new Date().getTime() - 10 * 1000L);
-        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
         final HttpResponse resp1 = HttpTestUtils.make200Response();
         resp1.setHeader("Date", DateUtils.formatDate(tenSecondsAgo));
         resp1.setHeader("Cache-Control", "public, max-age=5");
 
         backendExpectsAnyRequestAndReturn(resp1);
 
-        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
         req2.setHeader("Cache-Control", "public, stale-if-error=60");
         final HttpResponse resp2 = HttpTestUtils.make500Response();
 
@@ -269,13 +269,13 @@ public class TestRFC5861Compliance exten
             throws Exception{
         final Date now = new Date();
         final Date tenSecondsAgo = new Date(now.getTime() - 10 * 1000L);
-        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
         final HttpResponse resp1 = HttpTestUtils.make200Response(tenSecondsAgo,
                 "public, max-age=5, stale-if-error=2");
 
         backendExpectsAnyRequestAndReturn(resp1);
 
-        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
         final HttpResponse resp2 = HttpTestUtils.make500Response();
 
         backendExpectsAnyRequestAndReturn(resp2);
@@ -294,13 +294,13 @@ public class TestRFC5861Compliance exten
             throws Exception{
         final Date now = new Date();
         final Date tenSecondsAgo = new Date(now.getTime() - 10 * 1000L);
-        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
         final HttpResponse resp1 = HttpTestUtils.make200Response(tenSecondsAgo,
                 "public, max-age=5");
 
         backendExpectsAnyRequestAndReturn(resp1);
 
-        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
         req2.setHeader("Cache-Control","stale-if-error=2");
         final HttpResponse resp2 = HttpTestUtils.make500Response();
 
@@ -335,7 +335,7 @@ public class TestRFC5861Compliance exten
         impl = new CachingExec(mockBackend, cache, config, new AsynchronousValidator(config));
 
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(
-                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1));
+                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1), host);
         final HttpResponse resp1 = HttpTestUtils.make200Response();
         final Date now = new Date();
         final Date tenSecondsAgo = new Date(now.getTime() - 10 * 1000L);
@@ -346,7 +346,7 @@ public class TestRFC5861Compliance exten
         backendExpectsAnyRequestAndReturn(resp1).times(1,2);
 
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(
-                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1));
+                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1), host);
 
         replayMocks();
         impl.execute(route, req1, context, null);
@@ -380,7 +380,7 @@ public class TestRFC5861Compliance exten
         impl = new CachingExec(mockBackend, cache, config, new AsynchronousValidator(config));
 
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new BasicHttpRequest("GET", "/",
-            HttpVersion.HTTP_1_1));
+            HttpVersion.HTTP_1_1), host);
         final HttpResponse resp1 = HttpTestUtils.make200Response();
         final Date now = new Date();
         final Date tenSecondsAgo = new Date(now.getTime() - 10 * 1000L);
@@ -390,7 +390,7 @@ public class TestRFC5861Compliance exten
         backendExpectsAnyRequestAndReturn(resp1).times(1, 2);
 
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new BasicHttpRequest("GET", "/",
-            HttpVersion.HTTP_1_1));
+            HttpVersion.HTTP_1_1), host);
 
         replayMocks();
         impl.execute(route, req1, context, null);
@@ -423,7 +423,7 @@ public class TestRFC5861Compliance exten
         impl = new CachingExec(mockBackend, cache, config, new AsynchronousValidator(config));
 
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(
-                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1));
+                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1), host);
         final HttpResponse resp1 = HttpTestUtils.make200Response();
         final Date now = new Date();
         final Date tenSecondsAgo = new Date(now.getTime() - 10 * 1000L);
@@ -434,7 +434,7 @@ public class TestRFC5861Compliance exten
         backendExpectsAnyRequestAndReturn(resp1).times(1,2);
 
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(
-                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1));
+                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1), host);
         req2.setHeader("If-None-Match","\"etag\"");
 
         replayMocks();
@@ -471,7 +471,7 @@ public class TestRFC5861Compliance exten
         impl = new CachingExec(mockBackend, cache, config);
 
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(
-                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1));
+                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1), host);
         final HttpResponse resp1 = HttpTestUtils.make200Response();
         resp1.setHeader("Cache-Control", "public, max-age=5, stale-while-revalidate=15, must-revalidate");
         resp1.setHeader("ETag","\"etag\"");
@@ -480,7 +480,7 @@ public class TestRFC5861Compliance exten
         backendExpectsAnyRequestAndReturn(resp1);
 
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(
-                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1));
+                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1), host);
         final HttpResponse resp2 = HttpTestUtils.make200Response();
         resp2.setHeader("Cache-Control", "public, max-age=5, stale-while-revalidate=15, must-revalidate");
         resp2.setHeader("ETag","\"etag\"");
@@ -522,7 +522,7 @@ public class TestRFC5861Compliance exten
         impl = new CachingExec(mockBackend, cache, config);
 
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(
-                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1));
+                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1), host);
         final HttpResponse resp1 = HttpTestUtils.make200Response();
         resp1.setHeader("Cache-Control", "public, max-age=5, stale-while-revalidate=15, proxy-revalidate");
         resp1.setHeader("ETag","\"etag\"");
@@ -531,7 +531,7 @@ public class TestRFC5861Compliance exten
         backendExpectsAnyRequestAndReturn(resp1);
 
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(
-                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1));
+                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1), host);
         final HttpResponse resp2 = HttpTestUtils.make200Response();
         resp2.setHeader("Cache-Control", "public, max-age=5, stale-while-revalidate=15, proxy-revalidate");
         resp2.setHeader("ETag","\"etag\"");
@@ -573,7 +573,7 @@ public class TestRFC5861Compliance exten
         impl = new CachingExec(mockBackend, cache, config);
 
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(
-                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1));
+                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1), host);
         final HttpResponse resp1 = HttpTestUtils.make200Response();
         resp1.setHeader("Cache-Control", "public, max-age=5, stale-while-revalidate=15");
         resp1.setHeader("ETag","\"etag\"");
@@ -582,7 +582,7 @@ public class TestRFC5861Compliance exten
         backendExpectsAnyRequestAndReturn(resp1);
 
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(
-                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1));
+                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1), host);
         req2.setHeader("Cache-Control","min-fresh=2");
         final HttpResponse resp2 = HttpTestUtils.make200Response();
         resp2.setHeader("Cache-Control", "public, max-age=5, stale-while-revalidate=15");

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestRequestProtocolCompliance.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestRequestProtocolCompliance.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestRequestProtocolCompliance.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestRequestProtocolCompliance.java Tue Jan 12 20:43:36 2016
@@ -32,24 +32,25 @@ import static org.junit.Assert.assertTru
 
 import java.util.Arrays;
 
-import org.apache.http.HttpEntityEnclosingRequest;
-import org.apache.http.HttpRequest;
-import org.apache.http.HttpVersion;
-import org.apache.http.ProtocolVersion;
+import org.apache.hc.core5.http.HttpHost;
+import org.apache.hc.core5.http.HttpRequest;
+import org.apache.hc.core5.http.HttpVersion;
+import org.apache.hc.core5.http.ProtocolVersion;
+import org.apache.hc.core5.http.message.BasicHttpRequest;
 import org.apache.http.client.methods.HttpPut;
 import org.apache.http.client.methods.HttpRequestWrapper;
-import org.apache.http.message.BasicHttpEntityEnclosingRequest;
-import org.apache.http.message.BasicHttpRequest;
 import org.junit.Before;
 import org.junit.Test;
 
 public class TestRequestProtocolCompliance {
 
+    private HttpHost host;
     private RequestProtocolCompliance impl;
     private HttpRequest req;
 
     @Before
     public void setUp() {
+        host = new HttpHost("foo.example.com", 80);
         req = HttpTestUtils.makeDefaultRequest();
         impl = new RequestProtocolCompliance(false);
     }
@@ -84,27 +85,25 @@ public class TestRequestProtocolComplian
 
     @Test
     public void doesNotModifyACompliantRequest() throws Exception {
-        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(req);
+        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(req, host);
         impl.makeRequestCompliant(wrapper);
         assertTrue(HttpTestUtils.equivalent(req, wrapper));
     }
 
     @Test
     public void removesEntityFromTRACERequest() throws Exception {
-        final HttpEntityEnclosingRequest reqst =
-            new BasicHttpEntityEnclosingRequest("TRACE", "/", HttpVersion.HTTP_1_1);
-        reqst.setEntity(HttpTestUtils.makeBody(50));
-        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(reqst);
-        impl.makeRequestCompliant(wrapper);
-        if (wrapper instanceof HttpEntityEnclosingRequest) {
-            assertNull(((HttpEntityEnclosingRequest) wrapper).getEntity());
-        }
+        final HttpRequest request =
+            new BasicHttpRequest("TRACE", "/", HttpVersion.HTTP_1_1);
+        request.setEntity(HttpTestUtils.makeBody(50));
+        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(request, host);
+        impl.makeRequestCompliant(wrapper);
+        assertNull(wrapper.getEntity());
     }
 
     @Test
     public void upgrades1_0RequestTo1_1() throws Exception {
         req = new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_0);
-        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(req);
+        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(req, host);
         impl.makeRequestCompliant(wrapper);
         assertEquals(HttpVersion.HTTP_1_1, wrapper.getProtocolVersion());
     }
@@ -113,7 +112,7 @@ public class TestRequestProtocolComplian
     public void downgrades1_2RequestTo1_1() throws Exception {
         final ProtocolVersion HTTP_1_2 = new ProtocolVersion("HTTP", 1, 2);
         req = new BasicHttpRequest("GET", "/", HTTP_1_2);
-        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(req);
+        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(req, host);
         impl.makeRequestCompliant(wrapper);
         assertEquals(HttpVersion.HTTP_1_1, wrapper.getProtocolVersion());
     }
@@ -122,7 +121,7 @@ public class TestRequestProtocolComplian
     public void stripsMinFreshFromRequestIfNoCachePresent()
         throws Exception {
         req.setHeader("Cache-Control", "no-cache, min-fresh=10");
-        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(req);
+        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(req, host);
         impl.makeRequestCompliant(wrapper);
         assertEquals("no-cache",
                 wrapper.getFirstHeader("Cache-Control").getValue());
@@ -132,7 +131,7 @@ public class TestRequestProtocolComplian
     public void stripsMaxFreshFromRequestIfNoCachePresent()
         throws Exception {
         req.setHeader("Cache-Control", "no-cache, max-stale=10");
-        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(req);
+        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(req, host);
         impl.makeRequestCompliant(wrapper);
         assertEquals("no-cache",
                 wrapper.getFirstHeader("Cache-Control").getValue());
@@ -142,7 +141,7 @@ public class TestRequestProtocolComplian
     public void stripsMaxAgeFromRequestIfNoCachePresent()
         throws Exception {
         req.setHeader("Cache-Control", "no-cache, max-age=10");
-        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(req);
+        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(req, host);
         impl.makeRequestCompliant(wrapper);
         assertEquals("no-cache",
                 wrapper.getFirstHeader("Cache-Control").getValue());
@@ -152,7 +151,7 @@ public class TestRequestProtocolComplian
     public void doesNotStripMinFreshFromRequestWithoutNoCache()
         throws Exception {
         req.setHeader("Cache-Control", "min-fresh=10");
-        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(req);
+        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(req, host);
         impl.makeRequestCompliant(wrapper);
         assertEquals("min-fresh=10",
                 wrapper.getFirstHeader("Cache-Control").getValue());
@@ -162,7 +161,7 @@ public class TestRequestProtocolComplian
     public void correctlyStripsMinFreshFromMiddleIfNoCache()
         throws Exception {
         req.setHeader("Cache-Control", "no-cache,min-fresh=10,no-store");
-        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(req);
+        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(req, host);
         impl.makeRequestCompliant(wrapper);
         assertEquals("no-cache,no-store",
                 wrapper.getFirstHeader("Cache-Control").getValue());

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestResponseCachingPolicy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestResponseCachingPolicy.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestResponseCachingPolicy.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestResponseCachingPolicy.java Tue Jan 12 20:43:36 2016
@@ -29,16 +29,16 @@ package org.apache.http.impl.client.cach
 import java.util.Date;
 import java.util.Random;
 
-import org.apache.http.HttpRequest;
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpStatus;
-import org.apache.http.HttpVersion;
-import org.apache.http.ProtocolVersion;
+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.HttpVersion;
+import org.apache.hc.core5.http.ProtocolVersion;
+import org.apache.hc.core5.http.message.BasicHttpRequest;
+import org.apache.hc.core5.http.message.BasicHttpResponse;
+import org.apache.hc.core5.http.message.BasicStatusLine;
 import org.apache.http.client.methods.HttpOptions;
 import org.apache.http.client.utils.DateUtils;
-import org.apache.http.message.BasicHttpRequest;
-import org.apache.http.message.BasicHttpResponse;
-import org.apache.http.message.BasicStatusLine;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestResponseProtocolCompliance.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestResponseProtocolCompliance.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestResponseProtocolCompliance.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestResponseProtocolCompliance.java Tue Jan 12 20:43:36 2016
@@ -32,29 +32,32 @@ import static junit.framework.TestCase.a
 import java.io.ByteArrayInputStream;
 import java.util.Date;
 
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpEntityEnclosingRequest;
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpStatus;
-import org.apache.http.HttpVersion;
+import org.apache.hc.core5.http.HttpEntity;
+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.HttpStatus;
+import org.apache.hc.core5.http.HttpVersion;
+import org.apache.hc.core5.http.entity.ByteArrayEntity;
+import org.apache.hc.core5.http.entity.InputStreamEntity;
+import org.apache.hc.core5.http.message.BasicHttpRequest;
+import org.apache.hc.core5.http.message.BasicHttpResponse;
 import org.apache.http.client.ClientProtocolException;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.methods.HttpHead;
 import org.apache.http.client.methods.HttpRequestWrapper;
 import org.apache.http.client.utils.DateUtils;
-import org.apache.http.entity.ByteArrayEntity;
-import org.apache.http.entity.InputStreamEntity;
-import org.apache.http.message.BasicHttpEntityEnclosingRequest;
-import org.apache.http.message.BasicHttpResponse;
 import org.junit.Before;
 import org.junit.Test;
 
 public class TestResponseProtocolCompliance {
 
+    private HttpHost host;
     private ResponseProtocolCompliance impl;
 
     @Before
     public void setUp() {
+        host = new HttpHost("foo.example.com", 80);
         impl = new ResponseProtocolCompliance();
     }
 
@@ -88,7 +91,7 @@ public class TestResponseProtocolComplia
 
     @Test
     public void consumesBodyIfOriginSendsOneInResponseToHEAD() throws Exception {
-        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(new HttpHead("http://foo.example.com/"));
+        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(new HttpHead("http://foo.example.com/"), host);
         final int nbytes = 128;
         final HttpResponse resp = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
         setMinimalResponseHeaders(resp);
@@ -105,7 +108,7 @@ public class TestResponseProtocolComplia
 
     @Test(expected=ClientProtocolException.class)
     public void throwsExceptionIfOriginReturnsPartialResponseWhenNotRequested() throws Exception {
-        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(new HttpGet("http://foo.example.com/"));
+        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(new HttpGet("http://foo.example.com/"), host);
         final int nbytes = 128;
         final HttpResponse resp = makePartialResponse(nbytes);
         resp.setEntity(HttpTestUtils.makeBody(nbytes));
@@ -115,7 +118,7 @@ public class TestResponseProtocolComplia
 
     @Test
     public void consumesPartialContentFromOriginEvenIfNotRequested() throws Exception {
-        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(new HttpGet("http://foo.example.com/"));
+        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(new HttpGet("http://foo.example.com/"), host);
         final int nbytes = 128;
         final HttpResponse resp = makePartialResponse(nbytes);
 
@@ -132,13 +135,13 @@ public class TestResponseProtocolComplia
 
     @Test
     public void consumesBodyOf100ContinueResponseIfItArrives() throws Exception {
-        final HttpEntityEnclosingRequest req = new BasicHttpEntityEnclosingRequest("POST", "/", HttpVersion.HTTP_1_1);
+        final HttpRequest req = new BasicHttpRequest("POST", "/", HttpVersion.HTTP_1_1);
         final int nbytes = 128;
         req.setHeader("Content-Length","" + nbytes);
         req.setHeader("Content-Type", "application/octet-stream");
         final HttpEntity postBody = new ByteArrayEntity(HttpTestUtils.getRandomBytes(nbytes));
         req.setEntity(postBody);
-        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(req);
+        final HttpRequestWrapper wrapper = HttpRequestWrapper.wrap(req, host);
 
         final HttpResponse resp = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_CONTINUE, "Continue");
         final Flag closed = new Flag();

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestSizeLimitedResponseReader.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestSizeLimitedResponseReader.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestSizeLimitedResponseReader.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestSizeLimitedResponseReader.java Tue Jan 12 20:43:36 2016
@@ -30,17 +30,17 @@ import java.io.IOException;
 import java.lang.reflect.Proxy;
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpRequest;
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpStatus;
-import org.apache.http.HttpVersion;
+import org.apache.hc.core5.http.HttpEntity;
+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.HttpVersion;
+import org.apache.hc.core5.http.entity.ByteArrayEntity;
+import org.apache.hc.core5.http.entity.EntityUtils;
+import org.apache.hc.core5.http.entity.StringEntity;
+import org.apache.hc.core5.http.message.BasicHttpResponse;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpGet;
-import org.apache.http.entity.ByteArrayEntity;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.message.BasicHttpResponse;
-import org.apache.http.util.EntityUtils;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestStaleWhileRevalidationReleasesConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestStaleWhileRevalidationReleasesConnection.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestStaleWhileRevalidationReleasesConnection.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestStaleWhileRevalidationReleasesConnection.java Tue Jan 12 20:43:36 2016
@@ -30,30 +30,30 @@ import static org.junit.Assert.assertEqu
 import static org.junit.Assert.assertNull;
 
 import java.io.IOException;
+import java.nio.charset.StandardCharsets;
 import java.util.Locale;
 
-import org.apache.http.Consts;
-import org.apache.http.Header;
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpException;
-import org.apache.http.HttpRequest;
-import org.apache.http.HttpResponse;
-import org.apache.http.MethodNotSupportedException;
+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.HttpRequest;
+import org.apache.hc.core5.http.HttpResponse;
+import org.apache.hc.core5.http.MethodNotSupportedException;
+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.hc.core5.http.entity.ByteArrayEntity;
+import org.apache.hc.core5.http.io.HttpRequestHandler;
+import org.apache.hc.core5.http.protocol.BasicHttpContext;
+import org.apache.hc.core5.http.protocol.HttpContext;
 import org.apache.http.client.ClientProtocolException;
 import org.apache.http.client.HttpClient;
 import org.apache.http.client.cache.CacheResponseStatus;
 import org.apache.http.client.cache.HttpCacheContext;
 import org.apache.http.client.config.RequestConfig;
 import org.apache.http.client.methods.HttpGet;
-import org.apache.http.config.SocketConfig;
-import org.apache.http.entity.ByteArrayEntity;
-import org.apache.http.impl.bootstrap.HttpServer;
-import org.apache.http.impl.bootstrap.ServerBootstrap;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClientBuilder;
-import org.apache.http.protocol.BasicHttpContext;
-import org.apache.http.protocol.HttpContext;
-import org.apache.http.protocol.HttpRequestHandler;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -253,7 +253,7 @@ public class TestStaleWhileRevalidationR
          * @param response  the response
          * @param context   the context
          *
-         * @throws org.apache.http.HttpException    in case of a problem
+         * @throws org.apache.hc.core5.http.HttpException    in case of a problem
          * @throws java.io.IOException      in case of an IO problem
          */
         @Override
@@ -271,7 +271,7 @@ public class TestStaleWhileRevalidationR
                         (method + " not supported by " + getClass().getName());
             }
 
-            response.setStatusCode(org.apache.http.HttpStatus.SC_OK);
+            response.setStatusCode(org.apache.hc.core5.http.HttpStatus.SC_OK);
             response.addHeader("Cache-Control",getCacheContent(request));
             final byte[] content = getHeaderContent(request);
             final ByteArrayEntity bae = new ByteArrayEntity(content);
@@ -285,7 +285,7 @@ public class TestStaleWhileRevalidationR
         public byte[] getHeaderContent(final HttpRequest request) {
             final Header contentHeader = request.getFirstHeader(DEFAULT_CLIENT_CONTROLLED_CONTENT_HEADER);
             if(contentHeader!=null) {
-                return contentHeader.getValue().getBytes(Consts.UTF_8);
+                return contentHeader.getValue().getBytes(StandardCharsets.UTF_8);
             } else {
                 return DEFAULT_CONTENT;
             }

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestWarningValue.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestWarningValue.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestWarningValue.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestWarningValue.java Tue Jan 12 20:43:36 2016
@@ -28,9 +28,9 @@ package org.apache.http.impl.client.cach
 
 import java.util.Date;
 
-import org.apache.http.Header;
+import org.apache.hc.core5.http.Header;
+import org.apache.hc.core5.http.message.BasicHeader;
 import org.apache.http.client.utils.DateUtils;
-import org.apache.http.message.BasicHeader;
 import org.junit.Assert;
 import org.junit.Test;
 

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ehcache/TestEhcacheHttpCacheStorage.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ehcache/TestEhcacheHttpCacheStorage.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ehcache/TestEhcacheHttpCacheStorage.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ehcache/TestEhcacheHttpCacheStorage.java Tue Jan 12 20:43:36 2016
@@ -37,10 +37,6 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 
-import junit.framework.TestCase;
-import net.sf.ehcache.Ehcache;
-import net.sf.ehcache.Element;
-
 import org.apache.http.client.cache.HttpCacheEntry;
 import org.apache.http.client.cache.HttpCacheEntrySerializer;
 import org.apache.http.client.cache.HttpCacheUpdateCallback;
@@ -49,6 +45,10 @@ import org.apache.http.impl.client.cache
 import org.apache.http.impl.client.cache.HttpTestUtils;
 import org.junit.Test;
 
+import junit.framework.TestCase;
+import net.sf.ehcache.Ehcache;
+import net.sf.ehcache.Element;
+
 @SuppressWarnings("boxing") // test code
 public class TestEhcacheHttpCacheStorage extends TestCase {
 

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ehcache/TestEhcacheProtocolRequirements.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ehcache/TestEhcacheProtocolRequirements.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ehcache/TestEhcacheProtocolRequirements.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ehcache/TestEhcacheProtocolRequirements.java Tue Jan 12 20:43:36 2016
@@ -26,11 +26,6 @@
  */
 package org.apache.http.impl.client.cache.ehcache;
 
-import net.sf.ehcache.CacheManager;
-import net.sf.ehcache.config.CacheConfiguration;
-import net.sf.ehcache.config.Configuration;
-import net.sf.ehcache.store.MemoryStoreEvictionPolicy;
-
 import org.apache.http.client.cache.HttpCacheStorage;
 import org.apache.http.impl.client.cache.CacheConfig;
 import org.apache.http.impl.client.cache.CachingExec;
@@ -43,6 +38,11 @@ import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
 
+import net.sf.ehcache.CacheManager;
+import net.sf.ehcache.config.CacheConfiguration;
+import net.sf.ehcache.config.Configuration;
+import net.sf.ehcache.store.MemoryStoreEvictionPolicy;
+
 public class TestEhcacheProtocolRequirements extends TestProtocolRequirements{
 
     protected final String TEST_EHCACHE_NAME = "TestEhcacheProtocolRequirements-cache";

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestMemcachedHttpCacheStorage.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestMemcachedHttpCacheStorage.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestMemcachedHttpCacheStorage.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/memcached/TestMemcachedHttpCacheStorage.java Tue Jan 12 20:43:36 2016
@@ -34,13 +34,6 @@ import static org.mockito.Mockito.verify
 import static org.mockito.Mockito.when;
 
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-
-import junit.framework.TestCase;
-import net.spy.memcached.CASResponse;
-import net.spy.memcached.CASValue;
-import net.spy.memcached.MemcachedClientIF;
-import net.spy.memcached.OperationTimeoutException;
 
 import org.apache.http.client.cache.HttpCacheEntry;
 import org.apache.http.client.cache.HttpCacheUpdateCallback;
@@ -50,6 +43,12 @@ import org.apache.http.impl.client.cache
 import org.junit.Before;
 import org.junit.Test;
 
+import junit.framework.TestCase;
+import net.spy.memcached.CASResponse;
+import net.spy.memcached.CASValue;
+import net.spy.memcached.MemcachedClientIF;
+import net.spy.memcached.OperationTimeoutException;
+
 public class TestMemcachedHttpCacheStorage extends TestCase {
     private MemcachedHttpCacheStorage impl;
     private MemcachedClientIF mockMemcachedClient;
@@ -168,7 +167,7 @@ public class TestMemcachedHttpCacheStora
     }
 
     @Test
-    public void testSuccessfulCacheGet() throws UnsupportedEncodingException,
+    public void testSuccessfulCacheGet() throws
             IOException {
         final String url = "foo";
         final String key = "key";
@@ -195,7 +194,7 @@ public class TestMemcachedHttpCacheStora
     }
 
     @Test
-    public void testTreatsNoneByteArrayFromMemcachedAsCacheMiss() throws UnsupportedEncodingException,
+    public void testTreatsNoneByteArrayFromMemcachedAsCacheMiss() throws
             IOException {
         final String url = "foo";
         final String key = "key";
@@ -212,7 +211,7 @@ public class TestMemcachedHttpCacheStora
     }
 
     @Test
-    public void testTreatsNullFromMemcachedAsCacheMiss() throws UnsupportedEncodingException,
+    public void testTreatsNullFromMemcachedAsCacheMiss() throws
             IOException {
         final String url = "foo";
         final String key = "key";
@@ -229,7 +228,7 @@ public class TestMemcachedHttpCacheStora
     }
 
     @Test
-    public void testTreatsAsCacheMissIfCannotReconstituteEntry() throws UnsupportedEncodingException,
+    public void testTreatsAsCacheMissIfCannotReconstituteEntry() throws
             IOException {
         final String url = "foo";
         final String key = "key";
@@ -250,7 +249,7 @@ public class TestMemcachedHttpCacheStora
     }
 
     @Test
-    public void testTreatsAsCacheMissIfCantHashStorageKey() throws UnsupportedEncodingException,
+    public void testTreatsAsCacheMissIfCantHashStorageKey() throws
             IOException {
         final String url = "foo";
 

Modified: httpcomponents/httpclient/trunk/httpclient-osgi/pom.xml
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-osgi/pom.xml?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-osgi/pom.xml (original)
+++ httpcomponents/httpclient/trunk/httpclient-osgi/pom.xml Tue Jan 12 20:43:36 2016
@@ -56,8 +56,8 @@
     </dependency>
       <!-- Depend on the OSGi bundle - the bundle plugin knows what to do. -->
     <dependency>
-      <groupId>org.apache.httpcomponents</groupId>
-      <artifactId>httpcore-osgi</artifactId>
+      <groupId>org.apache.httpcomponents.core5</groupId>
+      <artifactId>httpcore5-osgi</artifactId>
       <version>${httpcore.version}</version>
         <exclusions>
           <exclusion>

Modified: httpcomponents/httpclient/trunk/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/OSGiHttpRoutePlanner.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/OSGiHttpRoutePlanner.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/OSGiHttpRoutePlanner.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/OSGiHttpRoutePlanner.java Tue Jan 12 20:43:36 2016
@@ -31,12 +31,12 @@ import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import org.apache.http.HttpException;
-import org.apache.http.HttpHost;
-import org.apache.http.HttpRequest;
+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.protocol.HttpContext;
 import org.apache.http.impl.conn.DefaultRoutePlanner;
 import org.apache.http.osgi.services.ProxyConfiguration;
-import org.apache.http.protocol.HttpContext;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
 
@@ -108,7 +108,7 @@ final class OSGiHttpRoutePlanner extends
         return new HostNameMatcher(name);
     }
 
-    private static interface HostMatcher {
+    private interface HostMatcher {
 
         boolean matches(String host);
 

Modified: httpcomponents/httpclient/trunk/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/PropertiesUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/PropertiesUtils.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/PropertiesUtils.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/PropertiesUtils.java Tue Jan 12 20:43:36 2016
@@ -111,7 +111,7 @@ final class PropertiesUtils {
         // do nothing
     }
 
-    private static interface PropertyConverter<T> {
+    private interface PropertyConverter<T> {
 
         T to(Object propValue);
 

Modified: httpcomponents/httpclient/trunk/httpclient-osgi/src/test/java/org/apache/http/osgi/impl/MimeExportedIT.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-osgi/src/test/java/org/apache/http/osgi/impl/MimeExportedIT.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-osgi/src/test/java/org/apache/http/osgi/impl/MimeExportedIT.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-osgi/src/test/java/org/apache/http/osgi/impl/MimeExportedIT.java Tue Jan 12 20:43:36 2016
@@ -27,9 +27,20 @@
 
 package org.apache.http.osgi.impl;
 
-import org.apache.http.HttpEntity;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.provision;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.hc.core5.http.HttpEntity;
+import org.apache.hc.core5.http.entity.ContentType;
 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.ByteArrayBody;
 import org.apache.http.entity.mime.content.StringBody;
@@ -41,17 +52,6 @@ import org.ops4j.pax.exam.junit.PaxExam;
 import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
 import org.ops4j.pax.exam.spi.reactors.PerClass;
 
-import java.io.File;
-import java.io.FilenameFilter;
-import java.net.MalformedURLException;
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.ops4j.pax.exam.CoreOptions.junitBundles;
-import static org.ops4j.pax.exam.CoreOptions.options;
-import static org.ops4j.pax.exam.CoreOptions.provision;
-import static org.ops4j.pax.exam.CoreOptions.systemProperty;
-
 /**
  * pax-exam test for the OSGi packaging of the client.
  */
@@ -64,7 +64,7 @@ public class MimeExportedIT {
         final String projectBuildDirectory = System.getProperty("project.build.directory", "target");
         final String projectVersion = System.getProperty("project.version");
 
-        final List<String> bundleUrls = new ArrayList<String>();
+        final List<String> bundleUrls = new ArrayList<>();
         final File bundleDir = new File(projectBuildDirectory, "bundles");
         final File[] bundleFiles = bundleDir.listFiles(new FilenameFilter() {
             @Override

Modified: httpcomponents/httpclient/trunk/httpclient-osgi/src/test/java/org/apache/http/osgi/impl/OSGiProxyConfigurationTest.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-osgi/src/test/java/org/apache/http/osgi/impl/OSGiProxyConfigurationTest.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-osgi/src/test/java/org/apache/http/osgi/impl/OSGiProxyConfigurationTest.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-osgi/src/test/java/org/apache/http/osgi/impl/OSGiProxyConfigurationTest.java Tue Jan 12 20:43:36 2016
@@ -26,13 +26,13 @@
  */
 package org.apache.http.osgi.impl;
 
-import org.junit.Test;
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.junit.Assert.assertThat;
 
 import java.util.Dictionary;
 import java.util.Hashtable;
 
-import static org.hamcrest.CoreMatchers.containsString;
-import static org.junit.Assert.assertThat;
+import org.junit.Test;
 
 public class OSGiProxyConfigurationTest {
 

Modified: httpcomponents/httpclient/trunk/httpclient-osgi/src/test/java/org/apache/http/osgi/impl/TestOSGiHttpRoutePlanner.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-osgi/src/test/java/org/apache/http/osgi/impl/TestOSGiHttpRoutePlanner.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-osgi/src/test/java/org/apache/http/osgi/impl/TestOSGiHttpRoutePlanner.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-osgi/src/test/java/org/apache/http/osgi/impl/TestOSGiHttpRoutePlanner.java Tue Jan 12 20:43:36 2016
@@ -36,7 +36,7 @@ import java.net.InetAddress;
 import java.util.Map;
 import java.util.TreeMap;
 
-import org.apache.http.HttpHost;
+import org.apache.hc.core5.http.HttpHost;
 import org.apache.http.osgi.services.ProxyConfiguration;
 import org.junit.Test;
 import org.osgi.framework.BundleContext;
@@ -120,7 +120,7 @@ public class TestOSGiHttpRoutePlanner {
         final BundleContext bc = mock(BundleContext.class);
         when(bc.getService(sRef1)).thenReturn(this.pc1);
 
-        final Map<String, ServiceRegistration> registrations = new TreeMap<String, ServiceRegistration>(); // TreeMap for order
+        final Map<String, ServiceRegistration> registrations = new TreeMap<>(); // TreeMap for order
         registrations.put("foo1", sReg1);
 
         OSGiHttpRoutePlanner planner = new OSGiHttpRoutePlanner(bc, registrations);
@@ -176,7 +176,7 @@ public class TestOSGiHttpRoutePlanner {
         when(sReg2.getReference()).thenReturn(sRef2);
         final BundleContext bc = mock(BundleContext.class);
         when(bc.getService(sRef2)).thenReturn(this.pc2);
-        final Map<String, ServiceRegistration> registrations = new TreeMap<String, ServiceRegistration>();
+        final Map<String, ServiceRegistration> registrations = new TreeMap<>();
         registrations.put("foo2", sReg2);
 
         final OSGiHttpRoutePlanner planner = new OSGiHttpRoutePlanner(bc, registrations);

Modified: httpcomponents/httpclient/trunk/httpclient-win/src/examples/org/apache/http/examples/client/win/ClientWinAuth.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-win/src/examples/org/apache/http/examples/client/win/ClientWinAuth.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-win/src/examples/org/apache/http/examples/client/win/ClientWinAuth.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-win/src/examples/org/apache/http/examples/client/win/ClientWinAuth.java Tue Jan 12 20:43:36 2016
@@ -27,11 +27,11 @@
 
 package org.apache.http.examples.client.win;
 
+import org.apache.hc.core5.http.entity.EntityUtils;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.WinHttpClients;
-import org.apache.http.util.EntityUtils;
 
 /**
  * This example demonstrates how to create HttpClient pre-configured

Modified: httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/auth/win/WindowsNTLMSchemeFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/auth/win/WindowsNTLMSchemeFactory.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/auth/win/WindowsNTLMSchemeFactory.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/auth/win/WindowsNTLMSchemeFactory.java Tue Jan 12 20:43:36 2016
@@ -27,11 +27,11 @@
 
 package org.apache.http.impl.auth.win;
 
-import org.apache.http.annotation.Immutable;
+import org.apache.hc.core5.annotation.Immutable;
+import org.apache.hc.core5.http.protocol.HttpContext;
 import org.apache.http.auth.AuthScheme;
 import org.apache.http.auth.AuthSchemeProvider;
 import org.apache.http.client.config.AuthSchemes;
-import org.apache.http.protocol.HttpContext;
 
 /**
  * {@link AuthSchemeProvider} implementation that creates and initializes
@@ -45,7 +45,7 @@ import org.apache.http.protocol.HttpCont
 @Immutable
 public class WindowsNTLMSchemeFactory implements AuthSchemeProvider {
 
-    private String servicePrincipalName;
+    private final String servicePrincipalName;
 
     public WindowsNTLMSchemeFactory(final String servicePrincipalName) {
         super();

Modified: httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/auth/win/WindowsNegotiateScheme.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/auth/win/WindowsNegotiateScheme.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/auth/win/WindowsNegotiateScheme.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/auth/win/WindowsNegotiateScheme.java Tue Jan 12 20:43:36 2016
@@ -31,9 +31,11 @@ import java.security.Principal;
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.http.HttpHost;
-import org.apache.http.HttpRequest;
-import org.apache.http.annotation.NotThreadSafe;
+import org.apache.hc.core5.annotation.NotThreadSafe;
+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.hc.core5.util.Args;
 import org.apache.http.auth.AuthChallenge;
 import org.apache.http.auth.AuthScheme;
 import org.apache.http.auth.AuthenticationException;
@@ -43,8 +45,6 @@ import org.apache.http.auth.MalformedCha
 import org.apache.http.client.config.AuthSchemes;
 import org.apache.http.client.protocol.HttpClientContext;
 import org.apache.http.conn.routing.RouteInfo;
-import org.apache.http.protocol.HttpContext;
-import org.apache.http.util.Args;
 
 import com.sun.jna.platform.win32.Secur32;
 import com.sun.jna.platform.win32.Secur32Util;

Modified: httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/auth/win/WindowsNegotiateSchemeFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/auth/win/WindowsNegotiateSchemeFactory.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/auth/win/WindowsNegotiateSchemeFactory.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/auth/win/WindowsNegotiateSchemeFactory.java Tue Jan 12 20:43:36 2016
@@ -27,11 +27,11 @@
 
 package org.apache.http.impl.auth.win;
 
-import org.apache.http.annotation.Immutable;
+import org.apache.hc.core5.annotation.Immutable;
+import org.apache.hc.core5.http.protocol.HttpContext;
 import org.apache.http.auth.AuthScheme;
 import org.apache.http.auth.AuthSchemeProvider;
 import org.apache.http.client.config.AuthSchemes;
-import org.apache.http.protocol.HttpContext;
 
 /**
  * {@link AuthSchemeProvider} implementation that creates and initializes
@@ -45,7 +45,7 @@ import org.apache.http.protocol.HttpCont
 @Immutable
 public class WindowsNegotiateSchemeFactory implements AuthSchemeProvider {
 
-    private String servicePrincipalName;
+    private final String servicePrincipalName;
 
     public WindowsNegotiateSchemeFactory(final String servicePrincipalName) {
         super();

Modified: httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/client/WinHttpClients.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/client/WinHttpClients.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/client/WinHttpClients.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-win/src/main/java/org/apache/http/impl/client/WinHttpClients.java Tue Jan 12 20:43:36 2016
@@ -28,10 +28,10 @@ package org.apache.http.impl.client;
 
 import java.util.Locale;
 
+import org.apache.hc.core5.http.config.Registry;
+import org.apache.hc.core5.http.config.RegistryBuilder;
 import org.apache.http.auth.AuthSchemeProvider;
 import org.apache.http.client.config.AuthSchemes;
-import org.apache.http.config.Registry;
-import org.apache.http.config.RegistryBuilder;
 import org.apache.http.impl.auth.BasicSchemeFactory;
 import org.apache.http.impl.auth.DigestSchemeFactory;
 import org.apache.http.impl.auth.win.WindowsNTLMSchemeFactory;

Modified: httpcomponents/httpclient/trunk/httpclient-win/src/test/java/org/apache/http/impl/auth/win/TestWindowsNegotiateScheme.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-win/src/test/java/org/apache/http/impl/auth/win/TestWindowsNegotiateScheme.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-win/src/test/java/org/apache/http/impl/auth/win/TestWindowsNegotiateScheme.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-win/src/test/java/org/apache/http/impl/auth/win/TestWindowsNegotiateScheme.java Tue Jan 12 20:43:36 2016
@@ -28,26 +28,26 @@ package org.apache.http.impl.auth.win;
 
 import java.io.IOException;
 
-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.HttpStatus;
+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.HttpStatus;
+import org.apache.hc.core5.http.config.Registry;
+import org.apache.hc.core5.http.config.RegistryBuilder;
+import org.apache.hc.core5.http.entity.EntityUtils;
+import org.apache.hc.core5.http.io.HttpRequestHandler;
+import org.apache.hc.core5.http.protocol.HttpContext;
 import org.apache.http.auth.AuthScheme;
 import org.apache.http.auth.AuthSchemeProvider;
 import org.apache.http.client.config.AuthSchemes;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpGet;
-import org.apache.http.config.Registry;
-import org.apache.http.config.RegistryBuilder;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClientBuilder;
 import org.apache.http.impl.client.WinHttpClients;
 import org.apache.http.localserver.LocalServerTestBase;
-import org.apache.http.protocol.HttpContext;
-import org.apache.http.protocol.HttpRequestHandler;
-import org.apache.http.util.EntityUtils;
 import org.junit.After;
 import org.junit.Assume;
 import org.junit.Before;

Modified: httpcomponents/httpclient/trunk/httpclient/pom.xml
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/pom.xml?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/pom.xml (original)
+++ httpcomponents/httpclient/trunk/httpclient/pom.xml Tue Jan 12 20:43:36 2016
@@ -40,8 +40,8 @@
 
   <dependencies>
     <dependency>
-      <groupId>org.apache.httpcomponents</groupId>
-      <artifactId>httpcore</artifactId>
+      <groupId>org.apache.httpcomponents.core5</groupId>
+      <artifactId>httpcore5</artifactId>
       <scope>compile</scope>
     </dependency>
     <dependency>

Modified: httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientAuthentication.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientAuthentication.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientAuthentication.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientAuthentication.java Tue Jan 12 20:43:36 2016
@@ -26,6 +26,7 @@
  */
 package org.apache.http.examples.client;
 
+import org.apache.hc.core5.http.entity.EntityUtils;
 import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.UsernamePasswordCredentials;
 import org.apache.http.client.methods.CloseableHttpResponse;
@@ -33,7 +34,6 @@ import org.apache.http.client.methods.Ht
 import org.apache.http.impl.client.BasicCredentialsProvider;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
-import org.apache.http.util.EntityUtils;
 
 /**
  * A simple example that uses HttpClient to execute an HTTP request against

Modified: httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientChunkEncodedPost.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientChunkEncodedPost.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientChunkEncodedPost.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientChunkEncodedPost.java Tue Jan 12 20:43:36 2016
@@ -29,13 +29,13 @@ package org.apache.http.examples.client;
 import java.io.File;
 import java.io.FileInputStream;
 
+import org.apache.hc.core5.http.entity.ContentType;
+import org.apache.hc.core5.http.entity.EntityUtils;
+import org.apache.hc.core5.http.entity.InputStreamEntity;
 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.InputStreamEntity;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
-import org.apache.http.util.EntityUtils;
 
 /**
  * Example how to use unbuffered chunk-encoded POST request.

Modified: httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientConfiguration.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientConfiguration.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientConfiguration.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientConfiguration.java Tue Jan 12 20:43:36 2016
@@ -30,17 +30,33 @@ package org.apache.http.examples.client;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.nio.charset.CodingErrorAction;
+import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 
 import javax.net.ssl.SSLContext;
 
-import org.apache.http.Consts;
-import org.apache.http.Header;
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpHost;
-import org.apache.http.HttpRequest;
-import org.apache.http.HttpResponse;
-import org.apache.http.ParseException;
+import org.apache.hc.core5.http.Header;
+import org.apache.hc.core5.http.HttpEntity;
+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.ParseException;
+import org.apache.hc.core5.http.config.ConnectionConfig;
+import org.apache.hc.core5.http.config.MessageConstraints;
+import org.apache.hc.core5.http.config.Registry;
+import org.apache.hc.core5.http.config.RegistryBuilder;
+import org.apache.hc.core5.http.config.SocketConfig;
+import org.apache.hc.core5.http.entity.EntityUtils;
+import org.apache.hc.core5.http.impl.DefaultHttpResponseFactory;
+import org.apache.hc.core5.http.impl.io.DefaultHttpRequestWriterFactory;
+import org.apache.hc.core5.http.io.HttpMessageParser;
+import org.apache.hc.core5.http.io.HttpMessageParserFactory;
+import org.apache.hc.core5.http.io.HttpMessageWriterFactory;
+import org.apache.hc.core5.http.message.BasicHeader;
+import org.apache.hc.core5.http.message.BasicLineParser;
+import org.apache.hc.core5.http.message.LineParser;
+import org.apache.hc.core5.ssl.SSLContexts;
+import org.apache.hc.core5.util.CharArrayBuffer;
 import org.apache.http.auth.CredentialsProvider;
 import org.apache.http.client.CookieStore;
 import org.apache.http.client.config.AuthSchemes;
@@ -49,11 +65,6 @@ import org.apache.http.client.config.Req
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.protocol.HttpClientContext;
-import org.apache.http.config.ConnectionConfig;
-import org.apache.http.config.MessageConstraints;
-import org.apache.http.config.Registry;
-import org.apache.http.config.RegistryBuilder;
-import org.apache.http.config.SocketConfig;
 import org.apache.http.conn.DnsResolver;
 import org.apache.http.conn.HttpConnectionFactory;
 import org.apache.http.conn.ManagedHttpClientConnection;
@@ -61,27 +72,15 @@ import org.apache.http.conn.routing.Http
 import org.apache.http.conn.socket.ConnectionSocketFactory;
 import org.apache.http.conn.socket.PlainConnectionSocketFactory;
 import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
-import org.apache.http.impl.DefaultHttpResponseFactory;
 import org.apache.http.impl.client.BasicCookieStore;
 import org.apache.http.impl.client.BasicCredentialsProvider;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
-import org.apache.http.impl.conn.DefaultHttpResponseParser;
 import org.apache.http.impl.conn.DefaultHttpResponseParserFactory;
+import org.apache.http.impl.conn.LenientHttpResponseParser;
 import org.apache.http.impl.conn.ManagedHttpClientConnectionFactory;
 import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
 import org.apache.http.impl.conn.SystemDefaultDnsResolver;
-import org.apache.http.impl.io.DefaultHttpRequestWriterFactory;
-import org.apache.http.io.HttpMessageParser;
-import org.apache.http.io.HttpMessageParserFactory;
-import org.apache.http.io.HttpMessageWriterFactory;
-import org.apache.http.io.SessionInputBuffer;
-import org.apache.http.message.BasicHeader;
-import org.apache.http.message.BasicLineParser;
-import org.apache.http.message.LineParser;
-import org.apache.http.ssl.SSLContexts;
-import org.apache.http.util.CharArrayBuffer;
-import org.apache.http.util.EntityUtils;
 
 /**
  * This example demonstrates how to customize and configure the most common aspects
@@ -96,8 +95,7 @@ public class ClientConfiguration {
         HttpMessageParserFactory<HttpResponse> responseParserFactory = new DefaultHttpResponseParserFactory() {
 
             @Override
-            public HttpMessageParser<HttpResponse> create(
-                SessionInputBuffer buffer, MessageConstraints constraints) {
+            public HttpMessageParser<HttpResponse> create(MessageConstraints constraints) {
                 LineParser lineParser = new BasicLineParser() {
 
                     @Override
@@ -110,16 +108,7 @@ public class ClientConfiguration {
                     }
 
                 };
-                return new DefaultHttpResponseParser(
-                    buffer, lineParser, DefaultHttpResponseFactory.INSTANCE, constraints) {
-
-                    @Override
-                    protected boolean reject(final CharArrayBuffer line, int count) {
-                        // try to ignore all garbage preceding a status line infinitely
-                        return false;
-                    }
-
-                };
+                return new LenientHttpResponseParser(lineParser, DefaultHttpResponseFactory.INSTANCE, constraints);
             }
 
         };
@@ -186,7 +175,7 @@ public class ClientConfiguration {
         ConnectionConfig connectionConfig = ConnectionConfig.custom()
             .setMalformedInputAction(CodingErrorAction.IGNORE)
             .setUnmappableInputAction(CodingErrorAction.IGNORE)
-            .setCharset(Consts.UTF_8)
+            .setCharset(StandardCharsets.UTF_8)
             .setMessageConstraints(messageConstraints)
             .build();
         // Configure the connection manager to use connection configuration either

Modified: httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientConnectionRelease.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientConnectionRelease.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientConnectionRelease.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientConnectionRelease.java Tue Jan 12 20:43:36 2016
@@ -30,7 +30,7 @@ package org.apache.http.examples.client;
 import java.io.IOException;
 import java.io.InputStream;
 
-import org.apache.http.HttpEntity;
+import org.apache.hc.core5.http.HttpEntity;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.impl.client.CloseableHttpClient;

Modified: httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientCustomContext.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientCustomContext.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientCustomContext.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientCustomContext.java Tue Jan 12 20:43:36 2016
@@ -29,6 +29,7 @@ package org.apache.http.examples.client;
 
 import java.util.List;
 
+import org.apache.hc.core5.http.entity.EntityUtils;
 import org.apache.http.client.CookieStore;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpGet;
@@ -37,7 +38,6 @@ import org.apache.http.cookie.Cookie;
 import org.apache.http.impl.client.BasicCookieStore;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
-import org.apache.http.util.EntityUtils;
 
 /**
  * This example demonstrates the use of a local HTTP context populated with

Modified: httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientCustomPublicSuffixList.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientCustomPublicSuffixList.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientCustomPublicSuffixList.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientCustomPublicSuffixList.java Tue Jan 12 20:43:36 2016
@@ -28,12 +28,13 @@ package org.apache.http.examples.client;
 
 import java.net.URL;
 
-import org.apache.http.HttpEntity;
+import org.apache.hc.core5.http.HttpEntity;
+import org.apache.hc.core5.http.config.Lookup;
+import org.apache.hc.core5.http.config.RegistryBuilder;
+import org.apache.hc.core5.http.entity.EntityUtils;
 import org.apache.http.client.config.CookieSpecs;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpGet;
-import org.apache.http.config.Lookup;
-import org.apache.http.config.RegistryBuilder;
 import org.apache.http.conn.ssl.DefaultHostnameVerifier;
 import org.apache.http.conn.util.PublicSuffixMatcher;
 import org.apache.http.conn.util.PublicSuffixMatcherLoader;
@@ -41,7 +42,6 @@ import org.apache.http.cookie.CookieSpec
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
 import org.apache.http.impl.cookie.RFC6265CookieSpecProvider;
-import org.apache.http.util.EntityUtils;
 
 /**
  * This example demonstrates how to use a custom public suffix list.

Modified: httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientCustomSSL.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientCustomSSL.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientCustomSSL.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientCustomSSL.java Tue Jan 12 20:43:36 2016
@@ -30,15 +30,15 @@ import java.io.File;
 
 import javax.net.ssl.SSLContext;
 
-import org.apache.http.HttpEntity;
+import org.apache.hc.core5.http.HttpEntity;
+import org.apache.hc.core5.http.entity.EntityUtils;
+import org.apache.hc.core5.ssl.SSLContexts;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
 import org.apache.http.conn.ssl.TrustSelfSignedStrategy;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
-import org.apache.http.ssl.SSLContexts;
-import org.apache.http.util.EntityUtils;
 
 /**
  * This example demonstrates how to create secure connections with a custom SSL

Modified: httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientEvictExpiredConnections.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientEvictExpiredConnections.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientEvictExpiredConnections.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientEvictExpiredConnections.java Tue Jan 12 20:43:36 2016
@@ -28,13 +28,13 @@ package org.apache.http.examples.client;
 
 import java.util.concurrent.TimeUnit;
 
+import org.apache.hc.core5.http.entity.EntityUtils;
+import org.apache.hc.core5.pool.PoolStats;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
 import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
-import org.apache.http.pool.PoolStats;
-import org.apache.http.util.EntityUtils;
 
 /**
  * Example demonstrating how to evict expired and idle connections

Modified: httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientExecuteProxy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientExecuteProxy.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientExecuteProxy.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientExecuteProxy.java Tue Jan 12 20:43:36 2016
@@ -27,13 +27,13 @@
 
 package org.apache.http.examples.client;
 
-import org.apache.http.HttpHost;
+import org.apache.hc.core5.http.HttpHost;
+import org.apache.hc.core5.http.entity.EntityUtils;
 import org.apache.http.client.config.RequestConfig;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
-import org.apache.http.util.EntityUtils;
 
 /**
  * How to send a request via proxy.

Modified: httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientExecuteSOCKS.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientExecuteSOCKS.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientExecuteSOCKS.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientExecuteSOCKS.java Tue Jan 12 20:43:36 2016
@@ -33,19 +33,19 @@ import java.net.Proxy;
 import java.net.Socket;
 import java.net.SocketTimeoutException;
 
-import org.apache.http.HttpHost;
+import org.apache.hc.core5.http.HttpHost;
+import org.apache.hc.core5.http.config.Registry;
+import org.apache.hc.core5.http.config.RegistryBuilder;
+import org.apache.hc.core5.http.entity.EntityUtils;
+import org.apache.hc.core5.http.protocol.HttpContext;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.protocol.HttpClientContext;
-import org.apache.http.config.Registry;
-import org.apache.http.config.RegistryBuilder;
 import org.apache.http.conn.ConnectTimeoutException;
 import org.apache.http.conn.socket.ConnectionSocketFactory;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
 import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
-import org.apache.http.protocol.HttpContext;
-import org.apache.http.util.EntityUtils;
 
 /**
  * How to send a request via SOCKS proxy.
@@ -94,7 +94,7 @@ public class ClientExecuteSOCKS {
                 final HttpHost host,
                 final InetSocketAddress remoteAddress,
                 final InetSocketAddress localAddress,
-                final HttpContext context) throws IOException, ConnectTimeoutException {
+                final HttpContext context) throws IOException {
             Socket sock;
             if (socket != null) {
                 sock = socket;

Modified: httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientFormLogin.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientFormLogin.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientFormLogin.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientFormLogin.java Tue Jan 12 20:43:36 2016
@@ -29,7 +29,8 @@ package org.apache.http.examples.client;
 import java.net.URI;
 import java.util.List;
 
-import org.apache.http.HttpEntity;
+import org.apache.hc.core5.http.HttpEntity;
+import org.apache.hc.core5.http.entity.EntityUtils;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.methods.HttpUriRequest;
@@ -38,7 +39,6 @@ import org.apache.http.cookie.Cookie;
 import org.apache.http.impl.client.BasicCookieStore;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
-import org.apache.http.util.EntityUtils;
 
 /**
  * A example that demonstrates how HttpClient APIs can be used to perform

Modified: httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientMultiThreadedExecution.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientMultiThreadedExecution.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientMultiThreadedExecution.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientMultiThreadedExecution.java Tue Jan 12 20:43:36 2016
@@ -26,15 +26,15 @@
  */
 package org.apache.http.examples.client;
 
-import org.apache.http.HttpEntity;
+import org.apache.hc.core5.http.HttpEntity;
+import org.apache.hc.core5.http.entity.EntityUtils;
+import org.apache.hc.core5.http.protocol.BasicHttpContext;
+import org.apache.hc.core5.http.protocol.HttpContext;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
 import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
-import org.apache.http.protocol.BasicHttpContext;
-import org.apache.http.protocol.HttpContext;
-import org.apache.http.util.EntityUtils;
 
 /**
  * An example that performs GETs from multiple threads.

Modified: httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientPreemptiveBasicAuthentication.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientPreemptiveBasicAuthentication.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientPreemptiveBasicAuthentication.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientPreemptiveBasicAuthentication.java Tue Jan 12 20:43:36 2016
@@ -26,7 +26,8 @@
  */
 package org.apache.http.examples.client;
 
-import org.apache.http.HttpHost;
+import org.apache.hc.core5.http.HttpHost;
+import org.apache.hc.core5.http.entity.EntityUtils;
 import org.apache.http.auth.UsernamePasswordCredentials;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpGet;
@@ -34,7 +35,6 @@ import org.apache.http.client.protocol.H
 import org.apache.http.impl.auth.BasicScheme;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
-import org.apache.http.util.EntityUtils;
 
 /**
  * An example of HttpClient can be customized to authenticate

Modified: httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientPreemptiveDigestAuthentication.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientPreemptiveDigestAuthentication.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientPreemptiveDigestAuthentication.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientPreemptiveDigestAuthentication.java Tue Jan 12 20:43:36 2016
@@ -26,7 +26,8 @@
  */
 package org.apache.http.examples.client;
 
-import org.apache.http.HttpHost;
+import org.apache.hc.core5.http.HttpHost;
+import org.apache.hc.core5.http.entity.EntityUtils;
 import org.apache.http.auth.UsernamePasswordCredentials;
 import org.apache.http.client.AuthCache;
 import org.apache.http.client.methods.CloseableHttpResponse;
@@ -36,7 +37,6 @@ import org.apache.http.impl.auth.DigestS
 import org.apache.http.impl.client.BasicAuthCache;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
-import org.apache.http.util.EntityUtils;
 
 /**
  * An example of HttpClient can be customized to authenticate




Mime
View raw message