hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1724315 [3/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/OKStatus.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/OKStatus.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/OKStatus.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/OKStatus.java Tue Jan 12 20:43:36 2016
@@ -26,9 +26,9 @@
  */
 package org.apache.http.impl.client.cache;
 
-import org.apache.http.HttpStatus;
-import org.apache.http.HttpVersion;
-import org.apache.http.message.BasicStatusLine;
+import org.apache.hc.core5.http.HttpStatus;
+import org.apache.hc.core5.http.HttpVersion;
+import org.apache.hc.core5.http.message.BasicStatusLine;
 
 public class OKStatus extends BasicStatusLine {
 

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/RequestEquivalent.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/RequestEquivalent.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/RequestEquivalent.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/RequestEquivalent.java Tue Jan 12 20:43:36 2016
@@ -26,7 +26,7 @@
  */
 package org.apache.http.impl.client.cache;
 
-import org.apache.http.HttpRequest;
+import org.apache.hc.core5.http.HttpRequest;
 import org.easymock.IArgumentMatcher;
 
 public class RequestEquivalent implements IArgumentMatcher {

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ResponseEquivalent.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ResponseEquivalent.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ResponseEquivalent.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/ResponseEquivalent.java Tue Jan 12 20:43:36 2016
@@ -26,7 +26,7 @@
  */
 package org.apache.http.impl.client.cache;
 
-import org.apache.http.HttpResponse;
+import org.apache.hc.core5.http.HttpResponse;
 import org.easymock.IArgumentMatcher;
 
 public class ResponseEquivalent implements IArgumentMatcher {

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestAsynchronousValidationRequest.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestAsynchronousValidationRequest.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestAsynchronousValidationRequest.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestAsynchronousValidationRequest.java Tue Jan 12 20:43:36 2016
@@ -32,10 +32,11 @@ import static org.mockito.Mockito.when;
 
 import java.io.IOException;
 
-import org.apache.http.Header;
-import org.apache.http.HttpHost;
-import org.apache.http.ProtocolException;
-import org.apache.http.StatusLine;
+import org.apache.hc.core5.http.Header;
+import org.apache.hc.core5.http.HttpHost;
+import org.apache.hc.core5.http.ProtocolException;
+import org.apache.hc.core5.http.StatusLine;
+import org.apache.hc.core5.http.message.BasicHeader;
 import org.apache.http.client.cache.HeaderConstants;
 import org.apache.http.client.cache.HttpCacheEntry;
 import org.apache.http.client.methods.CloseableHttpResponse;
@@ -44,7 +45,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.message.BasicHeader;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -53,6 +53,7 @@ public class TestAsynchronousValidationR
 
     private AsynchronousValidator mockParent;
     private CachingExec mockClient;
+    private HttpHost host;
     private HttpRoute route;
     private HttpRequestWrapper request;
     private HttpClientContext context;
@@ -65,8 +66,9 @@ public class TestAsynchronousValidationR
     public void setUp() {
         mockParent = mock(AsynchronousValidator.class);
         mockClient = mock(CachingExec.class);
-        route = new HttpRoute(new HttpHost("foo.example.com", 80));
-        request = HttpRequestWrapper.wrap(new HttpGet("/"));
+        host = new HttpHost("foo.example.com", 80);
+        route = new HttpRoute(host);
+        request = HttpRequestWrapper.wrap(new HttpGet("/"), host);
         context = HttpClientContext.create();
         mockExecAware = mock(HttpExecutionAware.class);
         mockCacheEntry = mock(HttpCacheEntry.class);

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestAsynchronousValidator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestAsynchronousValidator.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestAsynchronousValidator.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestAsynchronousValidator.java Tue Jan 12 20:43:36 2016
@@ -37,9 +37,10 @@ import java.io.IOException;
 import java.util.concurrent.RejectedExecutionException;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.http.Header;
-import org.apache.http.HttpHost;
-import org.apache.http.HttpRequest;
+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.message.BasicHeader;
 import org.apache.http.client.cache.HeaderConstants;
 import org.apache.http.client.cache.HttpCacheEntry;
 import org.apache.http.client.methods.HttpExecutionAware;
@@ -47,7 +48,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.message.BasicHeader;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -59,6 +59,7 @@ public class TestAsynchronousValidator {
     private AsynchronousValidator impl;
 
     private CachingExec mockClient;
+    private HttpHost host;
     private HttpRoute route;
     private HttpRequestWrapper request;
     private HttpClientContext context;
@@ -70,8 +71,9 @@ public class TestAsynchronousValidator {
     @Before
     public void setUp() {
         mockClient = mock(CachingExec.class);
-        route = new HttpRoute(new HttpHost("foo.example.com", 80));
-        request = HttpRequestWrapper.wrap(new HttpGet("/"));
+        host = new HttpHost("foo.example.com", 80);
+        route = new HttpRoute(host);
+        request = HttpRequestWrapper.wrap(new HttpGet("/"), host);
         context = HttpClientContext.create();
         context.setTargetHost(new HttpHost("foo.example.com"));
         mockExecAware = mock(HttpExecutionAware.class);
@@ -160,8 +162,8 @@ public class TestAsynchronousValidator {
         when(mockCacheEntry.getHeaders(HeaderConstants.VARY)).thenReturn(variantHeaders);
         mockSchedulingStrategy.schedule(isA(AsynchronousValidationRequest.class));
 
-        impl.revalidateCacheEntry(mockClient, route, HttpRequestWrapper.wrap(req1), context, mockExecAware, mockCacheEntry);
-        impl.revalidateCacheEntry(mockClient, route, HttpRequestWrapper.wrap(req2), context, mockExecAware, mockCacheEntry);
+        impl.revalidateCacheEntry(mockClient, route, HttpRequestWrapper.wrap(req1, host), context, mockExecAware, mockCacheEntry);
+        impl.revalidateCacheEntry(mockClient, route, HttpRequestWrapper.wrap(req2, host), context, mockExecAware, mockCacheEntry);
 
         verify(mockCacheEntry, times(2)).hasVariants();
         verify(mockCacheEntry, times(2)).getHeaders(HeaderConstants.VARY);

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestBasicHttpCache.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestBasicHttpCache.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestBasicHttpCache.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestBasicHttpCache.java Tue Jan 12 20:43:36 2016
@@ -41,13 +41,17 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
 
-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.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.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.BasicHttpEntity;
+import org.apache.hc.core5.http.entity.ByteArrayEntity;
+import org.apache.hc.core5.http.message.BasicHeader;
+import org.apache.hc.core5.http.message.BasicHttpResponse;
 import org.apache.http.client.cache.HeaderConstants;
 import org.apache.http.client.cache.HttpCacheEntry;
 import org.apache.http.client.cache.Resource;
@@ -58,10 +62,6 @@ import org.apache.http.client.methods.Ht
 import org.apache.http.client.methods.HttpPost;
 import org.apache.http.client.methods.HttpTrace;
 import org.apache.http.client.utils.DateUtils;
-import org.apache.http.entity.BasicHttpEntity;
-import org.apache.http.entity.ByteArrayEntity;
-import org.apache.http.message.BasicHeader;
-import org.apache.http.message.BasicHttpResponse;
 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/TestCacheEntryUpdater.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheEntryUpdater.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheEntryUpdater.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheEntryUpdater.java Tue Jan 12 20:43:36 2016
@@ -33,14 +33,14 @@ import static org.junit.Assert.fail;
 import java.io.IOException;
 import java.util.Date;
 
-import org.apache.http.Header;
-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.HttpResponse;
+import org.apache.hc.core5.http.HttpStatus;
+import org.apache.hc.core5.http.HttpVersion;
+import org.apache.hc.core5.http.message.BasicHeader;
+import org.apache.hc.core5.http.message.BasicHttpResponse;
 import org.apache.http.client.cache.HttpCacheEntry;
 import org.apache.http.client.utils.DateUtils;
-import org.apache.http.message.BasicHeader;
-import org.apache.http.message.BasicHttpResponse;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -90,7 +90,7 @@ public class TestCacheEntryUpdater {
                 new BasicHeader("Date", DateUtils.formatDate(responseDate)),
                 new BasicHeader("ETag", "\"etag\"")};
         entry = HttpTestUtils.makeCacheEntry(headers);
-        response.setHeaders(new Header[]{});
+        response.setHeaders();
 
         final HttpCacheEntry updatedEntry = impl.updateCacheEntry(null, entry,
                 new Date(), new Date(), response);
@@ -112,9 +112,8 @@ public class TestCacheEntryUpdater {
                 new BasicHeader("Cache-Control", "max-age=0"),};
         entry = HttpTestUtils.makeCacheEntry(headers);
 
-        response.setHeaders(new Header[] {
-                new BasicHeader("Last-Modified", DateUtils.formatDate(responseDate)),
-                new BasicHeader("Cache-Control", "public")});
+        response.setHeaders(new BasicHeader("Last-Modified", DateUtils.formatDate(responseDate)),
+                new BasicHeader("Cache-Control", "public"));
 
         final HttpCacheEntry updatedEntry = impl.updateCacheEntry(null, entry,
                 new Date(), new Date(), response);
@@ -136,9 +135,8 @@ public class TestCacheEntryUpdater {
                 new BasicHeader("ETag", "\"etag\"")};
 
         entry = HttpTestUtils.makeCacheEntry(headers);
-        response.setHeaders(new Header[]{
-                new BasicHeader("Last-Modified", DateUtils.formatDate(responseDate)),
-                new BasicHeader("Cache-Control", "public"),});
+        response.setHeaders(new BasicHeader("Last-Modified", DateUtils.formatDate(responseDate)),
+                new BasicHeader("Cache-Control", "public"));
 
         final HttpCacheEntry updatedEntry = impl.updateCacheEntry(null, entry,
                 new Date(), new Date(), response);

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheInvalidator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheInvalidator.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheInvalidator.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheInvalidator.java Tue Jan 12 20:43:36 2016
@@ -36,21 +36,19 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.http.Header;
-import org.apache.http.HttpEntityEnclosingRequest;
-import org.apache.http.HttpHost;
-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.Header;
+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.ProtocolVersion;
+import org.apache.hc.core5.http.message.BasicHeader;
+import org.apache.hc.core5.http.message.BasicHttpRequest;
+import org.apache.hc.core5.http.message.BasicHttpResponse;
 import org.apache.http.client.cache.HttpCacheEntry;
 import org.apache.http.client.cache.HttpCacheStorage;
 import org.apache.http.client.utils.DateUtils;
-import org.apache.http.message.BasicHeader;
-import org.apache.http.message.BasicHttpEntityEnclosingRequest;
-import org.apache.http.message.BasicHttpRequest;
-import org.apache.http.message.BasicHttpResponse;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -103,7 +101,7 @@ public class TestCacheInvalidator {
 
     @Test
     public void testInvalidatesUrisInContentLocationHeadersOnPUTs() throws Exception {
-        final HttpEntityEnclosingRequest putRequest = new BasicHttpEntityEnclosingRequest("PUT","/",HTTP_1_1);
+        final HttpRequest putRequest = new BasicHttpRequest("PUT","/",HTTP_1_1);
         putRequest.setEntity(HttpTestUtils.makeBody(128));
         putRequest.setHeader("Content-Length","128");
 
@@ -125,7 +123,7 @@ public class TestCacheInvalidator {
 
     @Test
     public void testInvalidatesUrisInLocationHeadersOnPUTs() throws Exception {
-        final HttpEntityEnclosingRequest putRequest = new BasicHttpEntityEnclosingRequest("PUT","/",HTTP_1_1);
+        final HttpRequest putRequest = new BasicHttpRequest("PUT","/",HTTP_1_1);
         putRequest.setEntity(HttpTestUtils.makeBody(128));
         putRequest.setHeader("Content-Length","128");
 
@@ -147,7 +145,7 @@ public class TestCacheInvalidator {
 
     @Test
     public void testInvalidatesRelativeUrisInContentLocationHeadersOnPUTs() throws Exception {
-        final HttpEntityEnclosingRequest putRequest = new BasicHttpEntityEnclosingRequest("PUT","/",HTTP_1_1);
+        final HttpRequest putRequest = new BasicHttpRequest("PUT","/",HTTP_1_1);
         putRequest.setEntity(HttpTestUtils.makeBody(128));
         putRequest.setHeader("Content-Length","128");
 
@@ -169,7 +167,7 @@ public class TestCacheInvalidator {
 
     @Test
     public void testDoesNotInvalidateUrisInContentLocationHeadersOnPUTsToDifferentHosts() throws Exception {
-        final HttpEntityEnclosingRequest putRequest = new BasicHttpEntityEnclosingRequest("PUT","/",HTTP_1_1);
+        final HttpRequest putRequest = new BasicHttpRequest("PUT","/",HTTP_1_1);
         putRequest.setEntity(HttpTestUtils.makeBody(128));
         putRequest.setHeader("Content-Length","128");
 

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheKeyGenerator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheKeyGenerator.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheKeyGenerator.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheKeyGenerator.java Tue Jan 12 20:43:36 2016
@@ -30,14 +30,14 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
-import org.apache.http.Header;
-import org.apache.http.HttpHost;
-import org.apache.http.HttpRequest;
-import org.apache.http.HttpVersion;
+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.HttpVersion;
+import org.apache.hc.core5.http.message.BasicHeader;
+import org.apache.hc.core5.http.message.BasicHttpRequest;
 import org.apache.http.client.cache.HttpCacheEntry;
 import org.apache.http.client.methods.HttpGet;
-import org.apache.http.message.BasicHeader;
-import org.apache.http.message.BasicHttpRequest;
 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/TestCacheValidityPolicy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheValidityPolicy.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheValidityPolicy.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheValidityPolicy.java Tue Jan 12 20:43:36 2016
@@ -34,14 +34,14 @@ import static org.junit.Assert.assertTru
 
 import java.util.Date;
 
-import org.apache.http.Header;
-import org.apache.http.HttpRequest;
-import org.apache.http.HttpVersion;
+import org.apache.hc.core5.http.Header;
+import org.apache.hc.core5.http.HttpHeaders;
+import org.apache.hc.core5.http.HttpRequest;
+import org.apache.hc.core5.http.HttpVersion;
+import org.apache.hc.core5.http.message.BasicHeader;
+import org.apache.hc.core5.http.message.BasicHttpRequest;
 import org.apache.http.client.cache.HttpCacheEntry;
 import org.apache.http.client.utils.DateUtils;
-import org.apache.http.message.BasicHeader;
-import org.apache.http.message.BasicHttpRequest;
-import org.apache.http.protocol.HTTP;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -341,7 +341,7 @@ public class TestCacheValidityPolicy {
     @Test
     public void testCorrectContentLengthDoesntInvalidateEntry() {
         final int contentLength = 128;
-        final Header[] headers = { new BasicHeader(HTTP.CONTENT_LEN, Integer.toString(contentLength)) };
+        final Header[] headers = { new BasicHeader(HttpHeaders.CONTENT_LENGTH, Integer.toString(contentLength)) };
         final HttpCacheEntry entry = HttpTestUtils.makeCacheEntry(headers, HttpTestUtils.getRandomBytes(contentLength));
         assertTrue(impl.contentLengthHeaderMatchesActualLength(entry));
     }
@@ -349,7 +349,7 @@ public class TestCacheValidityPolicy {
     @Test
     public void testWrongContentLengthInvalidatesEntry() {
         final int contentLength = 128;
-        final Header[] headers = {new BasicHeader(HTTP.CONTENT_LEN, Integer.toString(contentLength+1))};
+        final Header[] headers = {new BasicHeader(HttpHeaders.CONTENT_LENGTH, Integer.toString(contentLength+1))};
         final HttpCacheEntry entry = HttpTestUtils.makeCacheEntry(headers, HttpTestUtils.getRandomBytes(contentLength));
         assertFalse(impl.contentLengthHeaderMatchesActualLength(entry));
     }
@@ -357,7 +357,7 @@ public class TestCacheValidityPolicy {
     @Test
     public void testNullResourceInvalidatesEntry() {
         final int contentLength = 128;
-        final Header[] headers = {new BasicHeader(HTTP.CONTENT_LEN, Integer.toString(contentLength))};
+        final Header[] headers = {new BasicHeader(HttpHeaders.CONTENT_LENGTH, Integer.toString(contentLength))};
         final HttpCacheEntry entry = HttpTestUtils.makeHeadCacheEntry(headers);
         assertFalse(impl.contentLengthHeaderMatchesActualLength(entry));
     }

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheableRequestPolicy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheableRequestPolicy.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheableRequestPolicy.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCacheableRequestPolicy.java Tue Jan 12 20:43:36 2016
@@ -26,7 +26,7 @@
  */
 package org.apache.http.impl.client.cache;
 
-import org.apache.http.message.BasicHttpRequest;
+import org.apache.hc.core5.http.message.BasicHttpRequest;
 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/TestCachedHttpResponseGenerator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachedHttpResponseGenerator.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachedHttpResponseGenerator.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachedHttpResponseGenerator.java Tue Jan 12 20:43:36 2016
@@ -35,11 +35,12 @@ import static org.mockito.Mockito.when;
 import java.util.Date;
 import java.util.HashMap;
 
-import org.apache.http.Header;
-import org.apache.http.HttpResponse;
+import org.apache.hc.core5.http.Header;
+import org.apache.hc.core5.http.HttpHost;
+import org.apache.hc.core5.http.HttpResponse;
+import org.apache.hc.core5.http.message.BasicHeader;
 import org.apache.http.client.cache.HttpCacheEntry;
 import org.apache.http.client.methods.HttpRequestWrapper;
-import org.apache.http.message.BasicHeader;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -47,6 +48,7 @@ import org.junit.Test;
 @SuppressWarnings({"boxing","static-access"}) // test code
 public class TestCachedHttpResponseGenerator {
 
+    private HttpHost host;
     private HttpCacheEntry entry;
     private HttpRequestWrapper request;
     private CacheValidityPolicy mockValidityPolicy;
@@ -54,8 +56,9 @@ public class TestCachedHttpResponseGener
 
     @Before
     public void setUp() {
+        host = new HttpHost("foo.example.com", 80);
         entry = HttpTestUtils.makeCacheEntry(new HashMap<String, String>());
-        request = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        request = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
         mockValidityPolicy = mock(CacheValidityPolicy.class);
         impl = new CachedHttpResponseGenerator(mockValidityPolicy);
     }
@@ -159,7 +162,7 @@ public class TestCachedHttpResponseGener
 
     @Test
     public void testResponseDoesNotContainEntityToServeHEADRequestIfEntryContainsResource() throws Exception {
-        final HttpRequestWrapper headRequest = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultHEADRequest());
+        final HttpRequestWrapper headRequest = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultHEADRequest(), host);
         final HttpResponse response = impl.generateResponse(headRequest, entry);
 
         Assert.assertNull(response.getEntity());

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachedResponseSuitabilityChecker.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachedResponseSuitabilityChecker.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachedResponseSuitabilityChecker.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachedResponseSuitabilityChecker.java Tue Jan 12 20:43:36 2016
@@ -28,14 +28,14 @@ package org.apache.http.impl.client.cach
 
 import java.util.Date;
 
-import org.apache.http.Header;
-import org.apache.http.HttpHost;
-import org.apache.http.HttpRequest;
-import org.apache.http.HttpVersion;
+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.HttpVersion;
+import org.apache.hc.core5.http.message.BasicHeader;
+import org.apache.hc.core5.http.message.BasicHttpRequest;
 import org.apache.http.client.cache.HttpCacheEntry;
 import org.apache.http.client.utils.DateUtils;
-import org.apache.http.message.BasicHeader;
-import org.apache.http.message.BasicHttpRequest;
 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/TestCachingExec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExec.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExec.java Tue Jan 12 20:43:36 2016
@@ -45,11 +45,17 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import org.apache.http.HttpHost;
-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.HeaderElements;
+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.HttpVersion;
+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.hc.core5.http.message.BasicStatusLine;
 import org.apache.http.client.cache.HttpCacheEntry;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpExecutionAware;
@@ -58,14 +64,9 @@ import org.apache.http.client.methods.Ht
 import org.apache.http.client.protocol.HttpClientContext;
 import org.apache.http.client.utils.DateUtils;
 import org.apache.http.conn.routing.HttpRoute;
-import org.apache.http.entity.InputStreamEntity;
 import org.apache.http.impl.execchain.ClientExecChain;
-import org.apache.http.message.BasicHttpRequest;
-import org.apache.http.message.BasicHttpResponse;
-import org.apache.http.message.BasicStatusLine;
-import org.apache.http.protocol.HTTP;
-import org.easymock.IExpectationSetters;
 import org.easymock.EasyMock;
+import org.easymock.IExpectationSetters;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -252,7 +253,7 @@ public class TestCachingExec extends Tes
         mockImplMethods(GET_CURRENT_DATE, HANDLE_BACKEND_RESPONSE);
 
         final HttpRequestWrapper validate = HttpRequestWrapper.wrap(
-                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1));
+                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1), host);
         final CloseableHttpResponse originResponse = Proxies.enhanceResponse(
                 new BasicHttpResponse(HttpVersion.HTTP_1_1,  HttpStatus.SC_NOT_FOUND, "Not Found"));
         final CloseableHttpResponse finalResponse = Proxies.enhanceResponse(
@@ -284,7 +285,7 @@ public class TestCachingExec extends Tes
         mockImplMethods(GET_CURRENT_DATE);
 
         final HttpRequestWrapper validate = HttpRequestWrapper.wrap(
-                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1));
+                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1), host);
         final HttpResponse originResponse = Proxies.enhanceResponse(
             new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_NOT_MODIFIED, "Not Modified"));
         final HttpCacheEntry updatedEntry = HttpTestUtils.makeCacheEntry();
@@ -318,9 +319,9 @@ public class TestCachingExec extends Tes
         EasyMock.resetToStrict(mockBackend);
 
         final HttpRequestWrapper validate = HttpRequestWrapper.wrap(
-                new HttpGet("http://foo.example.com/resource"));
+                new HttpGet("http://foo.example.com/resource"), host);
         final HttpRequestWrapper relativeValidate = HttpRequestWrapper.wrap(
-                new BasicHttpRequest("GET", "/resource", HttpVersion.HTTP_1_1));
+                new BasicHttpRequest("GET", "/resource", HttpVersion.HTTP_1_1), host);
         final CloseableHttpResponse originResponse = Proxies.enhanceResponse(
             new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "Okay"));
 
@@ -346,7 +347,7 @@ public class TestCachingExec extends Tes
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
         resp1.setHeader("Date", DateUtils.formatDate(new Date()));
         resp1.setHeader("Server", "MockOrigin/1.0");
-        resp1.setHeader(HTTP.TRANSFER_ENCODING, HTTP.CHUNK_CODING);
+        resp1.setHeader(HttpHeaders.TRANSFER_ENCODING, HeaderElements.CHUNKED_ENCODING);
 
         final AtomicInteger size = new AtomicInteger();
         final AtomicInteger maxlength = new AtomicInteger(Integer.MAX_VALUE);
@@ -380,7 +381,7 @@ public class TestCachingExec extends Tes
                 EasyMock.<HttpExecutionAware>isNull());
         EasyMock.expect(resp).andReturn(Proxies.enhanceResponse(resp1));
 
-        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
 
         replayMocks();
         final CloseableHttpResponse resp2 = impl.execute(route, req1, context, null);

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExecChain.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExecChain.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExecChain.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCachingExecChain.java Tue Jan 12 20:43:36 2016
@@ -48,15 +48,18 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
-import junit.framework.AssertionFailedError;
-
-import org.apache.http.Header;
-import org.apache.http.HttpHost;
-import org.apache.http.HttpRequest;
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpStatus;
-import org.apache.http.HttpVersion;
-import org.apache.http.StatusLine;
+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.HttpResponse;
+import org.apache.hc.core5.http.HttpStatus;
+import org.apache.hc.core5.http.HttpVersion;
+import org.apache.hc.core5.http.StatusLine;
+import org.apache.hc.core5.http.entity.EntityUtils;
+import org.apache.hc.core5.http.entity.InputStreamEntity;
+import org.apache.hc.core5.http.message.BasicHeader;
+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.ResponseHandler;
 import org.apache.http.client.cache.CacheResponseStatus;
@@ -72,19 +75,16 @@ import org.apache.http.client.methods.Ht
 import org.apache.http.client.protocol.HttpClientContext;
 import org.apache.http.client.utils.DateUtils;
 import org.apache.http.conn.routing.HttpRoute;
-import org.apache.http.entity.InputStreamEntity;
 import org.apache.http.impl.execchain.ClientExecChain;
-import org.apache.http.message.BasicHeader;
-import org.apache.http.message.BasicHttpRequest;
-import org.apache.http.message.BasicHttpResponse;
-import org.apache.http.util.EntityUtils;
 import org.easymock.Capture;
-import org.easymock.IExpectationSetters;
 import org.easymock.EasyMock;
+import org.easymock.IExpectationSetters;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
+import junit.framework.AssertionFailedError;
+
 @SuppressWarnings("boxing") // test code
 public abstract class TestCachingExecChain {
 
@@ -142,7 +142,7 @@ public abstract class TestCachingExecCha
         host = new HttpHost("foo.example.com", 80);
         route = new HttpRoute(host);
         request = HttpRequestWrapper.wrap(new BasicHttpRequest("GET", "/stuff",
-            HttpVersion.HTTP_1_1));
+            HttpVersion.HTTP_1_1), host);
         context = HttpCacheContext.create();
         context.setTargetHost(host);
         entry = HttpTestUtils.makeCacheEntry();
@@ -218,13 +218,13 @@ public abstract class TestCachingExecCha
     public void testCacheableResponsesGoIntoCache() throws Exception {
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
 
-        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
         final HttpResponse resp1 = HttpTestUtils.make200Response();
         resp1.setHeader("Cache-Control", "max-age=3600");
 
         backendExpectsAnyRequestAndReturn(resp1);
 
-        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
 
         replayMocks();
         impl.execute(route, req1, context, null);
@@ -238,7 +238,7 @@ public abstract class TestCachingExecCha
         final Date now = new Date();
         final Date fiveSecondsAgo = new Date(now.getTime() - 5 * 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(now));
         resp1.setHeader("Cache-Control", "max-age=3600");
@@ -246,7 +246,7 @@ public abstract class TestCachingExecCha
 
         backendExpectsAnyRequestAndReturn(resp1);
 
-        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
         req2.setHeader("Cache-Control", "no-cache");
         final HttpResponse resp2 = HttpTestUtils.make200Response();
         resp2.setHeader("ETag", "\"old-etag\"");
@@ -255,7 +255,7 @@ public abstract class TestCachingExecCha
 
         backendExpectsAnyRequestAndReturn(resp2);
 
-        final HttpRequestWrapper req3 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req3 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
 
         replayMocks();
         impl.execute(route, req1, context, null);
@@ -272,7 +272,7 @@ public abstract class TestCachingExecCha
         final Date now = new Date();
         final Date fiveSecondsAgo = new Date(now.getTime() - 5 * 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(fiveSecondsAgo));
         resp1.setHeader("Cache-Control", "max-age=3600");
@@ -280,7 +280,7 @@ public abstract class TestCachingExecCha
 
         backendExpectsAnyRequestAndReturn(resp1);
 
-        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
         req2.setHeader("Cache-Control", "max-age=0");
         final HttpResponse resp2 = HttpTestUtils.make200Response();
         resp2.setHeader("ETag", "\"new-etag\"");
@@ -289,7 +289,7 @@ public abstract class TestCachingExecCha
 
         backendExpectsAnyRequestAndReturn(resp2);
 
-        final HttpRequestWrapper req3 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req3 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
 
         replayMocks();
         impl.execute(route, req1, context, null);
@@ -332,7 +332,7 @@ public abstract class TestCachingExecCha
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(new HeapResourceFactory(),
             mockStorage, configDefault), configDefault);
 
-        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest());
+        final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(HttpTestUtils.makeDefaultRequest(), host);
         final HttpResponse resp1 = HttpTestUtils.make200Response();
         resp1.setHeader("Cache-Control", "no-cache");
 
@@ -389,7 +389,7 @@ public abstract class TestCachingExecCha
     public void testSetsModuleGeneratedResponseContextForCacheOptionsResponse() throws Exception {
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
         final HttpRequestWrapper req = HttpRequestWrapper.wrap(new BasicHttpRequest("OPTIONS", "*",
-            HttpVersion.HTTP_1_1));
+            HttpVersion.HTTP_1_1), host);
         req.setHeader("Max-Forwards", "0");
 
         impl.execute(route, req, context, null);
@@ -402,7 +402,7 @@ public abstract class TestCachingExecCha
         throws Exception {
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
         final HttpRequestWrapper req = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         req.setHeader("Range", "bytes=0-50");
         req.setHeader("If-Range", "W/\"weak-etag\"");
 
@@ -416,7 +416,7 @@ public abstract class TestCachingExecCha
         throws Exception {
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
         final HttpRequestWrapper req = HttpRequestWrapper.wrap(new BasicHttpRequest("GET", "/",
-            HttpVersion.HTTP_1_0));
+            HttpVersion.HTTP_1_0), host);
         req.setHeader("Cache-Control", "no-cache");
         final HttpResponse resp = new BasicHttpResponse(HttpVersion.HTTP_1_1,
             HttpStatus.SC_NO_CONTENT, "No Content");
@@ -438,7 +438,7 @@ public abstract class TestCachingExecCha
     public void testSetsCacheMissContextIfRequestNotServableFromCache() throws Exception {
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
         final HttpRequestWrapper req = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         req.setHeader("Cache-Control", "no-cache");
         final HttpResponse resp = new BasicHttpResponse(HttpVersion.HTTP_1_1,
             HttpStatus.SC_NO_CONTENT, "No Content");
@@ -455,7 +455,7 @@ public abstract class TestCachingExecCha
     public void testSetsViaHeaderOnResponseIfRequestNotServableFromCache() throws Exception {
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
         final HttpRequestWrapper req = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         req.setHeader("Cache-Control", "no-cache");
         final HttpResponse resp = new BasicHttpResponse(HttpVersion.HTTP_1_1,
             HttpStatus.SC_NO_CONTENT, "No Content");
@@ -472,7 +472,7 @@ public abstract class TestCachingExecCha
     public void testSetsViaHeaderOnResponseForCacheMiss() throws Exception {
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK,
             "OK");
         resp1.setEntity(HttpTestUtils.makeBody(128));
@@ -493,9 +493,9 @@ public abstract class TestCachingExecCha
     public void testSetsCacheHitContextIfRequestServedFromCache() throws Exception {
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK,
             "OK");
         resp1.setEntity(HttpTestUtils.makeBody(128));
@@ -517,9 +517,9 @@ public abstract class TestCachingExecCha
     public void testSetsViaHeaderOnResponseIfRequestServedFromCache() throws Exception {
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK,
             "OK");
         resp1.setEntity(HttpTestUtils.makeBody(128));
@@ -543,9 +543,9 @@ public abstract class TestCachingExecCha
         final Date tenSecondsAgo = new Date(now.getTime() - 10 * 1000L);
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         req2.addHeader("If-Modified-Since", DateUtils.formatDate(now));
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK,
             "OK");
@@ -573,10 +573,10 @@ public abstract class TestCachingExecCha
         final Date inTenMinutes = new Date(now.getTime() + 600 * 1000L);
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         req1.addHeader("If-Modified-Since", DateUtils.formatDate(oneHourAgo));
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         req2.addHeader("If-Modified-Since", DateUtils.formatDate(oneHourAgo));
 
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1,
@@ -609,9 +609,9 @@ public abstract class TestCachingExecCha
         final Date tenSecondsAgo = new Date(now.getTime() - 10 * 1000L);
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
 
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK,
             "OK");
@@ -644,9 +644,9 @@ public abstract class TestCachingExecCha
         final Date tenSecondsAfter = new Date(now.getTime() + 10 * 1000L);
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
 
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK,
             "OK");
@@ -674,9 +674,9 @@ public abstract class TestCachingExecCha
     public void testReturns304ForIfNoneMatchHeaderIfRequestServedFromCache() throws Exception {
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         req2.addHeader("If-None-Match", "*");
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK,
             "OK");
@@ -700,9 +700,9 @@ public abstract class TestCachingExecCha
     public void testReturns200ForIfNoneMatchHeaderFails() throws Exception {
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
 
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK,
             "OK");
@@ -734,9 +734,9 @@ public abstract class TestCachingExecCha
         final Date now = new Date();
         final Date tenSecondsAgo = new Date(now.getTime() - 10 * 1000L);
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
 
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK,
             "OK");
@@ -766,9 +766,9 @@ public abstract class TestCachingExecCha
         final Date now = new Date();
         final Date tenSecondsAgo = new Date(now.getTime() - 10 * 1000L);
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         req2.addHeader("If-None-Match", "\"abc\"");
         req2.addHeader("If-Modified-Since", DateUtils.formatDate(now));
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK,
@@ -798,10 +798,10 @@ public abstract class TestCachingExecCha
             .setSharedCache(true).build());
         final Date now = new Date();
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpOptions(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         req1.setHeader("Authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         req2.setHeader("Authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1,
             HttpStatus.SC_NO_CONTENT, "No Content");
@@ -836,9 +836,9 @@ public abstract class TestCachingExecCha
 
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
 
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK,
             "OK");
@@ -873,9 +873,9 @@ public abstract class TestCachingExecCha
 
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
 
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK,
             "OK");
@@ -910,9 +910,9 @@ public abstract class TestCachingExecCha
 
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
 
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK,
             "OK");
@@ -940,9 +940,9 @@ public abstract class TestCachingExecCha
 
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
 
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK,
             "OK");
@@ -969,9 +969,9 @@ public abstract class TestCachingExecCha
 
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
 
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK,
             "OK");
