hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1776187 [16/21] - in /httpcomponents/httpclient/trunk: ./ httpclient5-cache/src/main/java/org/apache/hc/client5/http/cache/ httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/ httpclient5-cache/src/test/java/org/apache/h...
Date Tue, 27 Dec 2016 19:48:10 GMT
Modified: httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/protocol/RequestClientConnControl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/protocol/RequestClientConnControl.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/protocol/RequestClientConnControl.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/protocol/RequestClientConnControl.java Tue Dec 27 19:48:07 2016
@@ -30,7 +30,9 @@ package org.apache.hc.client5.http.proto
 import java.io.IOException;
 
 import org.apache.hc.client5.http.RouteInfo;
-import org.apache.hc.core5.annotation.Immutable;
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
+import org.apache.hc.core5.http.EntityDetails;
 import org.apache.hc.core5.http.HeaderElements;
 import org.apache.hc.core5.http.HttpException;
 import org.apache.hc.core5.http.HttpHeaders;
@@ -48,7 +50,7 @@ import org.apache.logging.log4j.Logger;
  *
  * @since 4.0
  */
-@Immutable
+@Contract(threading = ThreadingBehavior.IMMUTABLE)
 public class RequestClientConnControl implements HttpRequestInterceptor {
 
     private final Logger log = LogManager.getLogger(getClass());
@@ -60,11 +62,11 @@ public class RequestClientConnControl im
     }
 
     @Override
