hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1735164 [3/4] - in /httpcomponents/httpcore/trunk: httpcore5-ab/src/main/java/org/apache/hc/core5/http/benchmark/ httpcore5-ab/src/test/java/org/apache/hc/core5/http/benchmark/ httpcore5/src/examples/org/apache/hc/core5/http/examples/ http...
Date Tue, 15 Mar 2016 20:35:36 GMT
Modified: httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestDefaultBHttpServerConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestDefaultBHttpServerConnection.java?rev=1735164&r1=1735163&r2=1735164&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestDefaultBHttpServerConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestDefaultBHttpServerConnection.java Tue Mar 15 20:35:34 2016
@@ -35,7 +35,6 @@ import java.nio.charset.StandardCharsets
 import org.apache.hc.core5.http.HttpEntity;
 import org.apache.hc.core5.http.HttpRequest;
 import org.apache.hc.core5.http.HttpResponse;
-import org.apache.hc.core5.http.HttpVersion;
 import org.apache.hc.core5.http.NotImplementedException;
 import org.apache.hc.core5.http.ProtocolException;
 import org.apache.hc.core5.http.config.MessageConstraints;
@@ -87,9 +86,8 @@ public class TestDefaultBHttpServerConne
 
         final HttpRequest request = conn.receiveRequestHeader();
         Assert.assertNotNull(request);
-        Assert.assertEquals(HttpVersion.HTTP_1_1, request.getProtocolVersion());
-        Assert.assertEquals("/", request.getRequestLine().getUri());
-        Assert.assertEquals("GET", request.getRequestLine().getMethod());
+        Assert.assertEquals("/", request.getUri());
+        Assert.assertEquals("GET", request.getMethod());
         Assert.assertTrue(request.containsHeader("User-Agent"));
         Assert.assertEquals(1, conn.getMetrics().getRequestCount());
     }
@@ -107,9 +105,8 @@ public class TestDefaultBHttpServerConne
         final HttpRequest request = conn.receiveRequestHeader();
 
         Assert.assertNotNull(request);
-        Assert.assertEquals(HttpVersion.HTTP_1_1, request.getProtocolVersion());
-        Assert.assertEquals("/", request.getRequestLine().getUri());
-        Assert.assertEquals("POST", request.getRequestLine().getMethod());
+        Assert.assertEquals("/", request.getUri());
+        Assert.assertEquals("POST", request.getMethod());
         Assert.assertTrue(request.containsHeader("User-Agent"));
         Assert.assertNull(request.getEntity());
         Assert.assertEquals(1, conn.getMetrics().getRequestCount());
@@ -139,9 +136,8 @@ public class TestDefaultBHttpServerConne
         final HttpRequest request = conn.receiveRequestHeader();
 
         Assert.assertNotNull(request);
-        Assert.assertEquals(HttpVersion.HTTP_1_1, request.getProtocolVersion());
-        Assert.assertEquals("/stuff", request.getRequestLine().getUri());
-        Assert.assertEquals("POST", request.getRequestLine().getMethod());
+        Assert.assertEquals("/stuff", request.getUri());
+        Assert.assertEquals("POST", request.getMethod());
         Assert.assertTrue(request.containsHeader("User-Agent"));
         Assert.assertNull(request.getEntity());
         Assert.assertEquals(1, conn.getMetrics().getRequestCount());
@@ -172,9 +168,8 @@ public class TestDefaultBHttpServerConne
         final HttpRequest request = conn.receiveRequestHeader();
 
         Assert.assertNotNull(request);
-        Assert.assertEquals(HttpVersion.HTTP_1_1, request.getProtocolVersion());
-        Assert.assertEquals("/stuff", request.getRequestLine().getUri());
-        Assert.assertEquals("POST", request.getRequestLine().getMethod());
+        Assert.assertEquals("/stuff", request.getUri());
+        Assert.assertEquals("POST", request.getMethod());
         Assert.assertTrue(request.containsHeader("User-Agent"));
         Assert.assertNull(request.getEntity());
         Assert.assertEquals(1, conn.getMetrics().getRequestCount());
@@ -195,9 +190,8 @@ public class TestDefaultBHttpServerConne
         final HttpRequest request = conn.receiveRequestHeader();
 
         Assert.assertNotNull(request);
-        Assert.assertEquals(HttpVersion.HTTP_1_1, request.getProtocolVersion());
-        Assert.assertEquals("/stuff", request.getRequestLine().getUri());
-        Assert.assertEquals("POST", request.getRequestLine().getMethod());
+        Assert.assertEquals("/stuff", request.getUri());
+        Assert.assertEquals("POST", request.getMethod());
         Assert.assertTrue(request.containsHeader("User-Agent"));
         Assert.assertNull(request.getEntity());
         Assert.assertEquals(1, conn.getMetrics().getRequestCount());
@@ -217,7 +211,7 @@ public class TestDefaultBHttpServerConne
 
         Assert.assertEquals(0, conn.getMetrics().getResponseCount());
 
-        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
+        final HttpResponse response = new BasicHttpResponse(200, "OK");
         response.addHeader("User-Agent", "test");
 
         conn.sendResponseHeader(response);
@@ -237,7 +231,7 @@ public class TestDefaultBHttpServerConne
 
         Assert.assertEquals(0, conn.getMetrics().getResponseCount());
 
-        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 100, "Go on");
+        final HttpResponse response = new BasicHttpResponse(100, "Go on");
 
         conn.sendResponseHeader(response);
         conn.flush();
@@ -256,7 +250,7 @@ public class TestDefaultBHttpServerConne
 
         Assert.assertEquals(0, conn.getMetrics().getResponseCount());
 
-        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
+        final HttpResponse response = new BasicHttpResponse(200, "OK");
         response.addHeader("Server", "test");
         response.addHeader("Content-Length", "3");
         response.setEntity(new StringEntity("123", ContentType.TEXT_PLAIN));
@@ -279,7 +273,7 @@ public class TestDefaultBHttpServerConne
 
         Assert.assertEquals(0, conn.getMetrics().getResponseCount());
 
-        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
+        final HttpResponse response = new BasicHttpResponse(200, "OK");
         response.addHeader("Server", "test");
         response.addHeader("Transfer-Encoding", "chunked");
         response.setEntity(new StringEntity("123", ContentType.TEXT_PLAIN));
@@ -303,7 +297,7 @@ public class TestDefaultBHttpServerConne
 
         Assert.assertEquals(0, conn.getMetrics().getResponseCount());
 
-        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
+        final HttpResponse response = new BasicHttpResponse(200, "OK");
         response.addHeader("Server", "test");
         response.addHeader("Transfer-Encoding", "identity");
         response.setEntity(new StringEntity("123", ContentType.TEXT_PLAIN));
@@ -322,7 +316,7 @@ public class TestDefaultBHttpServerConne
 
         Assert.assertEquals(0, conn.getMetrics().getResponseCount());
 
-        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
+        final HttpResponse response = new BasicHttpResponse(200, "OK");
         response.addHeader("Server", "test");
 
         conn.sendResponseHeader(response);