@@ -999,9 +999,9 @@ public abstract class TestCachingExecCha
 
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
 
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK,
             "OK");
@@ -1036,9 +1036,9 @@ public abstract class TestCachingExecCha
 
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
 
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK,
             "OK");
@@ -1076,9 +1076,9 @@ public abstract class TestCachingExecCha
         final Date tenSecondsAgo = new Date(now.getTime() - 10 * 1000L);
 
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
 
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK,
             "OK");
@@ -1115,9 +1115,9 @@ public abstract class TestCachingExecCha
         final Date tenSecondsAgo = new Date(now.getTime() - 10 * 1000L);
 
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
 
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK,
             "OK");
@@ -1155,7 +1155,7 @@ public abstract class TestCachingExecCha
         final Date now = new Date();
 
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com"));
+            "http://foo.example.com"), host);
         req1.addHeader("Accept-Encoding", "gzip");
 
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK,
@@ -1168,11 +1168,11 @@ public abstract class TestCachingExecCha
         resp1.setHeader("Cache-Control", "public, max-age=3600");
 
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com"));
+            "http://foo.example.com"), host);
         req2.addHeader("Accept-Encoding", "deflate");
 
         final HttpRequestWrapper req2Server = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com"));
+            "http://foo.example.com"), host);
         req2Server.addHeader("Accept-Encoding", "deflate");
         req2Server.addHeader("If-None-Match", "\"gzip_etag\"");
 