-    public void process(final HttpRequest request, final HttpContext context)
+    public void process(final HttpRequest request, final EntityDetails entity, final HttpContext context)
             throws HttpException, IOException {
         Args.notNull(request, "HTTP request");
 
-        final String method = request.getRequestLine().getMethod();
+        final String method = request.getMethod();
         if (method.equalsIgnoreCase("CONNECT")) {
             request.setHeader(PROXY_CONN_DIRECTIVE, HeaderElements.KEEP_ALIVE);
             return;

Modified: httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/protocol/RequestDefaultHeaders.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/protocol/RequestDefaultHeaders.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/protocol/RequestDefaultHeaders.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/protocol/RequestDefaultHeaders.java Tue Dec 27 19:48:07 2016
@@ -30,7 +30,9 @@ package org.apache.hc.client5.http.proto
 import java.io.IOException;
 import java.util.Collection;
 
-import org.apache.hc.core5.annotation.Immutable;
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
+import org.apache.hc.core5.http.EntityDetails;
 import org.apache.hc.core5.http.Header;
 import org.apache.hc.core5.http.HttpException;
 import org.apache.hc.core5.http.HttpRequest;
@@ -43,7 +45,7 @@ import org.apache.hc.core5.util.Args;
  *
  * @since 4.0
  */
-@Immutable
+@Contract(threading = ThreadingBehavior.IMMUTABLE)
 public class RequestDefaultHeaders implements HttpRequestInterceptor {
 
     private final Collection<? extends Header> defaultHeaders;
@@ -61,11 +63,11 @@ public class RequestDefaultHeaders imple
     }
 
     @Override
-    public void process(final HttpRequest request, final HttpContext context)
+    public void process(final HttpRequest request, final EntityDetails entity, final HttpContext context)
             throws HttpException, IOException {
         Args.notNull(request, "HTTP request");
 
-        final String method = request.getRequestLine().getMethod();
+        final String method = request.getMethod();
         if (method.equalsIgnoreCase("CONNECT")) {
             return;
         }

Modified: httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/protocol/RequestExpectContinue.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/protocol/RequestExpectContinue.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/protocol/RequestExpectContinue.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/protocol/RequestExpectContinue.java Tue Dec 27 19:48:07 2016
@@ -30,9 +30,10 @@ package org.apache.hc.client5.http.proto
 import java.io.IOException;
 
 import org.apache.hc.client5.http.config.RequestConfig;
-import org.apache.hc.core5.annotation.Immutable;
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
+import org.apache.hc.core5.http.EntityDetails;
 import org.apache.hc.core5.http.HeaderElements;
-import org.apache.hc.core5.http.HttpEntity;
 import org.apache.hc.core5.http.HttpException;
 import org.apache.hc.core5.http.HttpHeaders;
 import org.apache.hc.core5.http.HttpRequest;
@@ -52,7 +53,7 @@ import org.apache.hc.core5.util.Args;
  *
  * @since 4.3
  */
-@Immutable
+@Contract(threading = ThreadingBehavior.IMMUTABLE)
 public class RequestExpectContinue implements HttpRequestInterceptor {
 
     public RequestExpectContinue() {
@@ -60,16 +61,15 @@ public class RequestExpectContinue imple
     }
 
     @Override
-    public void process(final HttpRequest request, final HttpContext context)
+    public void process(final HttpRequest request, final EntityDetails entity, final HttpContext context)
             throws HttpException, IOException {
         Args.notNull(request, "HTTP request");
 
         if (!request.containsHeader(HttpHeaders.EXPECT)) {
-            final ProtocolVersion ver = request.getRequestLine().getProtocolVersion();
-            final HttpEntity entity = request.getEntity();
+            final ProtocolVersion version = request.getVersion() != null ? request.getVersion() : HttpVersion.HTTP_1_1;
             // Do not send the expect header if request body is known to be empty
             if (entity != null
-                    && entity.getContentLength() != 0 && !ver.lessEquals(HttpVersion.HTTP_1_0)) {
+                    && entity.getContentLength() != 0 && !version.lessEquals(HttpVersion.HTTP_1_0)) {
                 final HttpClientContext clientContext = HttpClientContext.adapt(context);
                 final RequestConfig config = clientContext.getRequestConfig();
                 if (config.isExpectContinueEnabled()) {

Modified: httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/protocol/ResponseContentEncoding.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/protocol/ResponseContentEncoding.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/protocol/ResponseContentEncoding.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/protocol/ResponseContentEncoding.java Tue Dec 27 19:48:07 2016
@@ -32,12 +32,12 @@ import java.util.Locale;
 import java.util.zip.GZIPInputStream;
 
 import org.apache.hc.client5.http.config.RequestConfig;
-import org.apache.hc.client5.http.entity.DecompressingEntity;
 import org.apache.hc.client5.http.entity.DeflateInputStream;
 import org.apache.hc.client5.http.entity.InputStreamFactory;
-import org.apache.hc.core5.annotation.Immutable;
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
+import org.apache.hc.core5.http.EntityDetails;
 import org.apache.hc.core5.http.HeaderElement;
-import org.apache.hc.core5.http.HttpEntity;
 import org.apache.hc.core5.http.HttpException;
 import org.apache.hc.core5.http.HttpResponse;
 import org.apache.hc.core5.http.HttpResponseInterceptor;
@@ -56,11 +56,9 @@ import org.apache.hc.core5.http.protocol
  * @since 4.1
  *
  */
-@Immutable
+@Contract(threading = ThreadingBehavior.IMMUTABLE)
 public class ResponseContentEncoding implements HttpResponseInterceptor {
 
-    public static final String UNCOMPRESSED = "http.client.response.uncompressed";
-
     private final static InputStreamFactory GZIP = new InputStreamFactory() {
 
         @Override
@@ -123,8 +121,8 @@ public class ResponseContentEncoding imp
     @Override
     public void process(
             final HttpResponse response,
+            final EntityDetails entity,
             final HttpContext context) throws HttpException, IOException {
-        final HttpEntity entity = response.getEntity();
 
         final HttpClientContext clientContext = HttpClientContext.adapt(context);
         final RequestConfig requestConfig = clientContext.getRequestConfig();
@@ -139,10 +137,10 @@ public class ResponseContentEncoding imp
                     final String codecname = codec.getName().toLowerCase(Locale.ROOT);
                     final InputStreamFactory decoderFactory = decoderRegistry.lookup(codecname);
                     if (decoderFactory != null) {
-                        response.setEntity(new DecompressingEntity(response.getEntity(), decoderFactory));
-                        response.removeHeaders("Content-Length");
-                        response.removeHeaders("Content-Encoding");
-                        response.removeHeaders("Content-MD5");
+//                        response.setEntity(new DecompressingEntity(response.getEntity(), decoderFactory));
+//                        response.removeHeaders("Content-Length");
+//                        response.removeHeaders("Content-Encoding");
+//                        response.removeHeaders("Content-MD5");
                     } else {
                         if (!"identity".equals(codecname) && !ignoreUnknown) {
                             throw new HttpException("Unsupported Content-Encoding: " + codec.getName());

Modified: httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/protocol/ResponseProcessCookies.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/protocol/ResponseProcessCookies.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/protocol/ResponseProcessCookies.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/protocol/ResponseProcessCookies.java Tue Dec 27 19:48:07 2016
@@ -36,7 +36,9 @@ import org.apache.hc.client5.http.cookie
 import org.apache.hc.client5.http.cookie.CookieSpec;
 import org.apache.hc.client5.http.cookie.CookieStore;
 import org.apache.hc.client5.http.cookie.MalformedCookieException;
-import org.apache.hc.core5.annotation.Immutable;
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
+import org.apache.hc.core5.http.EntityDetails;
 import org.apache.hc.core5.http.Header;
 import org.apache.hc.core5.http.HttpException;
 import org.apache.hc.core5.http.HttpResponse;
@@ -52,7 +54,7 @@ import org.apache.logging.log4j.Logger;
  *
  * @since 4.0
  */
-@Immutable
+@Contract(threading = ThreadingBehavior.IMMUTABLE)
 public class ResponseProcessCookies implements HttpResponseInterceptor {
 
     private final Logger log = LogManager.getLogger(getClass());
@@ -62,7 +64,7 @@ public class ResponseProcessCookies impl
     }
 
     @Override
-    public void process(final HttpResponse response, final HttpContext context)
+    public void process(final HttpResponse response, final EntityDetails entity, final HttpContext context)
             throws HttpException, IOException {
         Args.notNull(response, "HTTP request");
         Args.notNull(context, "HTTP context");

Modified: httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixList.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixList.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixList.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixList.java Tue Dec 27 19:48:07 2016
@@ -29,7 +29,8 @@ package org.apache.hc.client5.http.psl;
 import java.util.Collections;
 import java.util.List;
 
-import org.apache.hc.core5.annotation.Immutable;
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
 import org.apache.hc.core5.util.Args;
 
 /**
@@ -41,7 +42,7 @@ import org.apache.hc.core5.util.Args;
  *
  * @since 4.4
  */
-@Immutable
+@Contract(threading = ThreadingBehavior.IMMUTABLE)
 public final class PublicSuffixList {
 
     private final DomainType type;

Modified: httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixListParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixListParser.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixListParser.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixListParser.java Tue Dec 27 19:48:07 2016
@@ -32,7 +32,8 @@ import java.io.Reader;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.hc.core5.annotation.Immutable;
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
 
 /**
  * Parses the list from <a href="http://publicsuffix.org/">publicsuffix.org</a>
@@ -40,7 +41,7 @@ import org.apache.hc.core5.annotation.Im
  *
  * @since 4.4
  */
-@Immutable
+@Contract(threading = ThreadingBehavior.IMMUTABLE)
 public final class PublicSuffixListParser {
 
     public PublicSuffixListParser() {

Modified: httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixMatcher.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixMatcher.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixMatcher.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixMatcher.java Tue Dec 27 19:48:07 2016
@@ -33,7 +33,8 @@ import java.util.Locale;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
-import org.apache.hc.core5.annotation.ThreadSafe;
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
 import org.apache.hc.core5.util.Args;
 
 /**
@@ -46,7 +47,7 @@ import org.apache.hc.core5.util.Args;
  *
  * @since 4.4
  */
-@ThreadSafe
+@Contract(threading = ThreadingBehavior.SAFE)
 public final class PublicSuffixMatcher {
 
     private final Map<String, DomainType> rules;

Modified: httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixMatcherLoader.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixMatcherLoader.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixMatcherLoader.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixMatcherLoader.java Tue Dec 27 19:48:07 2016
@@ -36,7 +36,8 @@ import java.nio.charset.StandardCharsets
 import java.util.Arrays;
 import java.util.List;
 
-import org.apache.hc.core5.annotation.ThreadSafe;
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
 import org.apache.hc.core5.util.Args;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
@@ -46,7 +47,7 @@ import org.apache.logging.log4j.Logger;
  *
  * @since 4.4
  */
-@ThreadSafe
+@Contract(threading = ThreadingBehavior.SAFE)
 public final class PublicSuffixMatcherLoader {
 
     private static PublicSuffixMatcher load(final InputStream in) throws IOException {

Modified: httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/socket/PlainConnectionSocketFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/socket/PlainConnectionSocketFactory.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/socket/PlainConnectionSocketFactory.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/socket/PlainConnectionSocketFactory.java Tue Dec 27 19:48:07 2016
@@ -31,7 +31,8 @@ import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.net.Socket;
 
-import org.apache.hc.core5.annotation.Immutable;
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
 import org.apache.hc.core5.http.HttpHost;
 import org.apache.hc.core5.http.protocol.HttpContext;
 
@@ -40,7 +41,7 @@ import org.apache.hc.core5.http.protocol
  *
  * @since 4.3
  */
-@Immutable
+@Contract(threading = ThreadingBehavior.IMMUTABLE)
 public class PlainConnectionSocketFactory implements ConnectionSocketFactory {
 
     public static final PlainConnectionSocketFactory INSTANCE = new PlainConnectionSocketFactory();

Modified: httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/DefaultHostnameVerifier.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/DefaultHostnameVerifier.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/DefaultHostnameVerifier.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/DefaultHostnameVerifier.java Tue Dec 27 19:48:07 2016
@@ -51,8 +51,9 @@ import javax.security.auth.x500.X500Prin
 
 import org.apache.hc.client5.http.psl.DomainType;
 import org.apache.hc.client5.http.psl.PublicSuffixMatcher;
-import org.apache.hc.client5.http.utils.InetAddressUtils;
-import org.apache.hc.core5.annotation.Immutable;
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
+import org.apache.hc.core5.net.InetAddressUtils;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 
@@ -61,7 +62,7 @@ import org.apache.logging.log4j.Logger;
  *
  * @since 4.4
  */
-@Immutable
+@Contract(threading = ThreadingBehavior.IMMUTABLE_CONDITIONAL)
 public final class DefaultHostnameVerifier implements HostnameVerifier {
 
     enum TYPE { IPv4, IPv6, DNS }

Modified: httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/NoopHostnameVerifier.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/NoopHostnameVerifier.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/NoopHostnameVerifier.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/NoopHostnameVerifier.java Tue Dec 27 19:48:07 2016
@@ -30,7 +30,8 @@ package org.apache.hc.client5.http.ssl;
 import javax.net.ssl.HostnameVerifier;
 import javax.net.ssl.SSLSession;
 
-import org.apache.hc.core5.annotation.Immutable;
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
 
 /**
  * The NO_OP HostnameVerifier essentially turns hostname verification
@@ -38,7 +39,7 @@ import org.apache.hc.core5.annotation.Im
  *
  * @since 4.4
  */
-@Immutable
+@Contract(threading = ThreadingBehavior.IMMUTABLE)
 public class NoopHostnameVerifier implements HostnameVerifier {
 
     public static final NoopHostnameVerifier INSTANCE = new NoopHostnameVerifier();

Modified: httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactory.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactory.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactory.java Tue Dec 27 19:48:07 2016
@@ -49,7 +49,8 @@ import javax.security.auth.x500.X500Prin
 
 import org.apache.hc.client5.http.psl.PublicSuffixMatcherLoader;
 import org.apache.hc.client5.http.socket.LayeredConnectionSocketFactory;
-import org.apache.hc.core5.annotation.ThreadSafe;
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
 import org.apache.hc.core5.http.HttpHost;
 import org.apache.hc.core5.http.protocol.HttpContext;
 import org.apache.hc.core5.ssl.SSLContexts;
@@ -133,7 +134,7 @@ import org.apache.logging.log4j.Logger;
  *
  * @since 4.3
  */
-@ThreadSafe
+@Contract(threading = ThreadingBehavior.SAFE)
 public class SSLConnectionSocketFactory implements LayeredConnectionSocketFactory {
 
     public static final String TLS   = "TLS";

Modified: httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/sync/HttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/sync/HttpClient.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/sync/HttpClient.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/sync/HttpClient.java Tue Dec 27 19:48:07 2016
@@ -29,10 +29,11 @@ package org.apache.hc.client5.http.sync;
 
 import java.io.IOException;
 
-import org.apache.hc.client5.http.methods.HttpUriRequest;
+import org.apache.hc.core5.http.ClassicHttpRequest;
+import org.apache.hc.core5.http.ClassicHttpResponse;
 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.io.ResponseHandler;
 import org.apache.hc.core5.http.protocol.HttpContext;
 
 /**
@@ -57,8 +58,7 @@ public interface HttpClient {
      *          configuration of this client.
      * @throws IOException in case of a problem or the connection was aborted
      */
-    HttpResponse execute(HttpUriRequest request)
-        throws IOException;
+    HttpResponse execute(ClassicHttpRequest request) throws IOException;
 
     /**
      * Executes HTTP request using the given context.
@@ -74,8 +74,7 @@ public interface HttpClient {
      *          configuration of this client.
      * @throws IOException in case of a problem or the connection was aborted
      */
-    HttpResponse execute(HttpUriRequest request, HttpContext context)
-        throws IOException;
+    HttpResponse execute(ClassicHttpRequest request, HttpContext context) throws IOException;
 
     /**
      * Executes HTTP request using the default context.
@@ -93,8 +92,7 @@ public interface HttpClient {
      *          configuration of this client.
      * @throws IOException in case of a problem or the connection was aborted
      */
-    HttpResponse execute(HttpHost target, HttpRequest request)
-        throws IOException;
+     ClassicHttpResponse execute(HttpHost target, ClassicHttpRequest request) throws IOException;
 
     /**
      * Executes HTTP request using the given context.
@@ -114,9 +112,7 @@ public interface HttpClient {
      *          configuration of this client.
      * @throws IOException in case of a problem or the connection was aborted
      */
-    HttpResponse execute(HttpHost target, HttpRequest request,
-                         HttpContext context)
-        throws IOException;
+    HttpResponse execute(HttpHost target, ClassicHttpRequest request, HttpContext context) throws IOException;
 
     /**
      * Executes HTTP request using the default context and processes the
@@ -135,10 +131,7 @@ public interface HttpClient {
      * @return  the response object as generated by the response handler.
      * @throws IOException in case of a problem or the connection was aborted
      */
-    <T> T execute(
-            HttpUriRequest request,
-            ResponseHandler<? extends T> responseHandler)
-        throws IOException;
+    <T> T execute(ClassicHttpRequest request, ResponseHandler<? extends T> responseHandler) throws IOException;
 
     /**
      * Executes HTTP request using the given context and processes the
@@ -159,11 +152,7 @@ public interface HttpClient {
      * @return  the response object as generated by the response handler.
      * @throws IOException in case of a problem or the connection was aborted
      */
-    <T> T execute(
-            HttpUriRequest request,
-            ResponseHandler<? extends T> responseHandler,
-            HttpContext context)
-        throws IOException;
+    <T> T execute(ClassicHttpRequest request, ResponseHandler<? extends T> responseHandler, HttpContext context) throws IOException;
 
     /**
      * Executes HTTP request to the target using the default context and
@@ -186,11 +175,7 @@ public interface HttpClient {
      * @return  the response object as generated by the response handler.
      * @throws IOException in case of a problem or the connection was aborted
      */
-    <T> T execute(
-            HttpHost target,
-            HttpRequest request,
-            ResponseHandler<? extends T> responseHandler)
-        throws IOException;
+    <T> T execute(HttpHost target, ClassicHttpRequest request, ResponseHandler<? extends T> responseHandler) throws IOException;
 
     /**
      * Executes HTTP request to the target using the given context and
@@ -217,9 +202,8 @@ public interface HttpClient {
      */
     <T> T execute(
             HttpHost target,
-            HttpRequest request,
+            ClassicHttpRequest request,
             ResponseHandler<? extends T> responseHandler,
-            HttpContext context)
-        throws IOException;
+            HttpContext context) throws IOException;
 
 }

Modified: httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/utils/DateUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/utils/DateUtils.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/utils/DateUtils.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/utils/DateUtils.java Tue Dec 27 19:48:07 2016
@@ -37,7 +37,8 @@ import java.util.Locale;
 import java.util.Map;
 import java.util.TimeZone;
 
-import org.apache.hc.core5.annotation.Immutable;
+import org.apache.hc.core5.annotation.Contract;
+import org.apache.hc.core5.annotation.ThreadingBehavior;
 import org.apache.hc.core5.util.Args;
 
 /**
@@ -47,7 +48,7 @@ import org.apache.hc.core5.util.Args;
  *
  * @since 4.3
  */
-@Immutable
+@Contract(threading = ThreadingBehavior.IMMUTABLE)
 public final class DateUtils {
 
     /**

Modified: httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/utils/URIUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/utils/URIUtils.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/utils/URIUtils.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/main/java/org/apache/hc/client5/http/utils/URIUtils.java Tue Dec 27 19:48:07 2016
@@ -32,9 +32,9 @@ import java.util.List;
 import java.util.Locale;
 import java.util.Stack;
 
-import org.apache.hc.client5.http.RouteInfo;
-import org.apache.hc.core5.annotation.Immutable;
 import org.apache.hc.core5.http.HttpHost;
+import org.apache.hc.core5.net.URIAuthority;
+import org.apache.hc.core5.net.URIBuilder;
 import org.apache.hc.core5.util.Args;
 import org.apache.hc.core5.util.TextUtils;
 
@@ -44,7 +44,6 @@ import org.apache.hc.core5.util.TextUtil
  *
  * @since 4.0
  */
-@Immutable
 public class URIUtils {
 
     /**
@@ -132,39 +131,6 @@ public class URIUtils {
     }
 
     /**
-     * A convenience method that optionally converts the original {@link java.net.URI} either
-     * to a relative or an absolute form as required by the specified route.
-     *
-     * @param uri
-     *            original URI.
-     * @throws URISyntaxException
-     *             If the resulting URI is invalid.
-     *
-     * @since 4.4
-     */
-    public static URI rewriteURIForRoute(final URI uri, final RouteInfo route) throws URISyntaxException {
-        if (uri == null) {
-            return null;
-        }
-        if (route.getProxyHost() != null && !route.isTunnelled()) {
-            // Make sure the request URI is absolute
-            if (!uri.isAbsolute()) {
-                final HttpHost target = route.getTargetHost();
-                return rewriteURI(uri, target, true);
-            } else {
-                return rewriteURI(uri);
-            }
-        } else {
-            // Make sure the request URI is relative
-            if (uri.isAbsolute()) {
-                return rewriteURI(uri, null, true);
-            } else {
-                return rewriteURI(uri);
-            }
-        }
-    }
-
-    /**
      * Resolves a URI reference against a base URI. Work-around for bug in
      * java.net.URI (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4708535)
      *
@@ -370,6 +336,35 @@ public class URIUtils {
     }
 
     /**
+     * Convenience factory method for {@link URI} instances.
+     *
+     * @since 5.0
+     */
+    public static URI create(final HttpHost host, final String path) throws URISyntaxException {
+        final URIBuilder builder = new URIBuilder(path);
+        if (host != null) {
+            builder.setHost(host.getHostName()).setPort(host.getPort()).setScheme(host.getSchemeName());
+        }
+        return builder.build();
+    }
+
+    /**
+     * Convenience factory method for {@link URI} instances.
+     *
+     * @since 5.0
+     */
+    public static URI create(final String scheme, final URIAuthority host, final String path) throws URISyntaxException {
+        final URIBuilder builder = new URIBuilder(path);
+        if (scheme != null) {
+            builder.setScheme(scheme);
+        }
+        if (host != null) {
+            builder.setHost(host.getHostName()).setPort(host.getPort());
+        }
+        return builder.build();
+    }
+
+    /**
      * This class should not be instantiated.
      */
     private URIUtils() {

Modified: httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/config/TestRequestConfig.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/config/TestRequestConfig.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/config/TestRequestConfig.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/config/TestRequestConfig.java Tue Dec 27 19:48:07 2016
@@ -70,7 +70,6 @@ public class TestRequestConfig {
                 .setExpectContinueEnabled(true)
                 .setAuthenticationEnabled(false)
                 .setRedirectsEnabled(false)
-                .setRelativeRedirectsAllowed(false)
                 .setCircularRedirectsAllowed(true)
                 .setMaxRedirects(100)
                 .setCookieSpec(CookieSpecs.STANDARD)

Modified: httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestDecompressingEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestDecompressingEntity.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestDecompressingEntity.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestDecompressingEntity.java Tue Dec 27 19:48:07 2016
@@ -37,9 +37,9 @@ import java.util.zip.CheckedInputStream;
 import java.util.zip.Checksum;
 
 import org.apache.hc.core5.http.HttpEntity;
-import org.apache.hc.core5.http.entity.EntityUtils;
-import org.apache.hc.core5.http.entity.InputStreamEntity;
-import org.apache.hc.core5.http.entity.StringEntity;
+import org.apache.hc.core5.http.io.entity.EntityUtils;
+import org.apache.hc.core5.http.io.entity.InputStreamEntity;
+import org.apache.hc.core5.http.io.entity.StringEntity;
 import org.junit.Assert;
 import org.junit.Test;
 

Modified: httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestDeflate.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestDeflate.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestDeflate.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestDeflate.java Tue Dec 27 19:48:07 2016
@@ -31,8 +31,8 @@ import java.nio.charset.StandardCharsets
 import java.util.zip.Deflater;
 
 import org.apache.hc.core5.http.HttpEntity;
-import org.apache.hc.core5.http.entity.ByteArrayEntity;
-import org.apache.hc.core5.http.entity.EntityUtils;
+import org.apache.hc.core5.http.io.entity.ByteArrayEntity;
+import org.apache.hc.core5.http.io.entity.EntityUtils;
 import org.junit.Assert;
 import org.junit.Test;
 

Modified: httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestEntityBuilder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestEntityBuilder.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestEntityBuilder.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestEntityBuilder.java Tue Dec 27 19:48:07 2016
@@ -30,9 +30,9 @@ package org.apache.hc.client5.http.entit
 import java.io.File;
 import java.io.InputStream;
 
+import org.apache.hc.core5.http.ContentType;
 import org.apache.hc.core5.http.HttpEntity;
-import org.apache.hc.core5.http.entity.ContentType;
-import org.apache.hc.core5.http.entity.EntityUtils;
+import org.apache.hc.core5.http.io.entity.EntityUtils;
 import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Mockito;

Modified: httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestGZip.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestGZip.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestGZip.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestGZip.java Tue Dec 27 19:48:07 2016
@@ -32,11 +32,11 @@ import java.io.IOException;
 import java.io.OutputStream;
 import java.nio.charset.StandardCharsets;
 
+import org.apache.hc.core5.http.ContentType;
 import org.apache.hc.core5.http.HttpEntity;
-import org.apache.hc.core5.http.entity.ByteArrayEntity;
-import org.apache.hc.core5.http.entity.ContentType;
-import org.apache.hc.core5.http.entity.EntityUtils;
-import org.apache.hc.core5.http.entity.StringEntity;
+import org.apache.hc.core5.http.io.entity.ByteArrayEntity;
+import org.apache.hc.core5.http.io.entity.EntityUtils;
+import org.apache.hc.core5.http.io.entity.StringEntity;
 import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Mockito;

Modified: httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/FormBodyPartTest.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/FormBodyPartTest.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/FormBodyPartTest.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/FormBodyPartTest.java Tue Dec 27 19:48:07 2016
@@ -29,7 +29,7 @@ package org.apache.hc.client5.http.entit
 
 import java.io.File;
 
-import org.apache.hc.core5.http.entity.ContentType;
+import org.apache.hc.core5.http.ContentType;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -42,4 +42,4 @@ public class FormBodyPartTest {
         final FileBody obj = new FileBody(tmp, ContentType.APPLICATION_OCTET_STREAM);
         Assert.assertEquals(tmp.getName(), obj.getFilename());
     }
-}
\ No newline at end of file
+}

Modified: httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestFormBodyPartBuilder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestFormBodyPartBuilder.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestFormBodyPartBuilder.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestFormBodyPartBuilder.java Tue Dec 27 19:48:07 2016
@@ -31,7 +31,7 @@ import java.io.File;
 import java.util.Arrays;
 import java.util.List;
 
-import org.apache.hc.core5.http.entity.ContentType;
+import org.apache.hc.core5.http.ContentType;
 import org.junit.Assert;
 import org.junit.Test;
 

Modified: httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartContentBody.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartContentBody.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartContentBody.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartContentBody.java Tue Dec 27 19:48:07 2016
@@ -30,7 +30,7 @@ package org.apache.hc.client5.http.entit
 import java.io.ByteArrayInputStream;
 import java.nio.charset.StandardCharsets;
 
-import org.apache.hc.core5.http.entity.ContentType;
+import org.apache.hc.core5.http.ContentType;
 import org.junit.Assert;
 import org.junit.Test;
 

Modified: httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartEntityBuilder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartEntityBuilder.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartEntityBuilder.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartEntityBuilder.java Tue Dec 27 19:48:07 2016
@@ -32,7 +32,7 @@ import java.io.File;
 import java.nio.charset.StandardCharsets;
 import java.util.List;
 
-import org.apache.hc.core5.http.entity.ContentType;
+import org.apache.hc.core5.http.ContentType;
 import org.apache.hc.core5.http.message.BasicNameValuePair;
 import org.junit.Assert;
 import org.junit.Test;

Modified: httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartForm.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartForm.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartForm.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartForm.java Tue Dec 27 19:48:07 2016
@@ -36,7 +36,7 @@ import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 
-import org.apache.hc.core5.http.entity.ContentType;
+import org.apache.hc.core5.http.ContentType;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Test;

Modified: httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartFormHttpEntity.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartFormHttpEntity.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartFormHttpEntity.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartFormHttpEntity.java Tue Dec 27 19:48:07 2016
@@ -31,10 +31,10 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.nio.charset.StandardCharsets;
 
+import org.apache.hc.core5.http.ContentType;
 import org.apache.hc.core5.http.HeaderElement;
 import org.apache.hc.core5.http.HttpEntity;
 import org.apache.hc.core5.http.NameValuePair;
-import org.apache.hc.core5.http.entity.ContentType;
 import org.apache.hc.core5.http.message.BasicHeaderValueParser;
 import org.apache.hc.core5.http.message.ParserCursor;
 import org.junit.Assert;

Modified: httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/TestAbstractResponseHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/TestAbstractResponseHandler.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/TestAbstractResponseHandler.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/TestAbstractResponseHandler.java Tue Dec 27 19:48:07 2016
@@ -32,13 +32,10 @@ import java.io.InputStream;
 
 import org.apache.hc.client5.http.impl.sync.AbstractResponseHandler;
 import org.apache.hc.client5.http.protocol.HttpResponseException;
+import org.apache.hc.core5.http.ClassicHttpResponse;
 import org.apache.hc.core5.http.HttpEntity;
-import org.apache.hc.core5.http.HttpResponse;
-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.StringEntity;
-import org.apache.hc.core5.http.message.BasicStatusLine;
+import org.apache.hc.core5.http.io.entity.EntityUtils;
+import org.apache.hc.core5.http.io.entity.StringEntity;
 import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Mockito;
@@ -50,10 +47,9 @@ public class TestAbstractResponseHandler
 
     @Test
     public void testSuccessfulResponse() throws Exception {
-        final StatusLine sl = new BasicStatusLine(HttpVersion.HTTP_1_1, 200, "OK");
-        final HttpResponse response = Mockito.mock(HttpResponse.class);
+        final ClassicHttpResponse response = Mockito.mock(ClassicHttpResponse.class);
         final HttpEntity entity = new StringEntity("42");
-        Mockito.when(response.getStatusLine()).thenReturn(sl);
+        Mockito.when(response.getCode()).thenReturn(200);
         Mockito.when(response.getEntity()).thenReturn(entity);
 
         final AbstractResponseHandler<Integer> handler = new AbstractResponseHandler<Integer>() {
@@ -74,9 +70,8 @@ public class TestAbstractResponseHandler
         final HttpEntity entity = Mockito.mock(HttpEntity.class);
         Mockito.when(entity.isStreaming()).thenReturn(true);
         Mockito.when(entity.getContent()).thenReturn(instream);
-        final StatusLine sl = new BasicStatusLine(HttpVersion.HTTP_1_1, 404, "Not Found");
-        final HttpResponse response = Mockito.mock(HttpResponse.class);
-        Mockito.when(response.getStatusLine()).thenReturn(sl);
+        final ClassicHttpResponse response = Mockito.mock(ClassicHttpResponse.class);
+        Mockito.when(response.getCode()).thenReturn(404);
         Mockito.when(response.getEntity()).thenReturn(entity);
 
         final BasicResponseHandler handler = new BasicResponseHandler();
@@ -85,7 +80,6 @@ public class TestAbstractResponseHandler
             Assert.fail("HttpResponseException expected");
         } catch (final HttpResponseException ex) {
             Assert.assertEquals(404, ex.getStatusCode());
-            Assert.assertEquals("Not Found", ex.getMessage());
         }
         Mockito.verify(entity).getContent();
         Mockito.verify(instream).close();

Modified: httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/TestBasicResponseHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/TestBasicResponseHandler.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/TestBasicResponseHandler.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/TestBasicResponseHandler.java Tue Dec 27 19:48:07 2016
@@ -30,12 +30,9 @@ package org.apache.hc.client5.http.impl;
 import java.io.InputStream;
 
 import org.apache.hc.client5.http.protocol.HttpResponseException;
+import org.apache.hc.core5.http.ClassicHttpResponse;
 import org.apache.hc.core5.http.HttpEntity;
-import org.apache.hc.core5.http.HttpResponse;
-import org.apache.hc.core5.http.HttpVersion;
-import org.apache.hc.core5.http.StatusLine;
-import org.apache.hc.core5.http.entity.StringEntity;
-import org.apache.hc.core5.http.message.BasicStatusLine;
+import org.apache.hc.core5.http.io.entity.StringEntity;
 import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Mockito;
@@ -48,10 +45,9 @@ public class TestBasicResponseHandler {
 
     @Test
     public void testSuccessfulResponse() throws Exception {
-        final StatusLine sl = new BasicStatusLine(HttpVersion.HTTP_1_1, 200, "OK");
-        final HttpResponse response = Mockito.mock(HttpResponse.class);
+        final ClassicHttpResponse response = Mockito.mock(ClassicHttpResponse.class);
         final HttpEntity entity = new StringEntity("stuff");
-        Mockito.when(response.getStatusLine()).thenReturn(sl);
+        Mockito.when(response.getCode()).thenReturn(200);
         Mockito.when(response.getEntity()).thenReturn(entity);
 
         final BasicResponseHandler handler = new BasicResponseHandler();
@@ -65,9 +61,8 @@ public class TestBasicResponseHandler {
         final HttpEntity entity = Mockito.mock(HttpEntity.class);
         Mockito.when(entity.isStreaming()).thenReturn(true);
         Mockito.when(entity.getContent()).thenReturn(instream);
-        final StatusLine sl = new BasicStatusLine(HttpVersion.HTTP_1_1, 404, "Not Found");
-        final HttpResponse response = Mockito.mock(HttpResponse.class);
-        Mockito.when(response.getStatusLine()).thenReturn(sl);
+        final ClassicHttpResponse response = Mockito.mock(ClassicHttpResponse.class);
+        Mockito.when(response.getCode()).thenReturn(404);
         Mockito.when(response.getEntity()).thenReturn(entity);
 
         final BasicResponseHandler handler = new BasicResponseHandler();
@@ -76,7 +71,6 @@ public class TestBasicResponseHandler {
             Assert.fail("HttpResponseException expected");
         } catch (final HttpResponseException ex) {
             Assert.assertEquals(404, ex.getStatusCode());
-            Assert.assertEquals("Not Found", ex.getMessage());
         }
         Mockito.verify(entity).getContent();
         Mockito.verify(instream).close();

Modified: httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/TestDefaultConnKeepAliveStrategy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/TestDefaultConnKeepAliveStrategy.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/TestDefaultConnKeepAliveStrategy.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/TestDefaultConnKeepAliveStrategy.java Tue Dec 27 19:48:07 2016
@@ -29,9 +29,7 @@ package org.apache.hc.client5.http.impl;
 import org.apache.hc.client5.http.ConnectionKeepAliveStrategy;
 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.BasicHttpResponse;
-import org.apache.hc.core5.http.message.BasicStatusLine;
 import org.apache.hc.core5.http.protocol.BasicHttpContext;
 import org.apache.hc.core5.http.protocol.HttpContext;
 import org.junit.Assert;
@@ -52,8 +50,7 @@ public class TestDefaultConnKeepAliveStr
     @Test
     public void testNoKeepAliveHeader() throws Exception {
         final HttpContext context = new BasicHttpContext(null);
-        final HttpResponse response = new BasicHttpResponse(
-                new BasicStatusLine(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK"));
+        final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_OK);
         final ConnectionKeepAliveStrategy keepAliveStrat = new DefaultConnectionKeepAliveStrategy();
         final long d = keepAliveStrat.getKeepAliveDuration(response, context);
         Assert.assertEquals(-1, d);
@@ -62,8 +59,7 @@ public class TestDefaultConnKeepAliveStr
     @Test
     public void testEmptyKeepAliveHeader() throws Exception {
         final HttpContext context = new BasicHttpContext(null);
-        final HttpResponse response = new BasicHttpResponse(
-                new BasicStatusLine(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK"));
+        final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_OK);
         response.addHeader("Keep-Alive", "timeout, max=20");
         final ConnectionKeepAliveStrategy keepAliveStrat = new DefaultConnectionKeepAliveStrategy();
         final long d = keepAliveStrat.getKeepAliveDuration(response, context);
@@ -73,8 +69,7 @@ public class TestDefaultConnKeepAliveStr
     @Test
     public void testInvalidKeepAliveHeader() throws Exception {
         final HttpContext context = new BasicHttpContext(null);
-        final HttpResponse response = new BasicHttpResponse(
-                new BasicStatusLine(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK"));
+        final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_OK);
         response.addHeader("Keep-Alive", "timeout=whatever, max=20");
         final ConnectionKeepAliveStrategy keepAliveStrat = new DefaultConnectionKeepAliveStrategy();
         final long d = keepAliveStrat.getKeepAliveDuration(response, context);
@@ -84,8 +79,7 @@ public class TestDefaultConnKeepAliveStr
     @Test
     public void testKeepAliveHeader() throws Exception {
         final HttpContext context = new BasicHttpContext(null);
-        final HttpResponse response = new BasicHttpResponse(
-                new BasicStatusLine(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK"));
+        final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_OK);
         response.addHeader("Keep-Alive", "timeout=300, max=20");
         final ConnectionKeepAliveStrategy keepAliveStrat = new DefaultConnectionKeepAliveStrategy();
         final long d = keepAliveStrat.getKeepAliveDuration(response, context);

Modified: httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestDigestScheme.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestDigestScheme.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestDigestScheme.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestDigestScheme.java Tue Dec 27 19:48:07 2016
@@ -45,12 +45,14 @@ import org.apache.hc.client5.http.auth.C
 import org.apache.hc.client5.http.auth.MalformedChallengeException;
 import org.apache.hc.client5.http.auth.UsernamePasswordCredentials;
 import org.apache.hc.client5.http.impl.sync.BasicCredentialsProvider;
+import org.apache.hc.core5.http.ClassicHttpRequest;
 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.ParseException;
-import org.apache.hc.core5.http.entity.InputStreamEntity;
-import org.apache.hc.core5.http.entity.StringEntity;
+import org.apache.hc.core5.http.io.entity.InputStreamEntity;
+import org.apache.hc.core5.http.io.entity.StringEntity;
+import org.apache.hc.core5.http.message.BasicClassicHttpRequest;
 import org.apache.hc.core5.http.message.BasicHeaderValueParser;
 import org.apache.hc.core5.http.message.BasicHttpRequest;
 import org.apache.hc.core5.http.message.ParserCursor;
@@ -583,7 +585,7 @@ public class TestDigestScheme {
 
     @Test
     public void testDigestAuthenticationQopAuthInt() throws Exception {
-        final HttpRequest request = new BasicHttpRequest("Post", "/");
+        final ClassicHttpRequest request = new BasicClassicHttpRequest("Post", "/");
         request.setEntity(new StringEntity("abc\u00e4\u00f6\u00fcabc", StandardCharsets.ISO_8859_1));
         final HttpHost host = new HttpHost("somehost", 80);
         final AuthScope authScope = new AuthScope(host, "realm1", null);
@@ -638,7 +640,7 @@ public class TestDigestScheme {
 
     @Test
     public void testDigestAuthenticationQopAuthOrAuthIntNonRepeatableEntity() throws Exception {
-        final HttpRequest request = new BasicHttpRequest("Post", "/");
+        final ClassicHttpRequest request = new BasicClassicHttpRequest("Post", "/");
         request.setEntity(new InputStreamEntity(new ByteArrayInputStream(new byte[] {'a'}), -1));
         final HttpHost host = new HttpHost("somehost", 80);
         final AuthScope authScope = new AuthScope(host, "realm1", null);
@@ -687,7 +689,7 @@ public class TestDigestScheme {
 
     @Test(expected=AuthenticationException.class)
     public void testDigestAuthenticationQopIntOnlyNonRepeatableEntity() throws Exception {
-        final HttpRequest request = new BasicHttpRequest("Post", "/");
+        final ClassicHttpRequest request = new BasicClassicHttpRequest("Post", "/");
         request.setEntity(new InputStreamEntity(new ByteArrayInputStream(new byte[] {'a'}), -1));
         final HttpHost host = new HttpHost("somehost", 80);
         final AuthScope authScope = new AuthScope(host, "realm1", null);

Modified: httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestHttpAuthenticator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestHttpAuthenticator.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestHttpAuthenticator.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestHttpAuthenticator.java Tue Dec 27 19:48:07 2016
@@ -46,7 +46,6 @@ 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.config.Lookup;
 import org.apache.hc.core5.http.config.RegistryBuilder;
 import org.apache.hc.core5.http.message.BasicHeader;
@@ -54,7 +53,6 @@ import org.apache.hc.core5.http.message.
 import org.apache.hc.core5.http.message.BasicHttpResponse;
 import org.apache.hc.core5.http.protocol.BasicHttpContext;
 import org.apache.hc.core5.http.protocol.HttpContext;
-import org.apache.hc.core5.http.protocol.HttpCoreContext;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -80,7 +78,6 @@ public class TestHttpAuthenticator {
         Mockito.when(this.authScheme.isChallengeComplete()).thenReturn(Boolean.TRUE);
         this.context = new BasicHttpContext();
         this.defaultHost = new HttpHost("localhost", 80);
-        this.context.setAttribute(HttpCoreContext.HTTP_TARGET_HOST, this.defaultHost);
         this.credentialsProvider = Mockito.mock(CredentialsProvider.class);
         this.context.setAttribute(HttpClientContext.CREDS_PROVIDER, this.credentialsProvider);
         this.authSchemeRegistry = RegistryBuilder.<AuthSchemeProvider>create()
@@ -95,7 +92,7 @@ public class TestHttpAuthenticator {
 
     @Test
     public void testUpdateAuthExchange() throws Exception {
-        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
+        final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
         response.setHeader(HttpHeaders.WWW_AUTHENTICATE, "Basic realm=test");
         Assert.assertTrue(this.httpAuthenticator.isChallenged(
                 this.defaultHost, ChallengeType.TARGET, response, this.authExchange, this.context));
@@ -104,7 +101,7 @@ public class TestHttpAuthenticator {
 
     @Test
     public void testAuthenticationRequestedAfterSuccess() throws Exception {
-        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
+        final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
         response.setHeader(HttpHeaders.WWW_AUTHENTICATE, "Basic realm=test");
 
         this.authExchange.select(this.authScheme);
@@ -118,7 +115,7 @@ public class TestHttpAuthenticator {
 
     @Test
     public void testAuthenticationNotRequestedUnchallenged() throws Exception {
-        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
+        final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_OK, "OK");
 
         Assert.assertFalse(this.httpAuthenticator.isChallenged(
                 this.defaultHost, ChallengeType.TARGET, response, this.authExchange, this.context));
@@ -127,7 +124,7 @@ public class TestHttpAuthenticator {
 
     @Test
     public void testAuthenticationNotRequestedSuccess1() throws Exception {
-        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
+        final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_OK, "OK");
         this.authExchange.select(this.authScheme);
         this.authExchange.setState(AuthExchange.State.CHALLENGED);
 
@@ -140,7 +137,7 @@ public class TestHttpAuthenticator {
 
     @Test
     public void testAuthenticationNotRequestedSuccess2() throws Exception {
-        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
+        final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_OK, "OK");
         this.authExchange.select(this.authScheme);
         this.authExchange.setState(AuthExchange.State.HANDSHAKE);
 
@@ -154,7 +151,7 @@ public class TestHttpAuthenticator {
     @Test
     public void testAuthentication() throws Exception {
         final HttpHost host = new HttpHost("somehost", 80);
-        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
+        final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
         response.addHeader(new BasicHeader(HttpHeaders.WWW_AUTHENTICATE, "Basic realm=\"test\""));
         response.addHeader(new BasicHeader(HttpHeaders.WWW_AUTHENTICATE, "Digest realm=\"realm1\", nonce=\"1234\""));
         response.addHeader(new BasicHeader(HttpHeaders.WWW_AUTHENTICATE, "whatever realm=\"realm1\", stuff=\"1234\""));
@@ -184,7 +181,7 @@ public class TestHttpAuthenticator {
     public void testAuthenticationCredentialsForBasic() throws Exception {
         final HttpHost host = new HttpHost("somehost", 80);
         final HttpResponse response =
-            new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
+            new BasicHttpResponse(HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
         response.addHeader(new BasicHeader(HttpHeaders.WWW_AUTHENTICATE, "Basic realm=\"test\""));
         response.addHeader(new BasicHeader(HttpHeaders.WWW_AUTHENTICATE, "Digest realm=\"realm1\", nonce=\"1234\""));
 
@@ -209,7 +206,7 @@ public class TestHttpAuthenticator {
     @Test
     public void testAuthenticationNoChallenges() throws Exception {
         final HttpHost host = new HttpHost("somehost", 80);
-        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
+        final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
 
         final DefaultAuthenticationStrategy authStrategy = new DefaultAuthenticationStrategy();
 
@@ -220,7 +217,7 @@ public class TestHttpAuthenticator {
     @Test
     public void testAuthenticationNoSupportedChallenges() throws Exception {
         final HttpHost host = new HttpHost("somehost", 80);
-        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
+        final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
         response.addHeader(new BasicHeader(HttpHeaders.WWW_AUTHENTICATE, "This realm=\"test\""));
         response.addHeader(new BasicHeader(HttpHeaders.WWW_AUTHENTICATE, "That realm=\"realm1\", nonce=\"1234\""));
 
@@ -233,7 +230,7 @@ public class TestHttpAuthenticator {
     @Test
     public void testAuthenticationNoCredentials() throws Exception {
         final HttpHost host = new HttpHost("somehost", 80);
-        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
+        final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
         response.addHeader(new BasicHeader(HttpHeaders.WWW_AUTHENTICATE, "Basic realm=\"test\""));
         response.addHeader(new BasicHeader(HttpHeaders.WWW_AUTHENTICATE, "Digest realm=\"realm1\", nonce=\"1234\""));
 
@@ -246,7 +243,7 @@ public class TestHttpAuthenticator {
     @Test
     public void testAuthenticationFailed() throws Exception {
         final HttpHost host = new HttpHost("somehost", 80);
-        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
+        final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
         response.addHeader(new BasicHeader(HttpHeaders.WWW_AUTHENTICATE, "Basic realm=\"test\""));
         response.addHeader(new BasicHeader(HttpHeaders.WWW_AUTHENTICATE, "Digest realm=\"realm1\", nonce=\"1234\""));
 
@@ -266,7 +263,7 @@ public class TestHttpAuthenticator {
     @Test
     public void testAuthenticationFailedPreviously() throws Exception {
         final HttpHost host = new HttpHost("somehost", 80);
-        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
+        final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
         response.addHeader(new BasicHeader(HttpHeaders.WWW_AUTHENTICATE, "Basic realm=\"test\""));
         response.addHeader(new BasicHeader(HttpHeaders.WWW_AUTHENTICATE, "Digest realm=\"realm1\", nonce=\"1234\""));
 
@@ -283,7 +280,7 @@ public class TestHttpAuthenticator {
     @Test
     public void testAuthenticationFailure() throws Exception {
         final HttpHost host = new HttpHost("somehost", 80);
-        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
+        final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
         response.addHeader(new BasicHeader(HttpHeaders.WWW_AUTHENTICATE, "Basic realm=\"test\""));
         response.addHeader(new BasicHeader(HttpHeaders.WWW_AUTHENTICATE, "Digest realm=\"realm1\", nonce=\"1234\""));
         response.addHeader(new BasicHeader(HttpHeaders.WWW_AUTHENTICATE, "whatever realm=\"realm1\", stuff=\"1234\""));
@@ -301,7 +298,7 @@ public class TestHttpAuthenticator {
     @Test
     public void testAuthenticationHandshaking() throws Exception {
         final HttpHost host = new HttpHost("somehost", 80);
-        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
+        final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
         response.addHeader(new BasicHeader(HttpHeaders.WWW_AUTHENTICATE, "Basic realm=\"test\""));
         response.addHeader(new BasicHeader(HttpHeaders.WWW_AUTHENTICATE, "Digest realm=\"realm1\", stale=true, nonce=\"1234\""));
         response.addHeader(new BasicHeader(HttpHeaders.WWW_AUTHENTICATE, "whatever realm=\"realm1\", stuff=\"1234\""));
@@ -320,7 +317,7 @@ public class TestHttpAuthenticator {
     @Test
     public void testAuthenticationNoMatchingChallenge() throws Exception {
         final HttpHost host = new HttpHost("somehost", 80);
-        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
+        final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
         response.addHeader(new BasicHeader(HttpHeaders.WWW_AUTHENTICATE, "Digest realm=\"realm1\", nonce=\"1234\""));
         response.addHeader(new BasicHeader(HttpHeaders.WWW_AUTHENTICATE, "whatever realm=\"realm1\", stuff=\"1234\""));
 
@@ -348,7 +345,7 @@ public class TestHttpAuthenticator {
     @Test
     public void testAuthenticationException() throws Exception {
         final HttpHost host = new HttpHost("somehost", 80);
-        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
+        final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_UNAUTHORIZED, "UNAUTHORIZED");
         response.addHeader(new BasicHeader(HttpHeaders.WWW_AUTHENTICATE, "blah blah blah"));
 
         this.authExchange.setState(AuthExchange.State.CHALLENGED);

Modified: httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestRequestAuthCache.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestRequestAuthCache.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestRequestAuthCache.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestRequestAuthCache.java Tue Dec 27 19:48:07 2016
@@ -39,7 +39,6 @@ import org.apache.hc.core5.http.HttpHost
 import org.apache.hc.core5.http.HttpRequest;
 import org.apache.hc.core5.http.HttpRequestInterceptor;
 import org.apache.hc.core5.http.message.BasicHttpRequest;
-import org.apache.hc.core5.http.protocol.HttpCoreContext;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -77,14 +76,14 @@ public class TestRequestAuthCache {
     public void testRequestParameterCheck() throws Exception {
         final HttpClientContext context = HttpClientContext.create();
         final HttpRequestInterceptor interceptor = new RequestAuthCache();
-        interceptor.process(null, context);
+        interceptor.process(null, null, context);
     }
 
     @Test(expected=IllegalArgumentException.class)
     public void testContextParameterCheck() throws Exception {
         final HttpRequest request = new BasicHttpRequest("GET", "/");
         final HttpRequestInterceptor interceptor = new RequestAuthCache();
-        interceptor.process(request, null);
+        interceptor.process(request, null, null);
     }
 
     @Test
@@ -93,7 +92,6 @@ public class TestRequestAuthCache {
 
         final HttpClientContext context = HttpClientContext.create();
         context.setAttribute(HttpClientContext.CREDS_PROVIDER, this.credProvider);
-        context.setAttribute(HttpCoreContext.HTTP_TARGET_HOST, this.target);
         context.setAttribute(HttpClientContext.HTTP_ROUTE, new HttpRoute(this.target, null, this.proxy, false));
 
         final AuthCache authCache = new BasicAuthCache();
@@ -103,7 +101,7 @@ public class TestRequestAuthCache {
         context.setAttribute(HttpClientContext.AUTH_CACHE, authCache);
 
         final HttpRequestInterceptor interceptor = new RequestAuthCache();
-        interceptor.process(request, context);
+        interceptor.process(request, null, context);
 
         final AuthExchange targetAuthExchange = context.getAuthExchange(this.target);
         final AuthExchange proxyAuthExchange = context.getAuthExchange(this.proxy);
@@ -120,7 +118,6 @@ public class TestRequestAuthCache {
 
         final HttpClientContext context = HttpClientContext.create();
         context.setAttribute(HttpClientContext.CREDS_PROVIDER, null);
-        context.setAttribute(HttpCoreContext.HTTP_TARGET_HOST, this.target);
         context.setAttribute(HttpClientContext.HTTP_ROUTE, new HttpRoute(this.target, null, this.proxy, false));
 
         final AuthCache authCache = new BasicAuthCache();
@@ -130,7 +127,7 @@ public class TestRequestAuthCache {
         context.setAttribute(HttpClientContext.AUTH_CACHE, authCache);
 
         final HttpRequestInterceptor interceptor = new RequestAuthCache();
-        interceptor.process(request, context);
+        interceptor.process(request, null, context);
 
         final AuthExchange targetAuthExchange = context.getAuthExchange(this.target);
         final AuthExchange proxyAuthExchange = context.getAuthExchange(this.proxy);
@@ -147,12 +144,11 @@ public class TestRequestAuthCache {
 
         final HttpClientContext context = HttpClientContext.create();
         context.setAttribute(HttpClientContext.CREDS_PROVIDER, this.credProvider);
-        context.setAttribute(HttpCoreContext.HTTP_TARGET_HOST, this.target);
         context.setAttribute(HttpClientContext.HTTP_ROUTE, new HttpRoute(this.target, null, this.proxy, false));
         context.setAttribute(HttpClientContext.AUTH_CACHE, null);
 
         final HttpRequestInterceptor interceptor = new RequestAuthCache();
-        interceptor.process(request, context);
+        interceptor.process(request, null, context);
 
         final AuthExchange targetAuthExchange = context.getAuthExchange(this.target);
         final AuthExchange proxyAuthExchange = context.getAuthExchange(this.proxy);
@@ -169,14 +165,13 @@ public class TestRequestAuthCache {
 
         final HttpClientContext context = HttpClientContext.create();
         context.setAttribute(HttpClientContext.CREDS_PROVIDER, this.credProvider);
-        context.setAttribute(HttpCoreContext.HTTP_TARGET_HOST, this.target);
         context.setAttribute(HttpClientContext.HTTP_ROUTE, new HttpRoute(this.target, null, this.proxy, false));
 
         final AuthCache authCache = new BasicAuthCache();
         context.setAttribute(HttpClientContext.AUTH_CACHE, authCache);
 
         final HttpRequestInterceptor interceptor = new RequestAuthCache();
-        interceptor.process(request, context);
+        interceptor.process(request, null, context);
 
         final AuthExchange targetAuthExchange = context.getAuthExchange(this.target);
         final AuthExchange proxyAuthExchange = context.getAuthExchange(this.proxy);

Modified: httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestSystemDefaultCredentialsProvider.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestSystemDefaultCredentialsProvider.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestSystemDefaultCredentialsProvider.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestSystemDefaultCredentialsProvider.java Tue Dec 27 19:48:07 2016
@@ -29,15 +29,12 @@ package org.apache.hc.client5.http.impl.
 import java.net.Authenticator;
 import java.net.Authenticator.RequestorType;
 import java.net.InetAddress;
-import java.net.MalformedURLException;
 import java.net.PasswordAuthentication;
-import java.net.URISyntaxException;
 import java.net.URL;
 
 import org.apache.hc.client5.http.auth.AuthScope;
 import org.apache.hc.client5.http.auth.Credentials;
 import org.apache.hc.client5.http.methods.HttpGet;
-import org.apache.hc.core5.http.HttpHost;
 import org.apache.hc.core5.http.protocol.HttpCoreContext;
 import org.junit.Assert;
 import org.junit.Test;
@@ -88,15 +85,13 @@ public class TestSystemDefaultCredential
     }
 
     @Test
-    public void testSystemCredentialsProviderCredentials() throws MalformedURLException,
-        URISyntaxException {
+    public void testSystemCredentialsProviderCredentials() throws Exception {
 
         final AuthenticatorDelegate authenticatorDelegate = installAuthenticator(AUTH1);
 
-        final URL httpRequestUrl = new URL(TARGET_SCHEME1, TARGET_HOST1, TARGET_PORT1, "");
+        final URL httpRequestUrl = new URL(TARGET_SCHEME1, TARGET_HOST1, TARGET_PORT1, "/");
         final AuthScope authScope = new AuthScope(PROXY_HOST1, PROXY_PORT1, PROMPT1, "BASIC");
         final HttpCoreContext coreContext = new HttpCoreContext();
-        coreContext.setTargetHost(new HttpHost(TARGET_HOST1, TARGET_PORT1, TARGET_SCHEME1));
         coreContext.setAttribute(HttpCoreContext.HTTP_REQUEST, new HttpGet(httpRequestUrl.toURI()));
 
         final Credentials receivedCredentials =
@@ -111,8 +106,7 @@ public class TestSystemDefaultCredential
     }
 
     @Test
-    public void testSystemCredentialsProviderNoContext() throws MalformedURLException,
-        URISyntaxException {
+    public void testSystemCredentialsProviderNoContext() throws Exception {
 
         final AuthenticatorDelegate authenticatorDelegate = installAuthenticator(AUTH1);
 

Modified: httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/integration/TestAbortHandling.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/integration/TestAbortHandling.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/integration/TestAbortHandling.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/integration/TestAbortHandling.java Tue Dec 27 19:48:07 2016
@@ -44,16 +44,16 @@ import org.apache.hc.client5.http.locals
 import org.apache.hc.client5.http.methods.HttpGet;
 import org.apache.hc.client5.http.protocol.HttpClientContext;
 import org.apache.hc.core5.concurrent.Cancellable;
+import org.apache.hc.core5.http.ClassicHttpRequest;
+import org.apache.hc.core5.http.ClassicHttpResponse;
 import org.apache.hc.core5.http.HttpException;
 import org.apache.hc.core5.http.HttpHost;
 import org.apache.hc.core5.http.HttpRequest;
-import org.apache.hc.core5.http.HttpResponse;
 import org.apache.hc.core5.http.HttpStatus;
-import org.apache.hc.core5.http.ProtocolVersion;
-import org.apache.hc.core5.http.entity.StringEntity;
 import org.apache.hc.core5.http.io.HttpClientConnection;
 import org.apache.hc.core5.http.io.HttpRequestHandler;
 import org.apache.hc.core5.http.io.UriHttpRequestHandlerMapper;
+import org.apache.hc.core5.http.io.entity.StringEntity;
 import org.apache.hc.core5.http.message.BasicHeader;
 import org.apache.hc.core5.http.protocol.BasicHttpContext;
 import org.apache.hc.core5.http.protocol.HttpContext;
@@ -73,16 +73,18 @@ public class TestAbortHandling extends L
 
         this.serverBootstrap.registerHandler("*", new HttpRequestHandler() {
             @Override
-            public void handle(final HttpRequest request, final HttpResponse response,
-                               final HttpContext context) throws HttpException, IOException {
+            public void handle(
+                    final ClassicHttpRequest request,
+                    final ClassicHttpResponse response,
+                    final HttpContext context) throws HttpException, IOException {
                 try {
                     wait.countDown(); // trigger abort
                     Thread.sleep(2000); // allow time for abort to happen
-                    response.setStatusCode(HttpStatus.SC_OK);
+                    response.setCode(HttpStatus.SC_OK);
                     final StringEntity entity = new StringEntity("Whatever");
                     response.setEntity(entity);
                 } catch (final Exception e) {
-                    response.setStatusCode(HttpStatus.SC_REQUEST_TIMEOUT);
+                    response.setCode(HttpStatus.SC_REQUEST_TIMEOUT);
                 }
             }
         });
@@ -316,10 +318,11 @@ public class TestAbortHandling extends L
 
     private static class BasicService implements HttpRequestHandler {
         @Override
-        public void handle(final HttpRequest request,
-                final HttpResponse response,
+        public void handle(
+                final ClassicHttpRequest request,
+                final ClassicHttpResponse response,
                 final HttpContext context) throws HttpException, IOException {
-            response.setStatusCode(200);
+            response.setCode(200);
             response.setEntity(new StringEntity("Hello World"));
         }
     }
@@ -333,11 +336,11 @@ public class TestAbortHandling extends L
         }
 
         @Override
-        public void handle(final HttpRequest request,
-                final HttpResponse response, final HttpContext context)
-                throws HttpException, IOException {
-            final ProtocolVersion ver = request.getRequestLine().getProtocolVersion();
-            response.setStatusLine(ver, this.statuscode);
+        public void handle(
+                final ClassicHttpRequest request,
+                final ClassicHttpResponse response,
+                final HttpContext context) throws HttpException, IOException {
+            response.setCode(this.statuscode);
             response.addHeader(new BasicHeader("Location", "http://localhost:"
                     + this.port + "/newlocation/"));
             response.addHeader(new BasicHeader("Connection", "close"));
@@ -400,12 +403,12 @@ public class TestAbortHandling extends L
         }
 
         @Override
-        public void closeIdleConnections(final long idletime, final TimeUnit tunit) {
+        public void closeIdle(final long idletime, final TimeUnit tunit) {
             throw new UnsupportedOperationException("just a mockup");
         }
 
         @Override
-        public void closeExpiredConnections() {
+        public void closeExpired() {
             throw new UnsupportedOperationException("just a mockup");
         }
 

Modified: httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/integration/TestBasicConnectionManager.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/integration/TestBasicConnectionManager.java?rev=1776187&r1=1776186&r2=1776187&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/integration/TestBasicConnectionManager.java (original)
+++ httpcomponents/httpclient/trunk/httpclient5/src/test/java/org/apache/hc/client5/http/impl/integration/TestBasicConnectionManager.java Tue Dec 27 19:48:07 2016
@@ -28,10 +28,10 @@ package org.apache.hc.client5.http.impl.
 
 import org.apache.hc.client5.http.impl.io.BasicHttpClientConnectionManager;
 import org.apache.hc.client5.http.localserver.LocalServerTestBase;
-import org.apache.hc.client5.http.methods.CloseableHttpResponse;
+import org.apache.hc.client5.http.impl.sync.CloseableHttpResponse;
 import org.apache.hc.client5.http.methods.HttpGet;
 import org.apache.hc.core5.http.HttpHost;
-import org.apache.hc.core5.http.entity.EntityUtils;
+import org.apache.hc.core5.http.io.entity.EntityUtils;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -44,7 +44,7 @@ public class TestBasicConnectionManager
         final HttpHost target = start();
         final HttpGet get = new HttpGet("/random/1024");
         try (CloseableHttpResponse response = this.httpclient.execute(target, get)) {
-            Assert.assertEquals(200, response.getStatusLine().getStatusCode());
+            Assert.assertEquals(200, response.getCode());
             EntityUtils.consume(response.getEntity());
         }
     }



Mime
View raw message