Modified: httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestHttpRequestExecutor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestHttpRequestExecutor.java?rev=1735164&r1=1735163&r2=1735164&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestHttpRequestExecutor.java (original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestHttpRequestExecutor.java Tue Mar 15 20:35:34 2016
@@ -34,7 +34,6 @@ import org.apache.hc.core5.http.HttpEnti
 import org.apache.hc.core5.http.HttpHeaders;
 import org.apache.hc.core5.http.HttpRequest;
 import org.apache.hc.core5.http.HttpResponse;
-import org.apache.hc.core5.http.HttpVersion;
 import org.apache.hc.core5.http.ProtocolException;
 import org.apache.hc.core5.http.io.HttpClientConnection;
 import org.apache.hc.core5.http.message.BasicHttpRequest;
@@ -51,7 +50,7 @@ public class TestHttpRequestExecutor {
     public void testInvalidInput() throws Exception {
         final HttpCoreContext context = HttpCoreContext.create();
         final HttpRequest request = new BasicHttpRequest("GET", "/");
-        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
+        final HttpResponse response = new BasicHttpResponse(200, "OK");
         final HttpClientConnection conn = Mockito.mock(HttpClientConnection.class);
         final HttpProcessor httprocessor = Mockito.mock(HttpProcessor.class);
         try {
@@ -125,7 +124,7 @@ public class TestHttpRequestExecutor {
         Mockito.verify(httprocessor).process(request, context);
 
         Mockito.when(conn.receiveResponseHeader()).thenReturn(
-                new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK"));
+                new BasicHttpResponse(200, "OK"));
 
         final HttpResponse response = executor.execute(request, conn, context);
         Mockito.verify(conn).sendRequestHeader(request);
@@ -154,10 +153,10 @@ public class TestHttpRequestExecutor {
         Mockito.verify(httprocessor).process(request, context);
 
         Mockito.when(conn.receiveResponseHeader()).thenReturn(
-                new BasicHttpResponse(HttpVersion.HTTP_1_1, 100, "OK"),
-                new BasicHttpResponse(HttpVersion.HTTP_1_1, 101, "OK"),
-                new BasicHttpResponse(HttpVersion.HTTP_1_1, 102, "OK"),
-                new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK"));
+                new BasicHttpResponse(100, "OK"),
+                new BasicHttpResponse(101, "OK"),
+                new BasicHttpResponse(102, "OK"),
+                new BasicHttpResponse(200, "OK"));
 
         final HttpResponse response = executor.execute(request, conn, context);
         Mockito.verify(conn).sendRequestHeader(request);
@@ -186,7 +185,7 @@ public class TestHttpRequestExecutor {
         Mockito.verify(httprocessor).process(request, context);
 
         Mockito.when(conn.receiveResponseHeader()).thenReturn(
-                new BasicHttpResponse(HttpVersion.HTTP_1_1, 204, "OK"));
+                new BasicHttpResponse(204, "OK"));
 
         final HttpResponse response = executor.execute(request, conn, context);
         Mockito.verify(conn).sendRequestHeader(request);
@@ -211,7 +210,7 @@ public class TestHttpRequestExecutor {
         Mockito.verify(httprocessor).process(request, context);
 
         Mockito.when(conn.receiveResponseHeader()).thenReturn(
-                new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK"));
+                new BasicHttpResponse(200, "OK"));
 
         final HttpResponse response = executor.execute(request, conn, context);
         Mockito.verify(conn).sendRequestHeader(request);
@@ -238,7 +237,7 @@ public class TestHttpRequestExecutor {
         Mockito.verify(httprocessor).process(request, context);
 
         Mockito.when(conn.receiveResponseHeader()).thenReturn(
-                new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK"));
+                new BasicHttpResponse(200, "OK"));
 
         final HttpResponse response = executor.execute(request, conn, context);
         Mockito.verify(conn).sendRequestHeader(request);
@@ -267,8 +266,8 @@ public class TestHttpRequestExecutor {
         Mockito.verify(httprocessor).process(request, context);
 
         Mockito.when(conn.receiveResponseHeader()).thenReturn(
-                new BasicHttpResponse(HttpVersion.HTTP_1_1, 100, "Continue"),
-                new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK"));
+                new BasicHttpResponse(100, "Continue"),
+                new BasicHttpResponse(200, "OK"));
         Mockito.when(conn.isDataAvailable(Mockito.anyInt())).thenReturn(Boolean.TRUE);
 
         final HttpResponse response = executor.execute(request, conn, context);
@@ -299,7 +298,7 @@ public class TestHttpRequestExecutor {
         Mockito.verify(httprocessor).process(request, context);
 
         Mockito.when(conn.receiveResponseHeader()).thenReturn(
-                new BasicHttpResponse(HttpVersion.HTTP_1_1, 402, "OK"));
+                new BasicHttpResponse(402, "OK"));
         Mockito.when(conn.isDataAvailable(Mockito.anyInt())).thenReturn(Boolean.TRUE);
 
         final HttpResponse response = executor.execute(request, conn, context);
@@ -331,7 +330,7 @@ public class TestHttpRequestExecutor {
         Mockito.verify(httprocessor).process(request, context);
 
         Mockito.when(conn.receiveResponseHeader()).thenReturn(
-                new BasicHttpResponse(HttpVersion.HTTP_1_1, 101, "OK"));
+                new BasicHttpResponse(101, "OK"));
         Mockito.when(conn.isDataAvailable(Mockito.anyInt())).thenReturn(Boolean.TRUE);
 
         try {
@@ -358,7 +357,7 @@ public class TestHttpRequestExecutor {
         Mockito.verify(httprocessor).process(request, context);
 
         Mockito.when(conn.receiveResponseHeader()).thenReturn(
-                new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK"));
+                new BasicHttpResponse(200, "OK"));
         Mockito.when(conn.isDataAvailable(Mockito.anyInt())).thenReturn(Boolean.FALSE);
 
         final HttpResponse response = executor.execute(request, conn, context);

Modified: httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestHttpService.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestHttpService.java?rev=1735164&r1=1735163&r2=1735164&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestHttpService.java (original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestHttpService.java Tue Mar 15 20:35:34 2016
@@ -37,7 +37,6 @@ import org.apache.hc.core5.http.HttpRequ
 import org.apache.hc.core5.http.HttpResponse;
 import org.apache.hc.core5.http.HttpResponseFactory;
 import org.apache.hc.core5.http.HttpStatus;
-import org.apache.hc.core5.http.HttpVersion;
 import org.apache.hc.core5.http.MethodNotSupportedException;
 import org.apache.hc.core5.http.ProtocolException;
 import org.apache.hc.core5.http.UnsupportedHttpVersionException;
@@ -90,7 +89,7 @@ public class TestHttpService {
         final HttpRequest request = new BasicHttpRequest("GET", "/");
         Mockito.when(conn.receiveRequestHeader()).thenReturn(request);
         final HttpResponse response = new BasicHttpResponse(200, "OK");
-        Mockito.when(responseFactory.newHttpResponse(200, context)).thenReturn(response);
+        Mockito.when(responseFactory.newHttpResponse(200)).thenReturn(response);
         Mockito.when(connReuseStrategy.keepAlive(request, response, context)).thenReturn(Boolean.FALSE);
 
         httpservice.handleRequest(conn, context);
@@ -110,31 +109,6 @@ public class TestHttpService {
     }
 
     @Test
-    public void testBasicProtocolDowngrade() throws Exception {
-        final HttpProcessor httprocessor = Mockito.mock(HttpProcessor.class);
-        final ConnectionReuseStrategy connReuseStrategy = Mockito.mock(ConnectionReuseStrategy.class);
-        final HttpResponseFactory responseFactory = Mockito.mock(HttpResponseFactory.class);
-        final HttpRequestHandlerMapper handlerResolver = Mockito.mock(HttpRequestHandlerMapper.class);
-
-        final HttpService httpservice = new HttpService(
-                httprocessor,
-                connReuseStrategy,
-                responseFactory,
-                handlerResolver);
-        final HttpCoreContext context = HttpCoreContext.create();
-        final HttpServerConnection conn = Mockito.mock(HttpServerConnection.class);
-        final HttpRequest request = new BasicHttpRequest("GET", "/", new HttpVersion(20, 45));
-        Mockito.when(conn.receiveRequestHeader()).thenReturn(request);
-        final HttpResponse response = new BasicHttpResponse(200, "OK");
-        Mockito.when(responseFactory.newHttpResponse(200, context)).thenReturn(response);
-        Mockito.when(connReuseStrategy.keepAlive(request, response, context)).thenReturn(Boolean.FALSE);
-
-        httpservice.handleRequest(conn, context);
-
-        Mockito.verify(responseFactory).newHttpResponse(200, context);
-    }
-
-    @Test
     public void testExecutionEntityEnclosingRequest() throws Exception {
         final HttpProcessor httprocessor = Mockito.mock(HttpProcessor.class);
         final ConnectionReuseStrategy connReuseStrategy = Mockito.mock(ConnectionReuseStrategy.class);
@@ -155,7 +129,7 @@ public class TestHttpService {
 
         Mockito.when(conn.receiveRequestHeader()).thenReturn(request);
         final HttpResponse response = new BasicHttpResponse(200, "OK");
-        Mockito.when(responseFactory.newHttpResponse(200, context)).thenReturn(response);
+        Mockito.when(responseFactory.newHttpResponse(200)).thenReturn(response);
         Mockito.when(connReuseStrategy.keepAlive(request, response, context)).thenReturn(Boolean.FALSE);
 
         httpservice.handleRequest(conn, context);
@@ -198,9 +172,9 @@ public class TestHttpService {
 
         Mockito.when(conn.receiveRequestHeader()).thenReturn(request);
         final HttpResponse resp100 = new BasicHttpResponse(100, "Continue");
-        Mockito.when(responseFactory.newHttpResponse(100, context)).thenReturn(resp100);
+        Mockito.when(responseFactory.newHttpResponse(100)).thenReturn(resp100);
         final HttpResponse response = new BasicHttpResponse(200, "OK");
-        Mockito.when(responseFactory.newHttpResponse(200, context)).thenReturn(response);
+        Mockito.when(responseFactory.newHttpResponse(200)).thenReturn(response);
         Mockito.when(connReuseStrategy.keepAlive(request, response, context)).thenReturn(Boolean.FALSE);
 
         httpservice.handleRequest(conn, context);
@@ -236,7 +210,7 @@ public class TestHttpService {
                     final HttpRequest request,
                     final HttpResponse response,
                     final HttpContext context) throws HttpException {
-                response.setStatusCode(HttpStatus.SC_UNAUTHORIZED);
+                response.setCode(HttpStatus.SC_UNAUTHORIZED);
             }
 
         };
@@ -257,7 +231,7 @@ public class TestHttpService {
 
         Mockito.when(conn.receiveRequestHeader()).thenReturn(request);
         final HttpResponse response = new BasicHttpResponse(100, "Continue");
-        Mockito.when(responseFactory.newHttpResponse(100, context)).thenReturn(response);
+        Mockito.when(responseFactory.newHttpResponse(100)).thenReturn(response);
         Mockito.when(connReuseStrategy.keepAlive(request, response, context)).thenReturn(Boolean.FALSE);
 
         httpservice.handleRequest(conn, context);
@@ -300,9 +274,9 @@ public class TestHttpService {
 
         Mockito.when(conn.receiveRequestHeader()).thenReturn(request);
         final HttpResponse resp100 = new BasicHttpResponse(100, "Continue");
-        Mockito.when(responseFactory.newHttpResponse(100, context)).thenReturn(resp100);
+        Mockito.when(responseFactory.newHttpResponse(100)).thenReturn(resp100);
         final HttpResponse response = new BasicHttpResponse(500, "Oppsie");
-        Mockito.when(responseFactory.newHttpResponse(500, context)).thenReturn(response);
+        Mockito.when(responseFactory.newHttpResponse(500)).thenReturn(response);
         Mockito.doThrow(new HttpException("Oopsie")).when(expectationVerifier).verify(request, resp100, context);
         Mockito.when(connReuseStrategy.keepAlive(request, response, context)).thenReturn(Boolean.FALSE);
 
@@ -341,9 +315,9 @@ public class TestHttpService {
 
         Mockito.when(conn.receiveRequestHeader()).thenReturn(request);
         final HttpResponse response = new BasicHttpResponse(200, "OK");
-        Mockito.when(responseFactory.newHttpResponse(200, context)).thenReturn(response);
+        Mockito.when(responseFactory.newHttpResponse(200)).thenReturn(response);
         final HttpResponse error = new BasicHttpResponse(500, "Oppsie");
-        Mockito.when(responseFactory.newHttpResponse(500, context)).thenReturn(error);
+        Mockito.when(responseFactory.newHttpResponse(500)).thenReturn(error);
         Mockito.when(handlerResolver.lookup(request, context)).thenReturn(requestHandler);
         Mockito.doThrow(new MethodNotSupportedException("whatever")).when(
                 requestHandler).handle(request, response, context);
@@ -384,9 +358,9 @@ public class TestHttpService {
 
         Mockito.when(conn.receiveRequestHeader()).thenReturn(request);
         final HttpResponse response = new BasicHttpResponse(200, "OK");
-        Mockito.when(responseFactory.newHttpResponse(200, context)).thenReturn(response);
+        Mockito.when(responseFactory.newHttpResponse(200)).thenReturn(response);
         final HttpResponse error = new BasicHttpResponse(500, "Oppsie");
-        Mockito.when(responseFactory.newHttpResponse(500, context)).thenReturn(error);
+        Mockito.when(responseFactory.newHttpResponse(500)).thenReturn(error);
         Mockito.when(handlerResolver.lookup(request, context)).thenReturn(requestHandler);
         Mockito.doThrow(new UnsupportedHttpVersionException()).when(
                 requestHandler).handle(request, response, context);
@@ -427,9 +401,9 @@ public class TestHttpService {
 
         Mockito.when(conn.receiveRequestHeader()).thenReturn(request);
         final HttpResponse response = new BasicHttpResponse(200, "OK");
-        Mockito.when(responseFactory.newHttpResponse(200, context)).thenReturn(response);
+        Mockito.when(responseFactory.newHttpResponse(200)).thenReturn(response);
         final HttpResponse error = new BasicHttpResponse(500, "Oppsie");
-        Mockito.when(responseFactory.newHttpResponse(500, context)).thenReturn(error);
+        Mockito.when(responseFactory.newHttpResponse(500)).thenReturn(error);
         Mockito.when(handlerResolver.lookup(request, context)).thenReturn(requestHandler);
         Mockito.doThrow(new ProtocolException("oh, this world is wrong")).when(
                 requestHandler).handle(request, response, context);
@@ -469,7 +443,7 @@ public class TestHttpService {
         final HttpRequest request = new BasicHttpRequest("GET", "/");
         Mockito.when(conn.receiveRequestHeader()).thenReturn(request);
         final HttpResponse response = new BasicHttpResponse(200, "OK");
-        Mockito.when(responseFactory.newHttpResponse(200, context)).thenReturn(response);
+        Mockito.when(responseFactory.newHttpResponse(200)).thenReturn(response);
         Mockito.when(handlerResolver.lookup(request, context)).thenReturn(requestHandler);
         Mockito.when(connReuseStrategy.keepAlive(request, response, context)).thenReturn(Boolean.TRUE);
 
@@ -508,7 +482,7 @@ public class TestHttpService {
 
         Mockito.when(conn.receiveRequestHeader()).thenReturn(request);
         final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_NO_CONTENT, "No Content");
-        Mockito.when(responseFactory.newHttpResponse(200, context)).thenReturn(response);
+        Mockito.when(responseFactory.newHttpResponse(200)).thenReturn(response);
         Mockito.when(handlerResolver.lookup(request, context)).thenReturn(requestHandler);
         Mockito.when(connReuseStrategy.keepAlive(request, response, context)).thenReturn(Boolean.TRUE);
 
@@ -545,7 +519,7 @@ public class TestHttpService {
 
         Mockito.when(conn.receiveRequestHeader()).thenReturn(request);
         final HttpResponse response = new BasicHttpResponse(200, "OK");
-        Mockito.when(responseFactory.newHttpResponse(200, context)).thenReturn(response);
+        Mockito.when(responseFactory.newHttpResponse(200)).thenReturn(response);
         Mockito.when(handlerResolver.lookup(request, context)).thenReturn(requestHandler);
         Mockito.when(connReuseStrategy.keepAlive(request, response, context)).thenReturn(Boolean.TRUE);
 

Modified: httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestRequestParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestRequestParser.java?rev=1735164&r1=1735163&r2=1735164&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestRequestParser.java (original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestRequestParser.java Tue Mar 15 20:35:34 2016
@@ -33,9 +33,7 @@ import java.nio.charset.StandardCharsets
 import org.apache.hc.core5.http.ConnectionClosedException;
 import org.apache.hc.core5.http.Header;
 import org.apache.hc.core5.http.HttpRequest;
-import org.apache.hc.core5.http.HttpVersion;
 import org.apache.hc.core5.http.MessageConstraintException;
-import org.apache.hc.core5.http.RequestLine;
 import org.apache.hc.core5.http.UnsupportedHttpVersionException;
 import org.apache.hc.core5.http.config.MessageConstraints;
 import org.apache.hc.core5.http.io.SessionInputBuffer;
@@ -61,11 +59,8 @@ public class TestRequestParser {
         final DefaultHttpRequestParser parser = new DefaultHttpRequestParser();
         final HttpRequest httprequest = parser.parse(inbuffer, inputStream);
 
-        final RequestLine reqline = httprequest.getRequestLine();
-        Assert.assertNotNull(reqline);
-        Assert.assertEquals("GET", reqline.getMethod());
-        Assert.assertEquals("/", reqline.getUri());
-        Assert.assertEquals(HttpVersion.HTTP_1_1, reqline.getProtocolVersion());
+        Assert.assertEquals("GET", httprequest.getMethod());
+        Assert.assertEquals("/", httprequest.getUri());
         final Header[] headers = httprequest.getAllHeaders();
         Assert.assertEquals(3, headers.length);
     }
@@ -94,11 +89,8 @@ public class TestRequestParser {
                 MessageConstraints.custom().setMaxEmptyLineCount(3).build());
         final HttpRequest httprequest = parser.parse(inbuffer, inputStream);
 
-        final RequestLine reqline = httprequest.getRequestLine();
-        Assert.assertNotNull(reqline);
-        Assert.assertEquals("GET", reqline.getMethod());
-        Assert.assertEquals("/", reqline.getUri());
-        Assert.assertEquals(HttpVersion.HTTP_1_1, reqline.getProtocolVersion());
+        Assert.assertEquals("GET", httprequest.getMethod());
+        Assert.assertEquals("/", httprequest.getUri());
         final Header[] headers = httprequest.getAllHeaders();
         Assert.assertEquals(1, headers.length);
     }
@@ -148,12 +140,8 @@ public class TestRequestParser {
         Assert.assertNotNull(httprequest);
         Assert.assertEquals(5, timeoutCount);
 
-        @SuppressWarnings("null") // httprequest cannot be null here
-        final RequestLine reqline = httprequest.getRequestLine();
-        Assert.assertNotNull(reqline);
-        Assert.assertEquals("GET", reqline.getMethod());
-        Assert.assertEquals("/", reqline.getUri());
-        Assert.assertEquals(HttpVersion.HTTP_1_1, reqline.getProtocolVersion());
+        Assert.assertEquals("GET", httprequest.getMethod());
+        Assert.assertEquals("/", httprequest.getUri());
         final Header[] headers = httprequest.getAllHeaders();
         Assert.assertEquals(3, headers.length);
     }

Modified: httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestResponseParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestResponseParser.java?rev=1735164&r1=1735163&r2=1735164&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestResponseParser.java (original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/io/TestResponseParser.java Tue Mar 15 20:35:34 2016
@@ -33,10 +33,8 @@ import java.nio.charset.StandardCharsets
 
 import org.apache.hc.core5.http.Header;
 import org.apache.hc.core5.http.HttpResponse;
-import org.apache.hc.core5.http.HttpVersion;
 import org.apache.hc.core5.http.MessageConstraintException;
 import org.apache.hc.core5.http.NoHttpResponseException;
-import org.apache.hc.core5.http.StatusLine;
 import org.apache.hc.core5.http.UnsupportedHttpVersionException;
 import org.apache.hc.core5.http.config.MessageConstraints;
 import org.apache.hc.core5.http.io.SessionInputBuffer;
@@ -62,11 +60,8 @@ public class TestResponseParser {
         final DefaultHttpResponseParser parser = new DefaultHttpResponseParser();
         final HttpResponse httpresponse = parser.parse(inbuffer, inputStream);
 
-        final StatusLine statusline = httpresponse.getStatusLine();
-        Assert.assertNotNull(statusline);
-        Assert.assertEquals(200, statusline.getStatusCode());
-        Assert.assertEquals("OK", statusline.getReasonPhrase());
-        Assert.assertEquals(HttpVersion.HTTP_1_1, statusline.getProtocolVersion());
+        Assert.assertEquals(200, httpresponse.getCode());
+        Assert.assertEquals("OK", httpresponse.getReasonPhrase());
         final Header[] headers = httpresponse.getAllHeaders();
         Assert.assertEquals(3, headers.length);
     }
@@ -95,11 +90,8 @@ public class TestResponseParser {
                 MessageConstraints.custom().setMaxEmptyLineCount(3).build());
         final HttpResponse httpresponse = parser.parse(inbuffer, inputStream);
 
-        final StatusLine statusline = httpresponse.getStatusLine();
-        Assert.assertNotNull(statusline);
-        Assert.assertEquals(200, statusline.getStatusCode());
-        Assert.assertEquals("OK", statusline.getReasonPhrase());
-        Assert.assertEquals(HttpVersion.HTTP_1_1, statusline.getProtocolVersion());
+        Assert.assertEquals(200, httpresponse.getCode());
+        Assert.assertEquals("OK", httpresponse.getReasonPhrase());
         final Header[] headers = httpresponse.getAllHeaders();
         Assert.assertEquals(1, headers.length);
     }
@@ -148,12 +140,8 @@ public class TestResponseParser {
         Assert.assertNotNull(httpresponse);
         Assert.assertEquals(5, timeoutCount);
 
-        @SuppressWarnings("null") // httpresponse cannot be null here
-        final StatusLine statusline = httpresponse.getStatusLine();
-        Assert.assertNotNull(statusline);
-        Assert.assertEquals(200, statusline.getStatusCode());
-        Assert.assertEquals("OK", statusline.getReasonPhrase());
-        Assert.assertEquals(HttpVersion.HTTP_1_1, statusline.getProtocolVersion());
+        Assert.assertEquals(200, httpresponse.getCode());
+        Assert.assertEquals("OK", httpresponse.getReasonPhrase());
         final Header[] headers = httpresponse.getAllHeaders();
         Assert.assertEquals(3, headers.length);
     }

Modified: httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestBasicAsyncClientExchangeHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestBasicAsyncClientExchangeHandler.java?rev=1735164&r1=1735163&r2=1735164&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestBasicAsyncClientExchangeHandler.java (original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestBasicAsyncClientExchangeHandler.java Tue Mar 15 20:35:34 2016
@@ -31,7 +31,6 @@ import java.util.concurrent.ExecutionExc
 
 import org.apache.hc.core5.http.ConnectionClosedException;
 import org.apache.hc.core5.http.HttpRequest;
-import org.apache.hc.core5.http.HttpVersion;
 import org.apache.hc.core5.http.message.BasicHttpRequest;
 import org.apache.hc.core5.http.message.BasicHttpResponse;
 import org.apache.hc.core5.http.nio.ContentDecoder;
@@ -154,7 +153,7 @@ public class TestBasicAsyncClientExchang
 
     @Test
     public void testGenerateRequest() throws Exception {
-        final BasicHttpRequest request = new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1);
+        final BasicHttpRequest request = new BasicHttpRequest("GET", "/");
         Mockito.when(this.requestProducer.generateRequest()).thenReturn(request);
 
         final HttpRequest result = this.exchangeHandler.generateRequest();
@@ -194,7 +193,7 @@ public class TestBasicAsyncClientExchang
 
     @Test
     public void testResponseReceived() throws Exception {
-        final BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
+        final BasicHttpResponse response = new BasicHttpResponse(200, "OK");
 
         this.exchangeHandler.responseReceived(response);
 

Modified: httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestBasicAsyncRequestHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestBasicAsyncRequestHandler.java?rev=1735164&r1=1735163&r2=1735164&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestBasicAsyncRequestHandler.java (original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestBasicAsyncRequestHandler.java Tue Mar 15 20:35:34 2016
@@ -29,9 +29,7 @@ package org.apache.hc.core5.http.impl.ni
 
 import org.apache.hc.core5.http.HttpRequest;
 import org.apache.hc.core5.http.HttpResponse;
-import org.apache.hc.core5.http.HttpVersion;
 import org.apache.hc.core5.http.io.HttpRequestHandler;
-import org.apache.hc.core5.http.message.BasicRequestLine;
 import org.apache.hc.core5.http.nio.HttpAsyncExchange;
 import org.apache.hc.core5.http.nio.HttpAsyncRequestConsumer;
 import org.apache.hc.core5.http.protocol.BasicHttpContext;
@@ -87,7 +85,8 @@ public class TestBasicAsyncRequestHandle
 
     @Test
     public void testHandleRequest() throws Exception {
-        Mockito.when(this.request.getRequestLine()).thenReturn(new BasicRequestLine("GET", "/", HttpVersion.HTTP_1_0));
+        Mockito.when(this.request.getMethod()).thenReturn("GET");
+        Mockito.when(this.request.getMethod()).thenReturn("/");
 
         this.asyncRequestHandler.handle(this.request, this.httpexchange, this.context);
 

Modified: httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestDefaultNHttpClientConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestDefaultNHttpClientConnection.java?rev=1735164&r1=1735163&r2=1735164&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestDefaultNHttpClientConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestDefaultNHttpClientConnection.java Tue Mar 15 20:35:34 2016
@@ -37,7 +37,6 @@ import org.apache.hc.core5.http.HttpEnti
 import org.apache.hc.core5.http.HttpHeaders;
 import org.apache.hc.core5.http.HttpRequest;
 import org.apache.hc.core5.http.HttpResponse;
-import org.apache.hc.core5.http.HttpVersion;
 import org.apache.hc.core5.http.entity.StringEntity;
 import org.apache.hc.core5.http.message.BasicHttpRequest;
 import org.apache.hc.core5.http.nio.ContentDecoder;
@@ -489,9 +488,8 @@ public class TestDefaultNHttpClientConne
         Assert.assertFalse(responses.isEmpty());
         final HttpResponse response = responses.getFirst();
         Assert.assertNotNull(response);
-        Assert.assertEquals(HttpVersion.HTTP_1_1, response.getStatusLine().getProtocolVersion());
         Assert.assertEquals(200, response.getCode());
-        Assert.assertEquals("OK", response.getStatusLine().getReasonPhrase());
+        Assert.assertEquals("OK", response.getReasonPhrase());
         final HttpEntity entity = response.getEntity();
         Assert.assertNotNull(entity);
         Assert.assertEquals(5, entity.getContentLength());
@@ -534,9 +532,8 @@ public class TestDefaultNHttpClientConne
         Assert.assertFalse(responses.isEmpty());
         final HttpResponse response = responses.getFirst();
         Assert.assertNotNull(response);
-        Assert.assertEquals(HttpVersion.HTTP_1_1, response.getStatusLine().getProtocolVersion());
         Assert.assertEquals(200, response.getCode());
-        Assert.assertEquals("OK", response.getStatusLine().getReasonPhrase());
+        Assert.assertEquals("OK", response.getReasonPhrase());
         final HttpEntity entity = response.getEntity();
         Assert.assertNotNull(entity);
         Assert.assertEquals(100, entity.getContentLength());
@@ -582,7 +579,6 @@ public class TestDefaultNHttpClientConne
         Assert.assertFalse(responses.isEmpty());
         final HttpResponse response = responses.getFirst();
         Assert.assertNotNull(response);
-        Assert.assertEquals(HttpVersion.HTTP_1_1, response.getStatusLine().getProtocolVersion());
         Assert.assertEquals(100, response.getCode());
         final HttpEntity entity = response.getEntity();
         Assert.assertNull(entity);

Modified: httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestDefaultNHttpServerConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestDefaultNHttpServerConnection.java?rev=1735164&r1=1735163&r2=1735164&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestDefaultNHttpServerConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestDefaultNHttpServerConnection.java Tue Mar 15 20:35:34 2016
@@ -36,7 +36,6 @@ import org.apache.hc.core5.http.HttpEnti
 import org.apache.hc.core5.http.HttpHeaders;
 import org.apache.hc.core5.http.HttpRequest;
 import org.apache.hc.core5.http.HttpResponse;
-import org.apache.hc.core5.http.HttpVersion;
 import org.apache.hc.core5.http.entity.StringEntity;
 import org.apache.hc.core5.http.message.BasicHttpResponse;
 import org.apache.hc.core5.http.nio.ContentDecoder;
@@ -77,7 +76,7 @@ public class TestDefaultNHttpServerConne
 
     @Test
     public void testSubmitRequest() throws Exception {
-        final BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
+        final BasicHttpResponse response = new BasicHttpResponse(200, "OK");
         conn.submitResponse(response);
 
         Assert.assertNull(conn.getHttpResponse());
@@ -88,7 +87,7 @@ public class TestDefaultNHttpServerConne
 
     @Test
     public void testSubmitEntityEnclosingRequest() throws Exception {
-        final BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
+        final BasicHttpResponse response = new BasicHttpResponse(200, "OK");
         response.setEntity(new StringEntity("stuff"));
 
         Mockito.when(session.channel()).thenReturn(byteChan);
@@ -107,7 +106,7 @@ public class TestDefaultNHttpServerConne
 
     @Test
     public void testOutputReset() throws Exception {
-        final BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
+        final BasicHttpResponse response = new BasicHttpResponse(200, "OK");
         response.setEntity(new StringEntity("stuff"));
 
         Mockito.when(session.channel()).thenReturn(byteChan);
@@ -162,7 +161,7 @@ public class TestDefaultNHttpServerConne
 
     @Test
     public void testProduceOutputShortMessageAfterSubmit() throws Exception {
-        final BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
+        final BasicHttpResponse response = new BasicHttpResponse(200, "OK");
         final NStringEntity entity = new NStringEntity("stuff");
         response.setEntity(entity);
 
@@ -187,7 +186,7 @@ public class TestDefaultNHttpServerConne
 
     @Test
     public void testProduceOutputLongMessageAfterSubmit() throws Exception {
-        final BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
+        final BasicHttpResponse response = new BasicHttpResponse(200, "OK");
         final NStringEntity entity = new NStringEntity("a lot of various stuff");
         response.setEntity(entity);
 
@@ -212,7 +211,7 @@ public class TestDefaultNHttpServerConne
 
     @Test
     public void testProduceOutputShortMessage() throws Exception {
-        final BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
+        final BasicHttpResponse response = new BasicHttpResponse(200, "OK");
         final NStringEntity entity = new NStringEntity("stuff");
         response.setEntity(entity);
 
@@ -237,7 +236,7 @@ public class TestDefaultNHttpServerConne
 
     @Test
     public void testProduceOutputLongMessage() throws Exception {
-        final BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
+        final BasicHttpResponse response = new BasicHttpResponse(200, "OK");
         final NStringEntity entity = new NStringEntity("a lot of various stuff");
         response.setEntity(entity);
 
@@ -262,7 +261,7 @@ public class TestDefaultNHttpServerConne
 
     @Test
     public void testProduceOutputLongMessageSaturatedChannel() throws Exception {
-        final BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
+        final BasicHttpResponse response = new BasicHttpResponse(200, "OK");
         final NStringEntity entity = new NStringEntity("a lot of various stuff");
         response.setEntity(entity);
 
@@ -290,7 +289,7 @@ public class TestDefaultNHttpServerConne
     @Test
     public void testProduceOutputLongMessageSaturatedChannel2() throws Exception {
         conn = new DefaultNHttpServerConnection(session, 24);
-        final BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
+        final BasicHttpResponse response = new BasicHttpResponse(200, "OK");
         final NStringEntity entity = new NStringEntity("a loooooooooooooooooooooooot of various stuff");
         response.setEntity(entity);
 
@@ -318,7 +317,7 @@ public class TestDefaultNHttpServerConne
     public void testProduceOutputLongChunkedMessage() throws Exception {
         conn = new DefaultNHttpServerConnection(session, 64);
 
-        final BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
+        final BasicHttpResponse response = new BasicHttpResponse(200, "OK");
         response.setHeader(HttpHeaders.TRANSFER_ENCODING, "chunked");
         final NStringEntity entity = new NStringEntity("a lot of various stuff");
         entity.setChunked(true);
@@ -348,7 +347,7 @@ public class TestDefaultNHttpServerConne
     public void testProduceOutputLongChunkedMessageSaturatedChannel() throws Exception {
         conn = new DefaultNHttpServerConnection(session, 64);
 
-        final BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
+        final BasicHttpResponse response = new BasicHttpResponse(200, "OK");
         response.setHeader(HttpHeaders.TRANSFER_ENCODING, "chunked");
         final NStringEntity entity = new NStringEntity("a lot of various stuff");
         entity.setChunked(true);
@@ -378,7 +377,7 @@ public class TestDefaultNHttpServerConne
 
     @Test
     public void testProduceOutputClosingConnection() throws Exception {
-        final BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
+        final BasicHttpResponse response = new BasicHttpResponse(200, "OK");
 
         final WritableByteChannelMock wchannel = Mockito.spy(new WritableByteChannelMock(64));
         final ByteChannelMock channel = new ByteChannelMock(null, wchannel);
@@ -480,11 +479,10 @@ public class TestDefaultNHttpServerConne
         Assert.assertFalse(requests.isEmpty());
         final HttpRequest request = requests.getFirst();
         Assert.assertNotNull(request);
-        Assert.assertEquals(HttpVersion.HTTP_1_1, request.getRequestLine().getProtocolVersion());
-        Assert.assertEquals("POST", request.getRequestLine().getMethod());
-        Assert.assertEquals("/", request.getRequestLine().getUri());
+        Assert.assertEquals("POST", request.getMethod());
+        Assert.assertEquals("/", request.getUri());
         Assert.assertTrue(request instanceof HttpRequest);
-        final HttpEntity entity = ((HttpRequest) request).getEntity();
+        final HttpEntity entity = request.getEntity();
         Assert.assertNotNull(entity);
         Assert.assertEquals(5, entity.getContentLength());
     }
@@ -526,11 +524,10 @@ public class TestDefaultNHttpServerConne
         Assert.assertFalse(requests.isEmpty());
         final HttpRequest request = requests.getFirst();
         Assert.assertNotNull(request);
-        Assert.assertEquals(HttpVersion.HTTP_1_1, request.getRequestLine().getProtocolVersion());
-        Assert.assertEquals("POST", request.getRequestLine().getMethod());
-        Assert.assertEquals("/", request.getRequestLine().getUri());
+        Assert.assertEquals("POST", request.getMethod());
+        Assert.assertEquals("/", request.getUri());
         Assert.assertTrue(request instanceof HttpRequest);
-        final HttpEntity entity = ((HttpRequest) request).getEntity();
+        final HttpEntity entity = request.getEntity();
         Assert.assertNotNull(entity);
         Assert.assertEquals(100, entity.getContentLength());
 
@@ -575,9 +572,8 @@ public class TestDefaultNHttpServerConne
         Assert.assertFalse(requests.isEmpty());
         final HttpRequest request = requests.getFirst();
         Assert.assertNotNull(request);
-        Assert.assertEquals(HttpVersion.HTTP_1_1, request.getRequestLine().getProtocolVersion());
-        Assert.assertEquals("GET", request.getRequestLine().getMethod());
-        Assert.assertEquals("/", request.getRequestLine().getUri());
+        Assert.assertEquals("GET", request.getMethod());
+        Assert.assertEquals("/", request.getUri());
     }
 
     @Test

Modified: httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestErrorResponseProducer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestErrorResponseProducer.java?rev=1735164&r1=1735163&r2=1735164&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestErrorResponseProducer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestErrorResponseProducer.java Tue Mar 15 20:35:34 2016
@@ -30,7 +30,6 @@ package org.apache.hc.core5.http.impl.ni
 import org.apache.hc.core5.http.HttpEntity;
 import org.apache.hc.core5.http.HttpHeaders;
 import org.apache.hc.core5.http.HttpResponse;
-import org.apache.hc.core5.http.HttpVersion;
 import org.apache.hc.core5.http.entity.StringEntity;
 import org.apache.hc.core5.http.message.BasicHttpResponse;
 import org.junit.After;
@@ -46,7 +45,7 @@ public class TestErrorResponseProducer {
 
     @Before
     public void setUp() throws Exception {
-        response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
+        response = new BasicHttpResponse(200, "OK");
         entity = new StringEntity("stuff");
     }
 

Modified: httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestHttpAsyncRequestExecutor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestHttpAsyncRequestExecutor.java?rev=1735164&r1=1735163&r2=1735164&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestHttpAsyncRequestExecutor.java (original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestHttpAsyncRequestExecutor.java Tue Mar 15 20:35:34 2016
@@ -97,7 +97,7 @@ public class TestHttpAsyncRequestExecuto
         Mockito.verify(this.conn).submitRequest(request);
         Mockito.verify(this.exchangeHandler).requestCompleted();
         Assert.assertEquals(MessageState.COMPLETED, state.getRequestState());
-        Assert.assertEquals("[outgoing COMPLETED GET / HTTP/1.1; incoming READY]", state.toString());
+        Assert.assertEquals("[outgoing COMPLETED GET /; incoming READY]", state.toString());
     }
 
     @Test
@@ -1032,7 +1032,7 @@ public class TestHttpAsyncRequestExecuto
         this.connContext.setAttribute(HttpAsyncRequestExecutor.HTTP_HANDLER, this.exchangeHandler);
         Mockito.when(this.exchangeHandler.isDone()).thenReturn(Boolean.TRUE);
 
-        Assert.assertEquals("[outgoing READY GET / HTTP/1.1; incoming READY HTTP/1.1 200 OK]", state.toString());
+        Assert.assertEquals("[outgoing READY GET /; incoming READY 200]", state.toString());
 
         this.protocolHandler.requestReady(this.conn);
 

Modified: httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestHttpAsyncService.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestHttpAsyncService.java?rev=1735164&r1=1735163&r2=1735164&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestHttpAsyncService.java (original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestHttpAsyncService.java Tue Mar 15 20:35:34 2016
@@ -992,7 +992,7 @@ public class TestHttpAsyncService {
 
         Assert.assertEquals(MessageState.COMPLETED, state.getRequestState());
         Assert.assertEquals(MessageState.BODY_STREAM, state.getResponseState());
-        Assert.assertEquals("[incoming COMPLETED GET / HTTP/1.1; outgoing BODY_STREAM HTTP/1.1 200 OK]",
+        Assert.assertEquals("[incoming COMPLETED GET /; outgoing BODY_STREAM 200]",
                 state.toString());
 
         Mockito.verify(this.httpProcessor).process(response, exchangeContext);

Modified: httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestHttpMessageParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestHttpMessageParser.java?rev=1735164&r1=1735163&r2=1735164&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestHttpMessageParser.java (original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestHttpMessageParser.java Tue Mar 15 20:35:34 2016
@@ -38,7 +38,6 @@ import java.nio.charset.StandardCharsets
 import org.apache.hc.core5.http.HttpException;
 import org.apache.hc.core5.http.HttpRequest;
 import org.apache.hc.core5.http.HttpResponse;
-import org.apache.hc.core5.http.HttpVersion;
 import org.apache.hc.core5.http.MessageConstraintException;
 import org.apache.hc.core5.http.UnsupportedHttpVersionException;
 import org.apache.hc.core5.http.config.MessageConstraints;
@@ -69,7 +68,7 @@ public class TestHttpMessageParser {
         inbuf.fill(newChannel("GET /whatever HTTP/1.1\r\nSome header: stuff\r\n\r\n"));
         final HttpRequest request = requestParser.parse(inbuf, false);
         Assert.assertNotNull(request);
-        Assert.assertEquals("/whatever", request.getRequestLine().getUri());
+        Assert.assertEquals("/whatever", request.getUri());
         Assert.assertEquals(1, request.getAllHeaders().length);
     }
 
@@ -88,7 +87,7 @@ public class TestHttpMessageParser {
         request = requestParser.parse(inbuf, false);
 
         Assert.assertNotNull(request);
-        Assert.assertEquals("/whatever", request.getRequestLine().getUri());
+        Assert.assertEquals("/whatever", request.getUri());
         Assert.assertEquals(1, request.getAllHeaders().length);
 
     }
@@ -117,7 +116,7 @@ public class TestHttpMessageParser {
         request = requestParser.parse(inbuf, false);
 
         Assert.assertNotNull(request);
-        Assert.assertEquals("/whatever", request.getRequestLine().getUri());
+        Assert.assertEquals("/whatever", request.getUri());
         Assert.assertEquals(1, request.getAllHeaders().length);
         Assert.assertEquals("stuff more stuff", request.getFirstHeader("Some header").getValue());
     }
@@ -143,7 +142,7 @@ public class TestHttpMessageParser {
         request = requestParser.parse(inbuf, false);
 
         Assert.assertNotNull(request);
-        Assert.assertEquals("/whatever", request.getRequestLine().getUri());
+        Assert.assertEquals("/whatever", request.getUri());
         Assert.assertEquals(1, request.getAllHeaders().length);
         Assert.assertEquals("stuff more stuff", request.getFirstHeader("Some header").getValue());
     }
@@ -172,7 +171,7 @@ public class TestHttpMessageParser {
         request = requestParser.parse(inbuf, false);
 
         Assert.assertNotNull(request);
-        Assert.assertEquals("/whatever", request.getRequestLine().getUri());
+        Assert.assertEquals("/whatever", request.getUri());
         Assert.assertEquals(1, request.getAllHeaders().length);
         Assert.assertEquals("stuff  more stuff", request.getFirstHeader("Some header").getValue());
     }
@@ -186,7 +185,6 @@ public class TestHttpMessageParser {
         inbuf.fill(channel);
         final HttpRequest request = requestParser.parse(inbuf, true);
         Assert.assertNotNull(request);
-        Assert.assertEquals(HttpVersion.HTTP_1_0, request.getRequestLine().getProtocolVersion());
     }
 
     @Test
@@ -316,7 +314,7 @@ public class TestHttpMessageParser {
         inbuf.fill(newChannel("\r\n\r\nGET /whatever HTTP/1.1\r\nSome header: stuff\r\n\r\n"));
         final HttpRequest request = requestParser.parse(inbuf, false);
         Assert.assertNotNull(request);
-        Assert.assertEquals("/whatever", request.getRequestLine().getUri());
+        Assert.assertEquals("/whatever", request.getUri());
         Assert.assertEquals(1, request.getAllHeaders().length);
     }
 

Modified: httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestNHttpConnectionBase.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestNHttpConnectionBase.java?rev=1735164&r1=1735163&r2=1735164&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestNHttpConnectionBase.java (original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestNHttpConnectionBase.java Tue Mar 15 20:35:34 2016
@@ -34,7 +34,6 @@ import java.nio.channels.SelectionKey;
 import org.apache.hc.core5.http.ContentLengthStrategy;
 import org.apache.hc.core5.http.HttpEntity;
 import org.apache.hc.core5.http.HttpHeaders;
-import org.apache.hc.core5.http.HttpVersion;
 import org.apache.hc.core5.http.message.BasicHttpResponse;
 import org.apache.hc.core5.http.nio.NHttpConnection;
 import org.apache.hc.core5.reactor.IOSession;
@@ -191,7 +190,7 @@ public class TestNHttpConnectionBase {
 
     @Test
     public void testCreateEntityWithContentLength() throws Exception {
-        final BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
+        final BasicHttpResponse response = new BasicHttpResponse(200, "OK");
         response.addHeader(HttpHeaders.CONTENT_LENGTH, "10");
         response.addHeader(HttpHeaders.CONTENT_TYPE, "stuff");
         response.addHeader(HttpHeaders.CONTENT_ENCODING, "blah");
@@ -206,7 +205,7 @@ public class TestNHttpConnectionBase {
 
     @Test
     public void testCreateEntityChunkCoded() throws Exception {
-        final BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
+        final BasicHttpResponse response = new BasicHttpResponse(200, "OK");
         response.addHeader(HttpHeaders.TRANSFER_ENCODING, "chunked");
         response.addHeader(HttpHeaders.CONTENT_TYPE, "stuff");
         response.addHeader(HttpHeaders.CONTENT_ENCODING, "blah");

Modified: httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/integration/SimpleRequestHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/integration/SimpleRequestHandler.java?rev=1735164&r1=1735163&r2=1735164&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/integration/SimpleRequestHandler.java (original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/integration/SimpleRequestHandler.java Tue Mar 15 20:35:34 2016
@@ -58,7 +58,7 @@ final class SimpleRequestHandler impleme
             final HttpResponse response,
             final HttpContext context) throws HttpException, IOException {
 
-        final String s = request.getRequestLine().getUri();
+        final String s = request.getUri();
         final int idx = s.indexOf('x');
         if (idx == -1) {
             throw new HttpException("Unexpected request-URI format");

Modified: httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/integration/TestClientOutOfSequenceResponse.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/integration/TestClientOutOfSequenceResponse.java?rev=1735164&r1=1735163&r2=1735164&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/integration/TestClientOutOfSequenceResponse.java (original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/integration/TestClientOutOfSequenceResponse.java Tue Mar 15 20:35:34 2016
@@ -37,7 +37,6 @@ import org.apache.hc.core5.http.HttpExce
 import org.apache.hc.core5.http.HttpHost;
 import org.apache.hc.core5.http.HttpRequest;
 import org.apache.hc.core5.http.HttpResponse;
-import org.apache.hc.core5.http.HttpVersion;
 import org.apache.hc.core5.http.config.ConnectionConfig;
 import org.apache.hc.core5.http.message.BasicHttpRequest;
 import org.apache.hc.core5.http.pool.nio.BasicNIOConnFactory;
@@ -78,9 +77,9 @@ public class TestClientOutOfSequenceResp
 
         client.start();
         final HttpHost target = new HttpHost("localhost", server.getLocalPort());
-        final HttpRequest get1 = new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1);
+        final HttpRequest get1 = new BasicHttpRequest("GET", "/");
         final Future<HttpResponse> future1 = client.execute(target, get1);
-        final HttpRequest get2 = new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1);
+        final HttpRequest get2 = new BasicHttpRequest("GET", "/");
         final Future<HttpResponse> future2 = client.execute(target, get2);
 
         final Socket socket = server.accept();

Modified: httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlerCancellable.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlerCancellable.java?rev=1735164&r1=1735163&r2=1735164&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlerCancellable.java (original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlerCancellable.java Tue Mar 15 20:35:34 2016
@@ -40,7 +40,6 @@ import org.apache.hc.core5.concurrent.Ca
 import org.apache.hc.core5.http.HttpException;
 import org.apache.hc.core5.http.HttpRequest;
 import org.apache.hc.core5.http.HttpResponse;
-import org.apache.hc.core5.http.HttpVersion;
 import org.apache.hc.core5.http.entity.BasicHttpEntity;
 import org.apache.hc.core5.http.entity.ContentType;
 import org.apache.hc.core5.http.impl.nio.BasicAsyncRequestConsumer;
@@ -79,7 +78,7 @@ public class TestHttpAsyncHandlerCancell
 
             @Override
             public HttpResponse generateResponse() {
-                final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
+                final HttpResponse response = new BasicHttpResponse(200, "OK");
                 final BasicHttpEntity entity = new BasicHttpEntity();
                 entity.setContentType(ContentType.DEFAULT_BINARY.toString());
                 entity.setChunked(true);

Modified: httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlers.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlers.java?rev=1735164&r1=1735163&r2=1735164&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlers.java (original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlers.java Tue Mar 15 20:35:34 2016
@@ -37,6 +37,7 @@ import java.util.concurrent.ConcurrentLi
 import java.util.concurrent.Future;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import org.apache.hc.core5.http.Header;
 import org.apache.hc.core5.http.HttpEntity;
 import org.apache.hc.core5.http.HttpException;
 import org.apache.hc.core5.http.HttpHeaders;
@@ -46,7 +47,7 @@ import org.apache.hc.core5.http.HttpRequ
 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.entity.ByteArrayEntity;
 import org.apache.hc.core5.http.entity.ContentType;
 import org.apache.hc.core5.http.entity.EntityUtils;
 import org.apache.hc.core5.http.impl.nio.BasicAsyncRequestConsumer;
@@ -251,7 +252,27 @@ public class TestHttpAsyncHandlers exten
 
     @Test
     public void testHttpPostsHTTP10() throws Exception {
-        this.server.registerHandler("*", new BasicAsyncRequestHandler(new SimpleRequestHandler()));
+        this.server.registerHandler("*", new BasicAsyncRequestHandler(new HttpRequestHandler() {
+
+            @Override
+            public void handle(
+                    final HttpRequest request,
+                    final HttpResponse response,
+                    final HttpContext context) throws HttpException, IOException {
+
+                final HttpEntity incoming = request.getEntity();
+                if (incoming != null) {
+                    final byte[] data = EntityUtils.toByteArray(incoming);
+                    final ByteArrayEntity outgoing = new ByteArrayEntity(data);
+                    outgoing.setChunked(false);
+                    response.setEntity(outgoing);
+                }
+                if (HttpVersion.HTTP_1_0.equals(request.getVersion())) {
+                    response.addHeader("Version", "1.0");
+                }
+            }
+
+        }));
         final HttpHost target = start();
 
         this.client.setMaxPerRoute(3);
@@ -264,8 +285,8 @@ public class TestHttpAsyncHandlers exten
 
         final Queue<Future<HttpResponse>> queue = new ConcurrentLinkedQueue<>();
         for (int i = 0; i < 30; i++) {
-            final BasicHttpRequest request = new BasicHttpRequest(
-                    "POST", createRequestUri(pattern, count), HttpVersion.HTTP_1_0);
+            final BasicHttpRequest request = new BasicHttpRequest("POST", createRequestUri(pattern, count));
+            request.setVersion(HttpVersion.HTTP_1_0);
             final NStringEntity entity = new NStringEntity(expectedPattern, ContentType.DEFAULT_TEXT);
             request.setEntity(entity);
             final Future<HttpResponse> future = this.client.execute(target, request);
@@ -276,6 +297,10 @@ public class TestHttpAsyncHandlers exten
             final Future<HttpResponse> future = queue.remove();
             final HttpResponse response = future.get();
             Assert.assertNotNull(response);
+            Assert.assertEquals(HttpVersion.HTTP_1_1, response.getVersion());
+            final Header h1 = response.getFirstHeader("Version");
+            Assert.assertNotNull(h1);
+            Assert.assertEquals("1.0", h1.getValue());
             Assert.assertEquals(expectedPattern, EntityUtils.toString(response.getEntity()));
         }
     }
@@ -419,14 +444,9 @@ public class TestHttpAsyncHandlers exten
                     final HttpAsyncExchange httpexchange,
                     final HttpContext context) throws HttpException {
                 final HttpRequest request = httpexchange.getRequest();
-                ProtocolVersion ver = request.getRequestLine().getProtocolVersion();
-                final String s = request.getRequestLine().getUri();
+                final String s = request.getUri();
                 if (!s.equals("AAAAAx10")) {
-                    if (!ver.lessEquals(HttpVersion.HTTP_1_1)) {
-                        ver = HttpVersion.HTTP_1_1;
-                    }
-                    final BasicHttpResponse response = new BasicHttpResponse(ver,
-                            HttpStatus.SC_EXPECTATION_FAILED, "Expectation failed");
+                    final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_EXPECTATION_FAILED, "Expectation failed");
                     response.setEntity(new NStringEntity("Expectation failed", ContentType.TEXT_PLAIN));
                     httpexchange.submitResponse(new BasicAsyncResponseProducer(response));
                 } else {
@@ -494,11 +514,7 @@ public class TestHttpAsyncHandlers exten
                     final HttpRequest request,
                     final HttpAsyncExchange httpexchange,
                     final HttpContext context) throws HttpException, IOException {
-                ProtocolVersion ver = request.getRequestLine().getProtocolVersion();
-                if (!ver.lessEquals(HttpVersion.HTTP_1_1)) {
-                    ver = HttpVersion.HTTP_1_1;
-                }
-                final BasicHttpResponse response = new BasicHttpResponse(ver, HttpStatus.SC_OK, "OK");
+                final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_OK, "OK");
                 new Thread() {
                     @Override
                     public void run() {
@@ -508,7 +524,7 @@ public class TestHttpAsyncHandlers exten
                         try {
                             requestHandler.handle(request, response, context);
                         } catch (final Exception ex) {
-                            response.setStatusCode(HttpStatus.SC_INTERNAL_SERVER_ERROR);
+                            response.setCode(HttpStatus.SC_INTERNAL_SERVER_ERROR);
                         }
                         httpexchange.submitResponse(new BasicAsyncResponseProducer(response));
                     }
@@ -560,14 +576,9 @@ public class TestHttpAsyncHandlers exten
                         }
                         // Set the entity after delaying...
                         final HttpRequest request = httpexchange.getRequest();
-                        ProtocolVersion ver = request.getRequestLine().getProtocolVersion();
-                        final String s = request.getRequestLine().getUri();
+                        final String s = request.getUri();
                         if (!s.equals("AAAAAx10")) {
-                            if (!ver.lessEquals(HttpVersion.HTTP_1_1)) {
-                                ver = HttpVersion.HTTP_1_1;
-                            }
-                            final BasicHttpResponse response = new BasicHttpResponse(ver,
-                                    HttpStatus.SC_EXPECTATION_FAILED, "Expectation failed");
+                            final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_EXPECTATION_FAILED, "Expectation failed");
                             response.setEntity(new NStringEntity("Expectation failed", ContentType.TEXT_PLAIN));
                             httpexchange.submitResponse(new BasicAsyncResponseProducer(response));
                         } else {
@@ -625,14 +636,9 @@ public class TestHttpAsyncHandlers exten
                     @Override
                     public void run() {
                         final HttpRequest request = httpexchange.getRequest();
-                        ProtocolVersion ver = request.getRequestLine().getProtocolVersion();
-                        final String s = request.getRequestLine().getUri();
+                        final String s = request.getUri();
                         if (!s.equals("AAAAAx10")) {
-                            if (!ver.lessEquals(HttpVersion.HTTP_1_1)) {
-                                ver = HttpVersion.HTTP_1_1;
-                            }
-                            final BasicHttpResponse response = new BasicHttpResponse(ver,
-                                    HttpStatus.SC_EXPECTATION_FAILED, "Expectation failed");
+                            final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_EXPECTATION_FAILED, "Expectation failed");
                             response.setEntity(new NStringEntity("Expectation failed", ContentType.TEXT_PLAIN));
                             httpexchange.submitResponse(new BasicAsyncResponseProducer(response));
                         } else {
@@ -682,14 +688,9 @@ public class TestHttpAsyncHandlers exten
                     @Override
                     public void run() {
                         final HttpRequest request = httpexchange.getRequest();
-                        ProtocolVersion ver = request.getRequestLine().getProtocolVersion();
-                        final String s = request.getRequestLine().getUri();
+                        final String s = request.getUri();
                         if (!s.equals("AAAAAx10")) {
-                            if (!ver.lessEquals(HttpVersion.HTTP_1_1)) {
-                                ver = HttpVersion.HTTP_1_1;
-                            }
-                            final BasicHttpResponse response = new BasicHttpResponse(ver,
-                                    HttpStatus.SC_EXPECTATION_FAILED, "Expectation failed");
+                            final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_EXPECTATION_FAILED, "Expectation failed");
                             response.setEntity(new NStringEntity("Expectation failed", ContentType.TEXT_PLAIN));
                             httpexchange.submitResponse(new BasicAsyncResponseProducer(response));
                         } else {
@@ -741,14 +742,9 @@ public class TestHttpAsyncHandlers exten
                     @Override
                     public void run() {
                         final HttpRequest request = httpexchange.getRequest();
-                        ProtocolVersion ver = request.getRequestLine().getProtocolVersion();
-                        final String s = request.getRequestLine().getUri();
+                        final String s = request.getUri();
                         if (!s.equals("AAAAAx10")) {
-                            if (!ver.lessEquals(HttpVersion.HTTP_1_1)) {
-                                ver = HttpVersion.HTTP_1_1;
-                            }
-                            final BasicHttpResponse response = new BasicHttpResponse(ver,
-                                    HttpStatus.SC_EXPECTATION_FAILED, "Expectation failed");
+                            final HttpResponse response = new BasicHttpResponse(HttpStatus.SC_EXPECTATION_FAILED, "Expectation failed");
                             response.setEntity(new NStringEntity("Expectation failed", ContentType.TEXT_PLAIN));
 
                             final AtomicInteger count = new AtomicInteger(0);
@@ -885,7 +881,7 @@ public class TestHttpAsyncHandlers exten
                     final HttpRequest request,
                     final HttpResponse response,
                     final HttpContext context) throws HttpException, IOException {
-                response.setStatusCode(HttpStatus.SC_NO_CONTENT);
+                response.setCode(HttpStatus.SC_NO_CONTENT);
             }
 
         }));
@@ -918,7 +914,7 @@ public class TestHttpAsyncHandlers exten
                     final HttpRequest request,
                     final HttpResponse response,
                     final HttpContext context) throws HttpException, IOException {
-                response.setStatusCode(HttpStatus.SC_OK);
+                response.setCode(HttpStatus.SC_OK);
                 response.setEntity(new NStringEntity("All is well", StandardCharsets.US_ASCII));
             }
 
@@ -929,12 +925,13 @@ public class TestHttpAsyncHandlers exten
         this.client.setMaxPerRoute(3);
         this.client.setMaxTotal(3);
 
-        final BasicHttpRequest request1 = new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_0);
+        final BasicHttpRequest request1 = new BasicHttpRequest("GET", "/");
+        request1.setVersion(HttpVersion.HTTP_1_0);
         final Future<HttpResponse> future1 = this.client.execute(target, request1);
         final HttpResponse response1 = future1.get();
         Assert.assertNotNull(response1);
         Assert.assertEquals(200, response1.getCode());
-        final BasicHttpRequest request2 = new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1);
+        final BasicHttpRequest request2 = new BasicHttpRequest("GET", "/");
         final Future<HttpResponse> future2 = this.client.execute(target, request2);
         final HttpResponse response2 = future2.get();
         Assert.assertNotNull(response2);

Modified: httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlersPipelining.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlersPipelining.java?rev=1735164&r1=1735163&r2=1735164&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlersPipelining.java (original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlersPipelining.java Tue Mar 15 20:35:34 2016
@@ -45,7 +45,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.entity.ContentType;
 import org.apache.hc.core5.http.entity.EntityUtils;
 import org.apache.hc.core5.http.entity.StringEntity;
@@ -276,7 +275,7 @@ public class TestHttpAsyncHandlersPipeli
                     final HttpRequest request,
                     final HttpAsyncExchange httpexchange,
                     final HttpContext context) throws HttpException, IOException {
-                final BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
+                final BasicHttpResponse response = new BasicHttpResponse(HttpStatus.SC_OK, "OK");
                 new Thread() {
                     @Override
                     public void run() {
@@ -286,7 +285,7 @@ public class TestHttpAsyncHandlersPipeli
                         try {
                             requestHandler.handle(request, response, context);
                         } catch (final Exception ex) {
-                            response.setStatusCode(HttpStatus.SC_INTERNAL_SERVER_ERROR);
+                            response.setCode(HttpStatus.SC_INTERNAL_SERVER_ERROR);
                         }
                         httpexchange.submitResponse(new BasicAsyncResponseProducer(response));
                     }
@@ -351,7 +350,7 @@ public class TestHttpAsyncHandlersPipeli
                     final HttpRequest request,
                     final HttpResponse response,
                     final HttpContext context) throws HttpException, IOException {
-                response.setStatusCode(HttpStatus.SC_OK);
+                response.setCode(HttpStatus.SC_OK);
                 response.setEntity(new StringEntity("all is well", ContentType.TEXT_PLAIN));
             }
 
@@ -363,7 +362,7 @@ public class TestHttpAsyncHandlersPipeli
                     final HttpRequest request,
                     final HttpResponse response,
                     final HttpContext context) throws HttpException, IOException {
-                response.setStatusCode(HttpStatus.SC_INTERNAL_SERVER_ERROR);
+                response.setCode(HttpStatus.SC_INTERNAL_SERVER_ERROR);
                 response.setHeader(HttpHeaders.CONNECTION, "Close");
                 response.setEntity(new StringEntity("boooooom!!!!!", ContentType.TEXT_PLAIN));
             }

Modified: httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/integration/TestSyncHttp.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/integration/TestSyncHttp.java?rev=1735164&r1=1735163&r2=1735164&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/integration/TestSyncHttp.java (original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/integration/TestSyncHttp.java Tue Mar 15 20:35:34 2016
@@ -124,7 +124,7 @@ public class TestSyncHttp {
                     final HttpResponse response,
                     final HttpContext context) throws HttpException, IOException {
 
-                String s = request.getRequestLine().getUri();
+                String s = request.getUri();
                 if (s.startsWith("/?")) {
                     s = s.substring(2);
                 }
@@ -362,11 +362,13 @@ public class TestSyncHttp {
                 final HttpEntity incoming = request.getEntity();
                 if (incoming != null) {
                     final byte[] data = EntityUtils.toByteArray(incoming);
-
                     final ByteArrayEntity outgoing = new ByteArrayEntity(data);
                     outgoing.setChunked(false);
                     response.setEntity(outgoing);
                 }
+                if (HttpVersion.HTTP_1_0.equals(request.getVersion())) {
+                    response.addHeader("Version", "1.0");
+                }
             }
 
         });
@@ -383,14 +385,17 @@ public class TestSyncHttp {
                 }
 
                 // Set protocol level to HTTP/1.0
-                final BasicHttpRequest post = new BasicHttpRequest(
-                        "POST", "/", HttpVersion.HTTP_1_0);
+                final BasicHttpRequest post = new BasicHttpRequest("POST", "/");
+                post.setVersion(HttpVersion.HTTP_1_0);
                 final byte[] data = testData.get(r);
                 final ByteArrayEntity outgoing = new ByteArrayEntity(data);
                 post.setEntity(outgoing);
 
                 final HttpResponse response = this.client.execute(post, host, conn);
-                Assert.assertEquals(HttpVersion.HTTP_1_1, response.getStatusLine().getProtocolVersion());
+                Assert.assertEquals(HttpVersion.HTTP_1_1, response.getVersion());
+                final Header h1 = response.getFirstHeader("Version");
+                Assert.assertNotNull(h1);
+                Assert.assertEquals("1.0", h1.getValue());
                 final byte[] received = EntityUtils.toByteArray(response.getEntity());
                 final byte[] expected = testData.get(r);
 
@@ -533,11 +538,11 @@ public class TestSyncHttp {
                     try {
                         secretNumber = Integer.parseInt(someheader.getValue());
                     } catch (final NumberFormatException ex) {
-                        response.setStatusCode(HttpStatus.SC_BAD_REQUEST);
+                        response.setCode(HttpStatus.SC_BAD_REQUEST);
                         return;
                     }
                     if (secretNumber >= 2) {
-                        response.setStatusCode(HttpStatus.SC_EXPECTATION_FAILED);
+                        response.setCode(HttpStatus.SC_EXPECTATION_FAILED);
                         response.setEntity(
                                 new StringEntity("Wrong secret number", ContentType.TEXT_PLAIN));
                     }
@@ -672,7 +677,7 @@ public class TestSyncHttp {
 
                 if (request instanceof HttpRequest) {
                     int n = 1;
-                    String s = request.getRequestLine().getUri();
+                    String s = request.getUri();
                     if (s.startsWith("/?n=")) {
                         s = s.substring(4);
                         try {
@@ -915,7 +920,7 @@ public class TestSyncHttp {
                     final HttpRequest request,
                     final HttpResponse response,
                     final HttpContext context) throws HttpException, IOException {
-                response.setStatusCode(HttpStatus.SC_NO_CONTENT);
+                response.setCode(HttpStatus.SC_NO_CONTENT);
             }
 
         });
@@ -975,11 +980,12 @@ public class TestSyncHttp {
         client.connect(host, conn);
 
         try {
-            final BasicHttpRequest get1 = new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_0);
+            final BasicHttpRequest get1 = new BasicHttpRequest("GET", "/");
+            get1.setVersion(HttpVersion.HTTP_1_0);
             final HttpResponse response1 = this.client.execute(get1, host, conn);
             Assert.assertEquals(200, response1.getCode());
             EntityUtils.consume(response1.getEntity());
-            final BasicHttpRequest get2 = new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1);
+            final BasicHttpRequest get2 = new BasicHttpRequest("GET", "/");
             final HttpResponse response2 = this.client.execute(get2, host, conn);
             Assert.assertEquals(400, response2.getCode());
             EntityUtils.consume(response2.getEntity());

Modified: httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/message/TestAbstractMessage.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/message/TestAbstractMessage.java?rev=1735164&r1=1735163&r2=1735164&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/message/TestAbstractMessage.java (original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/http/message/TestAbstractMessage.java Tue Mar 15 20:35:34 2016
@@ -28,7 +28,6 @@ package org.apache.hc.core5.http.message
 
 import org.apache.hc.core5.http.Header;
 import org.apache.hc.core5.http.HttpMessage;
-import org.apache.hc.core5.http.HttpVersion;
 import org.apache.hc.core5.http.ProtocolVersion;
 import org.junit.Assert;
 import org.junit.Test;
@@ -44,8 +43,12 @@ public class TestAbstractMessage {
         private static final long serialVersionUID = 1L;
 
         @Override
-        public ProtocolVersion getProtocolVersion() {
-            return HttpVersion.HTTP_1_1;
+        public ProtocolVersion getVersion() {
+            return null;
+        }
+
+        @Override
+        public void setVersion(final ProtocolVersion version) {
         }
 
     }



Mime
View raw message