@@ -1186,11 +1186,11 @@ public abstract class TestCachingExecCha
         resp2.setHeader("Cache-Control", "public, max-age=3600");
 
         final HttpRequestWrapper req3 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com"));
+            "http://foo.example.com"), host);
         req3.addHeader("Accept-Encoding", "gzip,deflate");
 
         final HttpRequestWrapper req3Server = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com"));
+            "http://foo.example.com"), host);
         req3Server.addHeader("Accept-Encoding", "gzip,deflate");
         req3Server.addHeader("If-None-Match", "\"gzip_etag\",\"deflate_etag\"");
 
@@ -1226,7 +1226,7 @@ public abstract class TestCachingExecCha
         final Date now = new Date();
 
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com"));
+            "http://foo.example.com"), host);
         req1.addHeader("Accept-Encoding", "gzip");
 
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK,
@@ -1239,11 +1239,11 @@ public abstract class TestCachingExecCha
         resp1.setHeader("Cache-Control", "public, max-age=3600");
 
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com"));
+            "http://foo.example.com"), host);
         req2.addHeader("Accept-Encoding", "deflate");
 
         final HttpRequestWrapper req2Server = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com"));
+            "http://foo.example.com"), host);
         req2Server.addHeader("Accept-Encoding", "deflate");
         req2Server.addHeader("If-None-Match", "\"gzip_etag\"");
 
@@ -1257,12 +1257,12 @@ public abstract class TestCachingExecCha
         resp2.setHeader("Cache-Control", "public, max-age=3600");
 
         final HttpRequestWrapper req4 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com"));
+            "http://foo.example.com"), host);
         req4.addHeader("Accept-Encoding", "gzip,identity");
         req4.addHeader("If-None-Match", "\"gzip_etag\"");
 
         final HttpRequestWrapper req4Server = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com"));
+            "http://foo.example.com"), host);
         req4Server.addHeader("Accept-Encoding", "gzip,identity");
         req4Server.addHeader("If-None-Match", "\"gzip_etag\"");
 
@@ -1296,7 +1296,7 @@ public abstract class TestCachingExecCha
         final Date now = new Date();
 
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com"));
+            "http://foo.example.com"), host);
 
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK,
             "OK");
@@ -1502,7 +1502,6 @@ public abstract class TestCachingExecCha
         ctx.setTargetHost(host);
         impl.execute(route, request, context, null);
         impl.execute(route, request, ctx, null);
-        assertTrue(ctx.isRequestSent());
     }
 
     @Test
@@ -1527,7 +1526,7 @@ public abstract class TestCachingExecCha
 
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         req1.addHeader("If-None-Match", "\"etag\"");
 
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1,
@@ -1554,11 +1553,11 @@ public abstract class TestCachingExecCha
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
 
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         req1.addHeader("If-None-Match", "etag");
 
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         req2.addHeader("If-None-Match", "etag");
 
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1,
@@ -1594,11 +1593,11 @@ public abstract class TestCachingExecCha
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
 
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         req1.addHeader("If-None-Match", "etag");
 
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         req2.addHeader("If-None-Match", "etag");
 
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1,
@@ -1637,11 +1636,11 @@ public abstract class TestCachingExecCha
         impl = createCachingExecChain(mockBackend, new BasicHttpCache(), CacheConfig.DEFAULT);
 
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
         req1.addHeader("If-None-Match", "etag");
 
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(new HttpGet(
-            "http://foo.example.com/"));
+            "http://foo.example.com/"), host);
 
         final HttpResponse resp1 = new BasicHttpResponse(HttpVersion.HTTP_1_1,
             HttpStatus.SC_NOT_MODIFIED, "Not modified");

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCombinedEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCombinedEntity.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCombinedEntity.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestCombinedEntity.java Tue Jan 12 20:43:36 2016
@@ -32,8 +32,8 @@ import static org.mockito.Mockito.when;
 
 import java.io.ByteArrayInputStream;
 
+import org.apache.hc.core5.http.entity.EntityUtils;
 import org.apache.http.client.cache.Resource;
-import org.apache.http.util.EntityUtils;
 import org.junit.Assert;
 import org.junit.Test;
 

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestConditionalRequestBuilder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestConditionalRequestBuilder.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestConditionalRequestBuilder.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestConditionalRequestBuilder.java Tue Jan 12 20:43:36 2016
@@ -30,17 +30,18 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.http.Header;
-import org.apache.http.HeaderElement;
-import org.apache.http.HttpRequest;
-import org.apache.http.HttpVersion;
-import org.apache.http.ProtocolException;
+import org.apache.hc.core5.http.Header;
+import org.apache.hc.core5.http.HeaderElement;
+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.ProtocolException;
+import org.apache.hc.core5.http.message.BasicHeader;
+import org.apache.hc.core5.http.message.BasicHttpRequest;
 import org.apache.http.client.cache.HeaderConstants;
 import org.apache.http.client.cache.HttpCacheEntry;
 import org.apache.http.client.methods.HttpRequestWrapper;
 import org.apache.http.client.utils.DateUtils;
-import org.apache.http.message.BasicHeader;
-import org.apache.http.message.BasicHttpRequest;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -48,14 +49,16 @@ import org.junit.Test;
 public class TestConditionalRequestBuilder {
 
     private ConditionalRequestBuilder impl;
+    private HttpHost host;
     private HttpRequestWrapper request;
     private HttpCacheEntry entry;
 
     @Before
     public void setUp() throws Exception {
         impl = new ConditionalRequestBuilder();
+        host = new HttpHost("foo.example.com", 80);
         request = HttpRequestWrapper.wrap(
-                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1));
+                new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1), host);
         entry = HttpTestUtils.makeCacheEntry();
     }
 
@@ -67,7 +70,7 @@ public class TestConditionalRequestBuild
 
         final HttpRequest basicRequest = new BasicHttpRequest(theMethod, theUri);
         basicRequest.addHeader("Accept-Encoding", "gzip");
-        final HttpRequestWrapper requestWrapper = HttpRequestWrapper.wrap(basicRequest);
+        final HttpRequestWrapper requestWrapper = HttpRequestWrapper.wrap(basicRequest, host);
 
         final Header[] headers = new Header[] {
                 new BasicHeader("Date", DateUtils.formatDate(new Date())),
@@ -105,7 +108,7 @@ public class TestConditionalRequestBuild
             new BasicHeader("ETag", etag)
         };
         final HttpRequest basicRequest = new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1);
-        final HttpRequestWrapper requestWrapper = HttpRequestWrapper.wrap(basicRequest);
+        final HttpRequestWrapper requestWrapper = HttpRequestWrapper.wrap(basicRequest, host);
         final HttpCacheEntry cacheEntry = HttpTestUtils.makeCacheEntry(headers);
         final HttpRequest result = impl.buildConditionalRequest(requestWrapper, cacheEntry);
         Assert.assertEquals(lmDate,
@@ -122,7 +125,7 @@ public class TestConditionalRequestBuild
 
         final HttpRequest basicRequest = new BasicHttpRequest(theMethod, theUri);
         basicRequest.addHeader("Accept-Encoding", "gzip");
-        final HttpRequestWrapper requestWrapper = HttpRequestWrapper.wrap(basicRequest);
+        final HttpRequestWrapper requestWrapper = HttpRequestWrapper.wrap(basicRequest, host);
 
         final Header[] headers = new Header[] {
                 new BasicHeader("Date", DateUtils.formatDate(new Date())),
@@ -152,7 +155,7 @@ public class TestConditionalRequestBuild
     @Test
     public void testCacheEntryWithMustRevalidateDoesEndToEndRevalidation() throws Exception {
         final HttpRequest basicRequest = new BasicHttpRequest("GET","/",HttpVersion.HTTP_1_1);
-        final HttpRequestWrapper requestWrapper = HttpRequestWrapper.wrap(basicRequest);
+        final HttpRequestWrapper requestWrapper = HttpRequestWrapper.wrap(basicRequest, host);
         final Date now = new Date();
         final Date elevenSecondsAgo = new Date(now.getTime() - 11 * 1000L);
         final Date tenSecondsAgo = new Date(now.getTime() - 10 * 1000L);
@@ -181,7 +184,7 @@ public class TestConditionalRequestBuild
     @Test
     public void testCacheEntryWithProxyRevalidateDoesEndToEndRevalidation() throws Exception {
         final HttpRequest basicRequest = new BasicHttpRequest("GET","/",HttpVersion.HTTP_1_1);
-        final HttpRequestWrapper requestWrapper = HttpRequestWrapper.wrap(basicRequest);
+        final HttpRequestWrapper requestWrapper = HttpRequestWrapper.wrap(basicRequest, host);
         final Date now = new Date();
         final Date elevenSecondsAgo = new Date(now.getTime() - 11 * 1000L);
         final Date tenSecondsAgo = new Date(now.getTime() - 10 * 1000L);
@@ -218,7 +221,7 @@ public class TestConditionalRequestBuild
     public void testBuildUnconditionalRequestUsesRequestUri()
         throws Exception {
         final String uri = "/theURI";
-        request = HttpRequestWrapper.wrap(new BasicHttpRequest("GET", uri, HttpVersion.HTTP_1_1));
+        request = HttpRequestWrapper.wrap(new BasicHttpRequest("GET", uri, HttpVersion.HTTP_1_1), host);
         final HttpRequest result = impl.buildUnconditionalRequest(request, entry);
         Assert.assertEquals(uri, result.getRequestLine().getUri());
     }

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestExponentialBackingOffSchedulingStrategy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestExponentialBackingOffSchedulingStrategy.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestExponentialBackingOffSchedulingStrategy.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestExponentialBackingOffSchedulingStrategy.java Tue Jan 12 20:43:36 2016
@@ -30,18 +30,18 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
-import org.apache.http.HttpHost;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.hc.core5.http.HttpHost;
+import org.apache.hc.core5.http.message.BasicHttpRequest;
 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.impl.execchain.ClientExecChain;
-import org.apache.http.message.BasicHttpRequest;
 import org.junit.Before;
 import org.junit.Test;
 
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
 public class TestExponentialBackingOffSchedulingStrategy {
 
     private ScheduledExecutorService mockExecutor;
@@ -159,8 +159,9 @@ public class TestExponentialBackingOffSc
         final ClientExecChain clientExecChain = mock(ClientExecChain.class);
         final CachingExec cachingHttpClient = new CachingExec(clientExecChain);
         final AsynchronousValidator mockValidator = new AsynchronousValidator(impl);
-        final HttpRoute httpRoute = new HttpRoute(new HttpHost("foo.example.com", 80));
-        final HttpRequestWrapper httpRequestWrapper = HttpRequestWrapper.wrap(new BasicHttpRequest("GET", "/"));
+        final HttpHost host = new HttpHost("foo.example.com", 80);
+        final HttpRoute httpRoute = new HttpRoute(host);
+        final HttpRequestWrapper httpRequestWrapper = HttpRequestWrapper.wrap(new BasicHttpRequest("GET", "/"), host);
         final HttpClientContext httpClientContext = new HttpClientContext();
         return new AsynchronousValidationRequest(mockValidator, cachingHttpClient, httpRoute, httpRequestWrapper,
                 httpClientContext, null, null, "identifier", errorCount);

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheEntrySerializers.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheEntrySerializers.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheEntrySerializers.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheEntrySerializers.java Tue Jan 12 20:43:36 2016
@@ -39,15 +39,15 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.commons.codec.binary.Base64;
-import org.apache.http.Header;
-import org.apache.http.ProtocolVersion;
-import org.apache.http.StatusLine;
+import org.apache.hc.core5.http.Header;
+import org.apache.hc.core5.http.ProtocolVersion;
+import org.apache.hc.core5.http.StatusLine;
+import org.apache.hc.core5.http.message.BasicHeader;
+import org.apache.hc.core5.http.message.BasicStatusLine;
 import org.apache.http.client.cache.HeaderConstants;
 import org.apache.http.client.cache.HttpCacheEntry;
 import org.apache.http.client.cache.HttpCacheEntrySerializer;
 import org.apache.http.client.cache.Resource;
-import org.apache.http.message.BasicHeader;
-import org.apache.http.message.BasicStatusLine;
 import org.junit.Before;
 import org.junit.Test;
 

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheJiraNumber1147.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheJiraNumber1147.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheJiraNumber1147.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestHttpCacheJiraNumber1147.java Tue Jan 12 20:43:36 2016
@@ -36,9 +36,10 @@ import static org.mockito.Mockito.when;
 import java.io.File;
 import java.util.Date;
 
-import org.apache.http.HttpHost;
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpVersion;
+import org.apache.hc.core5.http.HttpHost;
+import org.apache.hc.core5.http.HttpResponse;
+import org.apache.hc.core5.http.HttpVersion;
+import org.apache.hc.core5.http.message.BasicHttpResponse;
 import org.apache.http.client.cache.HttpCacheStorage;
 import org.apache.http.client.cache.ResourceFactory;
 import org.apache.http.client.methods.HttpExecutionAware;
@@ -48,7 +49,6 @@ import org.apache.http.client.protocol.H
 import org.apache.http.client.utils.DateUtils;
 import org.apache.http.conn.routing.HttpRoute;
 import org.apache.http.impl.execchain.ClientExecChain;
-import org.apache.http.message.BasicHttpResponse;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -95,7 +95,7 @@ public class TestHttpCacheJiraNumber1147
         final HttpCacheStorage httpCacheStorage = new ManagedHttpCacheStorage(cacheConfig);
 
         final ClientExecChain backend = mock(ClientExecChain.class);
-        final HttpRequestWrapper get = HttpRequestWrapper.wrap(new HttpGet("http://somehost/"));
+        final HttpRequestWrapper get = HttpRequestWrapper.wrap(new HttpGet("http://somehost/"), new HttpHost("somehost"));
         final HttpClientContext context = HttpClientContext.create();
         final HttpHost target = new HttpHost("somehost", 80);
         final HttpRoute route = new HttpRoute(target);

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestImmediateSchedulingStrategy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestImmediateSchedulingStrategy.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestImmediateSchedulingStrategy.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestImmediateSchedulingStrategy.java Tue Jan 12 20:43:36 2016
@@ -28,11 +28,11 @@ package org.apache.http.impl.client.cach
 
 import static org.mockito.Mockito.mock;
 
+import java.util.concurrent.ExecutorService;
+
 import org.junit.Before;
 import org.junit.Test;
 
-import java.util.concurrent.ExecutorService;
-
 public class TestImmediateSchedulingStrategy {
 
     private ExecutorService mockExecutor;

Modified: httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolAllowedBehavior.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolAllowedBehavior.java?rev=1724315&r1=1724314&r2=1724315&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolAllowedBehavior.java (original)
+++ httpcomponents/httpclient/trunk/httpclient-cache/src/test/java/org/apache/http/impl/client/cache/TestProtocolAllowedBehavior.java Tue Jan 12 20:43:36 2016
@@ -29,12 +29,12 @@ package org.apache.http.impl.client.cach
 import java.net.SocketTimeoutException;
 import java.util.Date;
 
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpStatus;
-import org.apache.http.HttpVersion;
+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.message.BasicHttpRequest;
 import org.apache.http.client.methods.HttpRequestWrapper;
 import org.apache.http.client.utils.DateUtils;
-import org.apache.http.message.BasicHttpRequest;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -49,7 +49,7 @@ public class TestProtocolAllowedBehavior
     public void testNonSharedCacheReturnsStaleResponseWhenRevalidationFailsForProxyRevalidate()
         throws Exception {
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(
-                new BasicHttpRequest("GET","/", HttpVersion.HTTP_1_1));
+                new BasicHttpRequest("GET","/", HttpVersion.HTTP_1_1), host);
         final Date now = new Date();
         final Date tenSecondsAgo = new Date(now.getTime() - 10 * 1000L);
         originResponse.setHeader("Date", DateUtils.formatDate(tenSecondsAgo));
@@ -59,7 +59,7 @@ public class TestProtocolAllowedBehavior
         backendExpectsAnyRequest().andReturn(originResponse);
 
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(
-                new BasicHttpRequest("GET","/", HttpVersion.HTTP_1_1));
+                new BasicHttpRequest("GET","/", HttpVersion.HTTP_1_1), host);
 
         backendExpectsAnyRequest().andThrow(new SocketTimeoutException());
 
@@ -76,13 +76,13 @@ public class TestProtocolAllowedBehavior
     public void testNonSharedCacheMayCacheResponsesWithCacheControlPrivate()
         throws Exception {
         final HttpRequestWrapper req1 = HttpRequestWrapper.wrap(
-                new BasicHttpRequest("GET","/", HttpVersion.HTTP_1_1));
+                new BasicHttpRequest("GET","/", HttpVersion.HTTP_1_1), host);
         originResponse.setHeader("Cache-Control","private,max-age=3600");
 
         backendExpectsAnyRequest().andReturn(originResponse);
 
         final HttpRequestWrapper req2 = HttpRequestWrapper.wrap(
-                new BasicHttpRequest("GET","/", HttpVersion.HTTP_1_1));
+                new BasicHttpRequest("GET","/", HttpVersion.HTTP_1_1), host);
 
         replayMocks();
         behaveAsNonSharedCache();



Mime
View raw message