hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1720981 - in /httpcomponents/httpcore/trunk/httpcore/src: main/java/org/apache/hc/core5/http/ main/java/org/apache/hc/core5/http/impl/ main/java/org/apache/hc/core5/http/impl/io/ main/java/org/apache/hc/core5/http/impl/nio/ main/java/org/a...
Date Sat, 19 Dec 2015 23:51:45 GMT
Author: ggregory
Date: Sat Dec 19 23:51:44 2015
New Revision: 1720981

URL: http://svn.apache.org/viewvc?rev=1720981&view=rev
Log:
Add HttpResponse.getCode() as a short hand for getStatusLine().getStatusCode(). Use new method.

Modified:
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/HttpResponse.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/DefaultConnectionReuseStrategy.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/io/DefaultBHttpClientConnection.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/io/DefaultBHttpServerConnection.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/io/HttpRequestExecutor.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/io/HttpService.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/nio/DefaultNHttpClientConnection.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/nio/DefaultNHttpServerConnection.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/nio/HttpAsyncRequestExecutor.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/nio/HttpAsyncService.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/message/BasicHttpResponse.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/protocol/ResponseConnControl.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/protocol/ResponseContent.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/protocol/ResponseDate.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestDefaultBHttpClientConnection.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestHttpService.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestDefaultNHttpClientConnection.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestErrorResponseProducer.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestHttpAsyncService.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestClientOutOfSequenceResponse.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestCustomSSL.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlers.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlersBrokenExpectContinue.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlersPipelining.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestSyncHttp.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestTruncatedChunks.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/message/TestBasicHttpResponse.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/message/TestBasicMessages.java

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/HttpResponse.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/HttpResponse.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/HttpResponse.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/HttpResponse.java Sat Dec 19 23:51:44 2015
@@ -38,6 +38,16 @@ import java.util.Locale;
 public interface HttpResponse extends HttpMessage<HttpEntity> {
 
     /**
+     * Obtains the code in the status line of this response.
+     * The status line can be set using one of the
+     * {@link #setStatusLine setStatusLine} methods,
+     * or it can be initialized in a constructor.
+     *
+     * @return  the status code, or {@code 0} if not yet set
+     */
+    int getCode();
+
+    /**
      * Obtains the status line of this response.
      * The status line can be set using one of the
      * {@link #setStatusLine setStatusLine} methods,

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/DefaultConnectionReuseStrategy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/DefaultConnectionReuseStrategy.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/DefaultConnectionReuseStrategy.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/DefaultConnectionReuseStrategy.java Sat Dec 19 23:51:44 2015
@@ -140,7 +140,7 @@ public class DefaultConnectionReuseStrat
     }
 
     private boolean canResponseHaveBody(final HttpResponse response) {
-        final int status = response.getStatusLine().getStatusCode();
+        final int status = response.getCode();
         return status >= HttpStatus.SC_SUCCESS
             && status != HttpStatus.SC_NO_CONTENT
             && status != HttpStatus.SC_NOT_MODIFIED

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/io/DefaultBHttpClientConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/io/DefaultBHttpClientConnection.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/io/DefaultBHttpClientConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/io/DefaultBHttpClientConnection.java Sat Dec 19 23:51:44 2015
@@ -188,7 +188,7 @@ public class DefaultBHttpClientConnectio
         ensureOpen();
         final HttpResponse response = this.responseParser.parse(this.inbuffer);
         onResponseReceived(response);
-        if (response.getStatusLine().getStatusCode() >= HttpStatus.SC_SUCCESS) {
+        if (response.getCode() >= HttpStatus.SC_SUCCESS) {
             incrementResponseCount();
         }
         return response;

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/io/DefaultBHttpServerConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/io/DefaultBHttpServerConnection.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/io/DefaultBHttpServerConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/io/DefaultBHttpServerConnection.java Sat Dec 19 23:51:44 2015
@@ -158,7 +158,7 @@ public class DefaultBHttpServerConnectio
         ensureOpen();
         this.responseWriter.write(response, this.outbuffer);
         onResponseSubmitted(response);
-        if (response.getStatusLine().getStatusCode() >= HttpStatus.SC_SUCCESS) {
+        if (response.getCode() >= HttpStatus.SC_SUCCESS) {
             incrementResponseCount();
         }
     }

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/io/HttpRequestExecutor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/io/HttpRequestExecutor.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/io/HttpRequestExecutor.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/io/HttpRequestExecutor.java Sat Dec 19 23:51:44 2015
@@ -95,7 +95,7 @@ public class HttpRequestExecutor {
         if ("HEAD".equalsIgnoreCase(request.getRequestLine().getMethod())) {
             return false;
         }
-        final int status = response.getStatusLine().getStatusCode();
+        final int status = response.getCode();
         return status >= HttpStatus.SC_SUCCESS
             && status != HttpStatus.SC_NO_CONTENT
             && status != HttpStatus.SC_NOT_MODIFIED
@@ -142,7 +142,7 @@ public class HttpRequestExecutor {
                     // Don't wait for a 100-continue response forever. On timeout, send the entity.
                     if (conn.isDataAvailable(this.waitForContinue)) {
                         response = conn.receiveResponseHeader();
-                        final int status = response.getStatusLine().getStatusCode();
+                        final int status = response.getCode();
                         if (status < HttpStatus.SC_SUCCESS) {
                             if (status != HttpStatus.SC_CONTINUE) {
                                 throw new ProtocolException("Unexpected response: " + response.getStatusLine());
@@ -165,7 +165,7 @@ public class HttpRequestExecutor {
             }
             conn.flush();
 
-            while (response == null || response.getStatusLine().getStatusCode() < HttpStatus.SC_OK) {
+            while (response == null || response.getCode() < HttpStatus.SC_OK) {
                 response = conn.receiveResponseHeader();
                 if (canResponseHaveBody(request, response)) {
                     conn.receiveResponseEntity(response);

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/io/HttpService.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/io/HttpService.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/io/HttpService.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/io/HttpService.java Sat Dec 19 23:51:44 2015
@@ -180,7 +180,7 @@ public class HttpService {
                     handleException(ex, response);
                 }
             }
-            if (response.getStatusLine().getStatusCode() < HttpStatus.SC_SUCCESS) {
+            if (response.getCode() < HttpStatus.SC_SUCCESS) {
                 // Send 1xx response indicating the server expectations
                 // have been met
                 conn.sendResponseHeader(response);
@@ -238,7 +238,7 @@ public class HttpService {
         if (request != null && "HEAD".equalsIgnoreCase(request.getRequestLine().getMethod())) {
             return false;
         }
-        final int status = response.getStatusLine().getStatusCode();
+        final int status = response.getCode();
         return status >= HttpStatus.SC_SUCCESS
                 && status != HttpStatus.SC_NO_CONTENT
                 && status != HttpStatus.SC_NOT_MODIFIED

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/nio/DefaultNHttpClientConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/nio/DefaultNHttpClientConnection.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/nio/DefaultNHttpClientConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/nio/DefaultNHttpClientConnection.java Sat Dec 19 23:51:44 2015
@@ -176,7 +176,7 @@ public class DefaultNHttpClientConnectio
                     this.response = this.responseParser.parse(this.inbuf, bytesRead == -1);
                 } while (bytesRead > 0 && this.response == null);
                 if (this.response != null) {
-                    if (this.response.getStatusLine().getStatusCode() >= HttpStatus.SC_SUCCESS) {
+                    if (this.response.getCode() >= HttpStatus.SC_SUCCESS) {
                         final long len = this.incomingContentStrategy.determineLength(this.response);
                         if (len != ContentLengthStrategy.UNDEFINED) {
                             this.contentDecoder = createContentDecoder(

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/nio/DefaultNHttpServerConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/nio/DefaultNHttpServerConnection.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/nio/DefaultNHttpServerConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/nio/DefaultNHttpServerConnection.java Sat Dec 19 23:51:44 2015
@@ -266,7 +266,7 @@ public class DefaultNHttpServerConnectio
         this.responseWriter.write(response, this.outbuf);
         this.hasBufferedOutput = this.outbuf.hasData();
 
-        if (response.getStatusLine().getStatusCode() >= HttpStatus.SC_SUCCESS) {
+        if (response.getCode() >= HttpStatus.SC_SUCCESS) {
             this.connMetrics.incrementResponseCount();
             final HttpEntity entity = response.getEntity();
             if (entity != null) {

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/nio/HttpAsyncRequestExecutor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/nio/HttpAsyncRequestExecutor.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/nio/HttpAsyncRequestExecutor.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/nio/HttpAsyncRequestExecutor.java Sat Dec 19 23:51:44 2015
@@ -296,7 +296,7 @@ public class HttpAsyncRequestExecutor im
 
         final HttpResponse response = conn.getHttpResponse();
 
-        final int statusCode = response.getStatusLine().getStatusCode();
+        final int statusCode = response.getCode();
         if (statusCode < HttpStatus.SC_OK) {
             // 1xx intermediate response
             if (statusCode != HttpStatus.SC_CONTINUE) {
@@ -516,7 +516,7 @@ public class HttpAsyncRequestExecutor im
     private boolean canResponseHaveBody(final HttpRequest request, final HttpResponse response) {
 
         final String method = request.getRequestLine().getMethod();
-        final int status = response.getStatusLine().getStatusCode();
+        final int status = response.getCode();
 
         if (method.equalsIgnoreCase("HEAD")) {
             return false;

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/nio/HttpAsyncService.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/nio/HttpAsyncService.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/nio/HttpAsyncService.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/impl/nio/HttpAsyncService.java Sat Dec 19 23:51:44 2015
@@ -414,7 +414,7 @@ public class HttpAsyncService implements
                 }
             }
             final HttpResponse response = outgoing.getResponse();
-            final int status = response.getStatusLine().getStatusCode();
+            final int status = response.getCode();
             if (status >= HttpStatus.SC_OK) {
                 commitFinalResponse(conn, state);
             } else {
@@ -603,7 +603,7 @@ public class HttpAsyncService implements
         if (request != null && "HEAD".equalsIgnoreCase(request.getRequestLine().getMethod())) {
             return false;
         }
-        final int status = response.getStatusLine().getStatusCode();
+        final int status = response.getCode();
         return status >= HttpStatus.SC_SUCCESS
             && status != HttpStatus.SC_NO_CONTENT
             && status != HttpStatus.SC_NOT_MODIFIED
@@ -966,7 +966,7 @@ public class HttpAsyncService implements
 
                 // If there is an incoming request associated with the exchange
                 // the response will be sent early (out of sequence).
-                if (response.getStatusLine().getStatusCode() >= HttpStatus.SC_SUCCESS && this.incoming != null) {
+                if (response.getCode() >= HttpStatus.SC_SUCCESS && this.incoming != null) {
                     this.incoming.setEarlyResponse(true);
                 }
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/message/BasicHttpResponse.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/message/BasicHttpResponse.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/message/BasicHttpResponse.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/message/BasicHttpResponse.java Sat Dec 19 23:51:44 2015
@@ -138,6 +138,12 @@ public class BasicHttpResponse extends A
 
     // non-javadoc, see interface HttpResponse
     @Override
+    public int getCode() {
+        return getStatusLine().getStatusCode();
+    }
+    
+    // non-javadoc, see interface HttpResponse
+    @Override
     public StatusLine getStatusLine() {
         if (this.statusline == null) {
             this.statusline = new BasicStatusLine(

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/protocol/ResponseConnControl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/protocol/ResponseConnControl.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/protocol/ResponseConnControl.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/protocol/ResponseConnControl.java Sat Dec 19 23:51:44 2015
@@ -66,7 +66,7 @@ public class ResponseConnControl impleme
         final HttpCoreContext corecontext = HttpCoreContext.adapt(context);
 
         // Always drop connection after certain type of responses
-        final int status = response.getStatusLine().getStatusCode();
+        final int status = response.getCode();
         if (status == HttpStatus.SC_BAD_REQUEST ||
                 status == HttpStatus.SC_REQUEST_TIMEOUT ||
                 status == HttpStatus.SC_LENGTH_REQUIRED ||

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/protocol/ResponseContent.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/protocol/ResponseContent.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/protocol/ResponseContent.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/protocol/ResponseContent.java Sat Dec 19 23:51:44 2015
@@ -128,7 +128,7 @@ public class ResponseContent implements
                 response.addHeader(new BasicHeader(HttpHeaders.CONTENT_ENCODING, entity.getContentEncoding()));
             }
         } else {
-            final int status = response.getStatusLine().getStatusCode();
+            final int status = response.getCode();
             if (status != HttpStatus.SC_NO_CONTENT
                     && status != HttpStatus.SC_NOT_MODIFIED
                     && status != HttpStatus.SC_RESET_CONTENT) {

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/protocol/ResponseDate.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/protocol/ResponseDate.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/protocol/ResponseDate.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/hc/core5/http/protocol/ResponseDate.java Sat Dec 19 23:51:44 2015
@@ -57,7 +57,7 @@ public class ResponseDate implements Htt
     public void process(final HttpResponse response, final HttpContext context)
             throws HttpException, IOException {
         Args.notNull(response, "HTTP response");
-        final int status = response.getStatusLine().getStatusCode();
+        final int status = response.getCode();
         if ((status >= HttpStatus.SC_OK) &&
             !response.containsHeader(HttpHeaders.DATE)) {
             final String httpdate = DATE_GENERATOR.getCurrentDate();

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestDefaultBHttpClientConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestDefaultBHttpClientConnection.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestDefaultBHttpClientConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestDefaultBHttpClientConnection.java Sat Dec 19 23:51:44 2015
@@ -89,7 +89,7 @@ public class TestDefaultBHttpClientConne
         final HttpResponse response = conn.receiveResponseHeader();
         Assert.assertNotNull(response);
         Assert.assertEquals(HttpVersion.HTTP_1_1, response.getProtocolVersion());
-        Assert.assertEquals(200, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(200, response.getCode());
         Assert.assertTrue(response.containsHeader("User-Agent"));
         Assert.assertEquals(1, conn.getMetrics().getResponseCount());
     }
@@ -108,7 +108,7 @@ public class TestDefaultBHttpClientConne
 
         Assert.assertNotNull(response);
         Assert.assertEquals(HttpVersion.HTTP_1_1, response.getProtocolVersion());
-        Assert.assertEquals(200, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(200, response.getCode());
         Assert.assertTrue(response.containsHeader("Server"));
         Assert.assertEquals(1, conn.getMetrics().getResponseCount());
 
@@ -138,7 +138,7 @@ public class TestDefaultBHttpClientConne
 
         Assert.assertNotNull(response);
         Assert.assertEquals(HttpVersion.HTTP_1_1, response.getProtocolVersion());
-        Assert.assertEquals(200, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(200, response.getCode());
         Assert.assertTrue(response.containsHeader("Server"));
         Assert.assertEquals(1, conn.getMetrics().getResponseCount());
 
@@ -168,7 +168,7 @@ public class TestDefaultBHttpClientConne
 
         Assert.assertNotNull(response);
         Assert.assertEquals(HttpVersion.HTTP_1_1, response.getProtocolVersion());
-        Assert.assertEquals(200, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(200, response.getCode());
         Assert.assertTrue(response.containsHeader("Server"));
         Assert.assertEquals(1, conn.getMetrics().getResponseCount());
 
@@ -189,7 +189,7 @@ public class TestDefaultBHttpClientConne
 
         Assert.assertNotNull(response);
         Assert.assertEquals(HttpVersion.HTTP_1_1, response.getProtocolVersion());
-        Assert.assertEquals(200, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(200, response.getCode());
         Assert.assertTrue(response.containsHeader("Server"));
         Assert.assertEquals(1, conn.getMetrics().getResponseCount());
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestHttpService.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestHttpService.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestHttpService.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/io/TestHttpService.java Sat Dec 19 23:51:44 2015
@@ -95,7 +95,7 @@ public class TestHttpService {
 
         httpservice.handleRequest(conn, context);
 
-        Assert.assertEquals(HttpStatus.SC_NOT_IMPLEMENTED, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(HttpStatus.SC_NOT_IMPLEMENTED, response.getCode());
 
         Assert.assertSame(conn, context.getConnection());
         Assert.assertSame(request, context.getRequest());
@@ -160,7 +160,7 @@ public class TestHttpService {
 
         httpservice.handleRequest(conn, context);
 
-        Assert.assertEquals(HttpStatus.SC_NOT_IMPLEMENTED, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(HttpStatus.SC_NOT_IMPLEMENTED, response.getCode());
 
         Assert.assertSame(conn, context.getConnection());
         Assert.assertSame(request, context.getRequest());
@@ -205,7 +205,7 @@ public class TestHttpService {
 
         httpservice.handleRequest(conn, context);
 
-        Assert.assertEquals(HttpStatus.SC_NOT_IMPLEMENTED, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(HttpStatus.SC_NOT_IMPLEMENTED, response.getCode());
 
         Assert.assertSame(conn, context.getConnection());
         Assert.assertSame(request, context.getRequest());
@@ -266,7 +266,7 @@ public class TestHttpService {
         Assert.assertSame(request, context.getRequest());
         Assert.assertSame(response, context.getResponse());
 
-        Assert.assertEquals(HttpStatus.SC_UNAUTHORIZED, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(HttpStatus.SC_UNAUTHORIZED, response.getCode());
 
         Mockito.verify(conn).sendResponseHeader(response);
         Mockito.verify(httprocessor).process(response, context);
@@ -312,7 +312,7 @@ public class TestHttpService {
         Assert.assertSame(request, context.getRequest());
         Assert.assertSame(response, context.getResponse());
 
-        Assert.assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, response.getCode());
 
         Mockito.verify(conn).sendResponseHeader(response);
         Mockito.verify(httprocessor).process(response, context);
@@ -355,7 +355,7 @@ public class TestHttpService {
         Assert.assertSame(request, context.getRequest());
         Assert.assertSame(error, context.getResponse());
 
-        Assert.assertEquals(HttpStatus.SC_NOT_IMPLEMENTED, error.getStatusLine().getStatusCode());
+        Assert.assertEquals(HttpStatus.SC_NOT_IMPLEMENTED, error.getCode());
 
         Mockito.verify(conn).sendResponseHeader(error);
         Mockito.verify(httprocessor).process(error, context);
@@ -398,7 +398,7 @@ public class TestHttpService {
         Assert.assertSame(request, context.getRequest());
         Assert.assertSame(error, context.getResponse());
 
-        Assert.assertEquals(HttpStatus.SC_HTTP_VERSION_NOT_SUPPORTED, error.getStatusLine().getStatusCode());
+        Assert.assertEquals(HttpStatus.SC_HTTP_VERSION_NOT_SUPPORTED, error.getCode());
 
         Mockito.verify(conn).sendResponseHeader(error);
         Mockito.verify(httprocessor).process(error, context);
@@ -441,7 +441,7 @@ public class TestHttpService {
         Assert.assertSame(request, context.getRequest());
         Assert.assertSame(error, context.getResponse());
 
-        Assert.assertEquals(HttpStatus.SC_BAD_REQUEST, error.getStatusLine().getStatusCode());
+        Assert.assertEquals(HttpStatus.SC_BAD_REQUEST, error.getCode());
 
         Mockito.verify(conn).sendResponseHeader(error);
         Mockito.verify(httprocessor).process(error, context);
@@ -475,7 +475,7 @@ public class TestHttpService {
 
         httpservice.handleRequest(conn, context);
 
-        Assert.assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(HttpStatus.SC_OK, response.getCode());
 
         Assert.assertSame(conn, context.getConnection());
         Assert.assertSame(request, context.getRequest());

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestDefaultNHttpClientConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestDefaultNHttpClientConnection.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestDefaultNHttpClientConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestDefaultNHttpClientConnection.java Sat Dec 19 23:51:44 2015
@@ -490,7 +490,7 @@ public class TestDefaultNHttpClientConne
         final HttpResponse response = responses.getFirst();
         Assert.assertNotNull(response);
         Assert.assertEquals(HttpVersion.HTTP_1_1, response.getStatusLine().getProtocolVersion());
-        Assert.assertEquals(200, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(200, response.getCode());
         Assert.assertEquals("OK", response.getStatusLine().getReasonPhrase());
         final HttpEntity entity = response.getEntity();
         Assert.assertNotNull(entity);
@@ -535,7 +535,7 @@ public class TestDefaultNHttpClientConne
         final HttpResponse response = responses.getFirst();
         Assert.assertNotNull(response);
         Assert.assertEquals(HttpVersion.HTTP_1_1, response.getStatusLine().getProtocolVersion());
-        Assert.assertEquals(200, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(200, response.getCode());
         Assert.assertEquals("OK", response.getStatusLine().getReasonPhrase());
         final HttpEntity entity = response.getEntity();
         Assert.assertNotNull(entity);
@@ -583,7 +583,7 @@ public class TestDefaultNHttpClientConne
         final HttpResponse response = responses.getFirst();
         Assert.assertNotNull(response);
         Assert.assertEquals(HttpVersion.HTTP_1_1, response.getStatusLine().getProtocolVersion());
-        Assert.assertEquals(100, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(100, response.getCode());
         final HttpEntity entity = response.getEntity();
         Assert.assertNull(entity);
     }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestErrorResponseProducer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestErrorResponseProducer.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestErrorResponseProducer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestErrorResponseProducer.java Sat Dec 19 23:51:44 2015
@@ -61,7 +61,7 @@ public class TestErrorResponseProducer {
 
         Assert.assertEquals("keep-alive", res.getFirstHeader(HttpHeaders.CONNECTION).getValue());
         Assert.assertEquals(entity, res.getEntity());
-        Assert.assertEquals(200, res.getStatusLine().getStatusCode());
+        Assert.assertEquals(200, res.getCode());
     }
 
     @Test
@@ -71,7 +71,7 @@ public class TestErrorResponseProducer {
 
         Assert.assertEquals("close", res.getFirstHeader(HttpHeaders.CONNECTION).getValue());
         Assert.assertEquals(entity, res.getEntity());
-        Assert.assertEquals(200, res.getStatusLine().getStatusCode());
+        Assert.assertEquals(200, res.getCode());
     }
 
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestHttpAsyncService.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestHttpAsyncService.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestHttpAsyncService.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/impl/nio/TestHttpAsyncService.java Sat Dec 19 23:51:44 2015
@@ -175,7 +175,7 @@ public class TestHttpAsyncService {
         Assert.assertNotNull(outgoing);
         Assert.assertNotNull(outgoing.getProducer());
         Assert.assertNotNull(outgoing.getResponse());
-        Assert.assertEquals(500, outgoing.getResponse().getStatusLine().getStatusCode());
+        Assert.assertEquals(500, outgoing.getResponse().getCode());
 
         Mockito.verify(this.requestConsumer).failed(httpex);
         Mockito.verify(this.requestConsumer).close();
@@ -504,7 +504,7 @@ public class TestHttpAsyncService {
 
             @Override
             public boolean matches(final Object argument) {
-                final int status = ((HttpResponse) argument).getStatusLine().getStatusCode();
+                final int status = ((HttpResponse) argument).getCode();
                 return status == 100;
             }
 
@@ -723,7 +723,7 @@ public class TestHttpAsyncService {
         Assert.assertEquals(MessageState.ACK_EXPECTED, state.getRequestState());
         Assert.assertEquals(MessageState.READY, state.getResponseState());
         final HttpResponse response = responseProducer.generateResponse();
-        Assert.assertEquals(HttpStatus.SC_CONTINUE, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(HttpStatus.SC_CONTINUE, response.getCode());
 
         Mockito.verify(this.conn).requestOutput();
 
@@ -1085,7 +1085,7 @@ public class TestHttpAsyncService {
 
             @Override
             public boolean matches(final Object argument) {
-                final int status = ((HttpResponse) argument).getStatusLine().getStatusCode();
+                final int status = ((HttpResponse) argument).getCode();
                 return status == 100;
             }
 
@@ -1167,7 +1167,7 @@ public class TestHttpAsyncService {
         Assert.assertNotNull(exchange);
         Assert.assertSame(request, exchange.getRequest());
         Assert.assertNotNull(exchange.getResponse());
-        Assert.assertEquals(200, exchange.getResponse().getStatusLine().getStatusCode());
+        Assert.assertEquals(200, exchange.getResponse().getCode());
     }
 
     @Test
@@ -1193,7 +1193,7 @@ public class TestHttpAsyncService {
         Assert.assertNotNull(outgoing.getProducer());
         final HttpResponse response = outgoing.getResponse();
         Assert.assertNotNull(response);
-        Assert.assertEquals(500, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(500, response.getCode());
 
         Mockito.verify(this.requestHandler, Mockito.never()).handle(Matchers.<HttpRequest>any(),
                 Matchers.<HttpAsyncExchange>any(), Matchers.<HttpContext>any());

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestClientOutOfSequenceResponse.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestClientOutOfSequenceResponse.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestClientOutOfSequenceResponse.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestClientOutOfSequenceResponse.java Sat Dec 19 23:51:44 2015
@@ -94,11 +94,11 @@ public class TestClientOutOfSequenceResp
         }
 
         final HttpResponse response1 = future1.get();
-        Assert.assertEquals(200, response1.getStatusLine().getStatusCode());
+        Assert.assertEquals(200, response1.getCode());
 
         try {
             final HttpResponse response2 = future2.get();
-            Assert.assertEquals(200, response2.getStatusLine().getStatusCode());
+            Assert.assertEquals(200, response2.getCode());
         } catch (final ExecutionException ex) {
             Assert.assertTrue(ex.getCause() instanceof HttpException);
         }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestCustomSSL.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestCustomSSL.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestCustomSSL.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestCustomSSL.java Sat Dec 19 23:51:44 2015
@@ -148,7 +148,7 @@ public class TestCustomSSL {
         final Future<HttpResponse> future = this.client.execute(target, request);
         final HttpResponse response = future.get();
         Assert.assertNotNull(response);
-        Assert.assertEquals(200, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(200, response.getCode());
     }
 
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlers.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlers.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlers.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlers.java Sat Dec 19 23:51:44 2015
@@ -182,7 +182,7 @@ public class TestHttpAsyncHandlers exten
             final Future<HttpResponse> future = queue.remove();
             final HttpResponse response = future.get();
             Assert.assertNotNull(response);
-            Assert.assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
+            Assert.assertEquals(HttpStatus.SC_OK, response.getCode());
         }
     }
 
@@ -304,7 +304,7 @@ public class TestHttpAsyncHandlers exten
             final Future<HttpResponse> future = queue.remove();
             final HttpResponse response = future.get();
             Assert.assertNotNull(response);
-            Assert.assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
+            Assert.assertEquals(HttpStatus.SC_OK, response.getCode());
         }
     }
 
@@ -334,7 +334,7 @@ public class TestHttpAsyncHandlers exten
 
         final HttpResponse response = future.get();
         Assert.assertNotNull(response);
-        Assert.assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(HttpStatus.SC_OK, response.getCode());
     }
 
     @Test
@@ -373,7 +373,7 @@ public class TestHttpAsyncHandlers exten
 
         final HttpResponse response = future.get();
         Assert.assertNotNull(response);
-        Assert.assertEquals(HttpStatus.SC_NOT_IMPLEMENTED, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(HttpStatus.SC_NOT_IMPLEMENTED, response.getCode());
     }
 
     @Test
@@ -459,15 +459,15 @@ public class TestHttpAsyncHandlers exten
 
         final Future<HttpResponse> future1 = queue.remove();
         final HttpResponse response1 = future1.get();
-        Assert.assertEquals(HttpStatus.SC_OK, response1.getStatusLine().getStatusCode());
+        Assert.assertEquals(HttpStatus.SC_OK, response1.getCode());
 
         final Future<HttpResponse> future2 = queue.remove();
         final HttpResponse response2 = future2.get();
-        Assert.assertEquals(HttpStatus.SC_OK, response2.getStatusLine().getStatusCode());
+        Assert.assertEquals(HttpStatus.SC_OK, response2.getCode());
 
         final Future<HttpResponse> future3 = queue.remove();
         final HttpResponse response3 = future3.get();
-        Assert.assertEquals(HttpStatus.SC_EXPECTATION_FAILED, response3.getStatusLine().getStatusCode());
+        Assert.assertEquals(HttpStatus.SC_EXPECTATION_FAILED, response3.getCode());
     }
 
     @Test
@@ -537,7 +537,7 @@ public class TestHttpAsyncHandlers exten
             final Future<HttpResponse> future = queue.remove();
             final HttpResponse response = future.get();
             Assert.assertNotNull(response);
-            Assert.assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
+            Assert.assertEquals(HttpStatus.SC_OK, response.getCode());
         }
     }
 
@@ -601,15 +601,15 @@ public class TestHttpAsyncHandlers exten
 
         final Future<HttpResponse> future1 = queue.remove();
         final HttpResponse response1 = future1.get();
-        Assert.assertEquals(HttpStatus.SC_OK, response1.getStatusLine().getStatusCode());
+        Assert.assertEquals(HttpStatus.SC_OK, response1.getCode());
 
         final Future<HttpResponse> future2 = queue.remove();
         final HttpResponse response2 = future2.get();
-        Assert.assertEquals(HttpStatus.SC_OK, response2.getStatusLine().getStatusCode());
+        Assert.assertEquals(HttpStatus.SC_OK, response2.getCode());
 
         final Future<HttpResponse> future3 = queue.remove();
         final HttpResponse response3 = future3.get();
-        Assert.assertEquals(HttpStatus.SC_EXPECTATION_FAILED, response3.getStatusLine().getStatusCode());
+        Assert.assertEquals(HttpStatus.SC_EXPECTATION_FAILED, response3.getCode());
     }
 
     @Test
@@ -657,7 +657,7 @@ public class TestHttpAsyncHandlers exten
             final HttpContext context = new BasicHttpContext();
             final Future<HttpResponse> future1 = this.client.execute(target, request1, context);
             final HttpResponse response1 = future1.get();
-            Assert.assertEquals(HttpStatus.SC_OK, response1.getStatusLine().getStatusCode());
+            Assert.assertEquals(HttpStatus.SC_OK, response1.getCode());
 
             final BasicHttpRequest request2 = new BasicHttpRequest("POST", createRequestUri("BBBBB", 10));
             final HttpEntity entity2 = new NStringEntity(createExpectedString("BBBBB", 500));
@@ -665,7 +665,7 @@ public class TestHttpAsyncHandlers exten
 
             final Future<HttpResponse> future2 = this.client.execute(target, request2, context);
             final HttpResponse response2 = future2.get();
-            Assert.assertEquals(HttpStatus.SC_EXPECTATION_FAILED, response2.getStatusLine().getStatusCode());
+            Assert.assertEquals(HttpStatus.SC_EXPECTATION_FAILED, response2.getCode());
         }
     }
 
@@ -715,7 +715,7 @@ public class TestHttpAsyncHandlers exten
             final HttpContext context = new BasicHttpContext();
             final Future<HttpResponse> future1 = this.client.execute(target, request1, context);
             final HttpResponse response1 = future1.get();
-            Assert.assertEquals(HttpStatus.SC_OK, response1.getStatusLine().getStatusCode());
+            Assert.assertEquals(HttpStatus.SC_OK, response1.getCode());
 
             final BasicHttpRequest request2 = new BasicHttpRequest("POST", createRequestUri("BBBBB", 10));
             final NStringEntity entity2 = new NStringEntity(createExpectedString("BBBBB", 10));
@@ -724,7 +724,7 @@ public class TestHttpAsyncHandlers exten
 
             final Future<HttpResponse> future2 = this.client.execute(target, request2, context);
             final HttpResponse response2 = future2.get();
-            Assert.assertEquals(HttpStatus.SC_EXPECTATION_FAILED, response2.getStatusLine().getStatusCode());
+            Assert.assertEquals(HttpStatus.SC_EXPECTATION_FAILED, response2.getCode());
         }
     }
 
@@ -788,7 +788,7 @@ public class TestHttpAsyncHandlers exten
             final HttpContext context = new BasicHttpContext();
             final Future<HttpResponse> future1 = this.client.execute(target, request1, context);
             final HttpResponse response1 = future1.get();
-            Assert.assertEquals(HttpStatus.SC_OK, response1.getStatusLine().getStatusCode());
+            Assert.assertEquals(HttpStatus.SC_OK, response1.getCode());
 
             final BasicHttpRequest request2 = new BasicHttpRequest("POST", createRequestUri("BBBBB", 10));
             final NStringEntity entity2 = new NStringEntity(createExpectedString("BBBBB", 10));
@@ -797,7 +797,7 @@ public class TestHttpAsyncHandlers exten
 
             final Future<HttpResponse> future2 = this.client.execute(target, request2, context);
             final HttpResponse response2 = future2.get();
-            Assert.assertEquals(HttpStatus.SC_EXPECTATION_FAILED, response2.getStatusLine().getStatusCode());
+            Assert.assertEquals(HttpStatus.SC_EXPECTATION_FAILED, response2.getCode());
         }
     }
 
@@ -847,7 +847,7 @@ public class TestHttpAsyncHandlers exten
             final Future<HttpResponse> future = queue.remove();
             final HttpResponse response = future.get();
             Assert.assertNotNull(response);
-            Assert.assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, response.getStatusLine().getStatusCode());
+            Assert.assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, response.getCode());
         }
     }
 
@@ -872,7 +872,7 @@ public class TestHttpAsyncHandlers exten
             final Future<HttpResponse> future = queue.remove();
             final HttpResponse response = future.get();
             Assert.assertNotNull(response);
-            Assert.assertEquals(HttpStatus.SC_NOT_IMPLEMENTED, response.getStatusLine().getStatusCode());
+            Assert.assertEquals(HttpStatus.SC_NOT_IMPLEMENTED, response.getCode());
         }
     }
 
@@ -933,12 +933,12 @@ public class TestHttpAsyncHandlers exten
         final Future<HttpResponse> future1 = this.client.execute(target, request1);
         final HttpResponse response1 = future1.get();
         Assert.assertNotNull(response1);
-        Assert.assertEquals(200, response1.getStatusLine().getStatusCode());
+        Assert.assertEquals(200, response1.getCode());
         final BasicHttpRequest request2 = new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1);
         final Future<HttpResponse> future2 = this.client.execute(target, request2);
         final HttpResponse response2 = future2.get();
         Assert.assertNotNull(response2);
-        Assert.assertEquals(400, response2.getStatusLine().getStatusCode());
+        Assert.assertEquals(400, response2.getCode());
     }
 
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlersBrokenExpectContinue.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlersBrokenExpectContinue.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlersBrokenExpectContinue.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlersBrokenExpectContinue.java Sat Dec 19 23:51:44 2015
@@ -142,7 +142,7 @@ public class TestHttpAsyncHandlersBroken
             final HttpContext context = new BasicHttpContext();
             final Future<HttpResponse> future1 = this.client.execute(target, request1, context);
             final HttpResponse response1 = future1.get();
-            Assert.assertEquals(HttpStatus.SC_OK, response1.getStatusLine().getStatusCode());
+            Assert.assertEquals(HttpStatus.SC_OK, response1.getCode());
 
             final BasicHttpRequest request2 = new BasicHttpRequest("POST", createRequestUri("BBBBB", 10));
             final NStringEntity entity2 = new NStringEntity(createExpectedString("BBBBB", 1000));
@@ -151,7 +151,7 @@ public class TestHttpAsyncHandlersBroken
 
             final Future<HttpResponse> future2 = this.client.execute(target, request2, context);
             final HttpResponse response2 = future2.get();
-            Assert.assertEquals(HttpStatus.SC_OK, response2.getStatusLine().getStatusCode());
+            Assert.assertEquals(HttpStatus.SC_OK, response2.getCode());
         }
     }
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlersPipelining.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlersPipelining.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlersPipelining.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestHttpAsyncHandlersPipelining.java Sat Dec 19 23:51:44 2015
@@ -168,7 +168,7 @@ public class TestHttpAsyncHandlersPipeli
             Assert.assertNotNull(responses);
             Assert.assertEquals(3, responses.size());
             for (final HttpResponse response: responses) {
-                Assert.assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
+                Assert.assertEquals(HttpStatus.SC_OK, response.getCode());
                 Assert.assertEquals(expectedPattern, EntityUtils.toString(response.getEntity()));
             }
         }
@@ -202,7 +202,7 @@ public class TestHttpAsyncHandlersPipeli
             Assert.assertNotNull(responses);
             Assert.assertEquals(3, responses.size());
             for (final HttpResponse response: responses) {
-                Assert.assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
+                Assert.assertEquals(HttpStatus.SC_OK, response.getCode());
             }
         }
     }
@@ -246,7 +246,7 @@ public class TestHttpAsyncHandlersPipeli
             Assert.assertNotNull(responses);
             Assert.assertEquals(3, responses.size());
             for (final HttpResponse response: responses) {
-                Assert.assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
+                Assert.assertEquals(HttpStatus.SC_OK, response.getCode());
                 Assert.assertEquals(expectedPattern, EntityUtils.toString(response.getEntity()));
             }
         }
@@ -334,7 +334,7 @@ public class TestHttpAsyncHandlersPipeli
             Assert.assertNotNull(responses);
             Assert.assertEquals(3, responses.size());
             for (final HttpResponse response: responses) {
-                Assert.assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
+                Assert.assertEquals(HttpStatus.SC_OK, response.getCode());
             }
             Assert.assertEquals(expectedPattern1, EntityUtils.toString(responses.get(0).getEntity()));
             Assert.assertEquals(expectedPattern2, EntityUtils.toString(responses.get(1).getEntity()));

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestSyncHttp.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestSyncHttp.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestSyncHttp.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestSyncHttp.java Sat Dec 19 23:51:44 2015
@@ -575,9 +575,9 @@ public class TestSyncHttp {
                 EntityUtils.consume(responseEntity);
 
                 if (r >= 2) {
-                    Assert.assertEquals(HttpStatus.SC_EXPECTATION_FAILED, response.getStatusLine().getStatusCode());
+                    Assert.assertEquals(HttpStatus.SC_EXPECTATION_FAILED, response.getCode());
                 } else {
-                    Assert.assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
+                    Assert.assertEquals(HttpStatus.SC_OK, response.getCode());
                 }
 
                 if (!conn.isConsistent() || !this.client.keepAlive(post, response)) {
@@ -787,7 +787,7 @@ public class TestSyncHttp {
             post.setEntity(null);
 
             final HttpResponse response = this.client.execute(post, host, conn);
-            Assert.assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
+            Assert.assertEquals(HttpStatus.SC_OK, response.getCode());
             final byte[] received = EntityUtils.toByteArray(response.getEntity());
             Assert.assertEquals(0, received.length);
         } finally {
@@ -836,7 +836,7 @@ public class TestSyncHttp {
                     new RequestExpectContinue()));
 
             final HttpResponse response = this.client.execute(post, host, conn);
-            Assert.assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
+            Assert.assertEquals(HttpStatus.SC_OK, response.getCode());
             final byte[] received = EntityUtils.toByteArray(response.getEntity());
             Assert.assertEquals(0, received.length);
         } finally {
@@ -895,7 +895,7 @@ public class TestSyncHttp {
                     new RequestExpectContinue()));
 
             final HttpResponse response = this.client.execute(post, host, conn);
-            Assert.assertEquals(HttpStatus.SC_NOT_IMPLEMENTED, response.getStatusLine().getStatusCode());
+            Assert.assertEquals(HttpStatus.SC_NOT_IMPLEMENTED, response.getCode());
         } finally {
             conn.close();
             this.server.shutdown();
@@ -977,11 +977,11 @@ public class TestSyncHttp {
         try {
             final BasicHttpRequest get1 = new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_0);
             final HttpResponse response1 = this.client.execute(get1, host, conn);
-            Assert.assertEquals(200, response1.getStatusLine().getStatusCode());
+            Assert.assertEquals(200, response1.getCode());
             EntityUtils.consume(response1.getEntity());
             final BasicHttpRequest get2 = new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1);
             final HttpResponse response2 = this.client.execute(get2, host, conn);
-            Assert.assertEquals(400, response2.getStatusLine().getStatusCode());
+            Assert.assertEquals(400, response2.getCode());
             EntityUtils.consume(response2.getEntity());
 
         } finally {

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestTruncatedChunks.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestTruncatedChunks.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestTruncatedChunks.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/integration/TestTruncatedChunks.java Sat Dec 19 23:51:44 2015
@@ -262,7 +262,7 @@ public class TestTruncatedChunks extends
 
         final HttpResponse response = future.get();
         Assert.assertNotNull(response);
-        Assert.assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(HttpStatus.SC_OK, response.getCode());
         Assert.assertEquals(new String(GARBAGE, StandardCharsets.ISO_8859_1.name()),
                 EntityUtils.toString(response.getEntity()));
     }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/message/TestBasicHttpResponse.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/message/TestBasicHttpResponse.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/message/TestBasicHttpResponse.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/message/TestBasicHttpResponse.java Sat Dec 19 23:51:44 2015
@@ -41,7 +41,7 @@ public class TestBasicHttpResponse {
         final BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
         Assert.assertEquals(HttpVersion.HTTP_1_1, response.getProtocolVersion());
         Assert.assertEquals(HttpVersion.HTTP_1_1, response.getStatusLine().getProtocolVersion());
-        Assert.assertEquals(200, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(200, response.getCode());
         Assert.assertEquals("OK", response.getStatusLine().getReasonPhrase());
     }
 
@@ -49,27 +49,27 @@ public class TestBasicHttpResponse {
     public void testStatusLineMutation() {
         final BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
         Assert.assertEquals(HttpVersion.HTTP_1_1, response.getStatusLine().getProtocolVersion());
-        Assert.assertEquals(200, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(200, response.getCode());
         Assert.assertEquals("OK", response.getStatusLine().getReasonPhrase());
         response.setReasonPhrase("Kind of OK");
         Assert.assertEquals(HttpVersion.HTTP_1_1, response.getStatusLine().getProtocolVersion());
-        Assert.assertEquals(200, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(200, response.getCode());
         Assert.assertEquals("Kind of OK", response.getStatusLine().getReasonPhrase());
         response.setStatusCode(299);
         Assert.assertEquals(HttpVersion.HTTP_1_1, response.getStatusLine().getProtocolVersion());
-        Assert.assertEquals(299, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(299, response.getCode());
         Assert.assertEquals(null, response.getStatusLine().getReasonPhrase());
         response.setStatusLine(HttpVersion.HTTP_1_0, 298);
         Assert.assertEquals(HttpVersion.HTTP_1_0, response.getStatusLine().getProtocolVersion());
-        Assert.assertEquals(298, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(298, response.getCode());
         Assert.assertEquals(null, response.getStatusLine().getReasonPhrase());
         response.setStatusLine(HttpVersion.HTTP_1_1, 200, "OK");
         Assert.assertEquals(HttpVersion.HTTP_1_1, response.getStatusLine().getProtocolVersion());
-        Assert.assertEquals(200, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(200, response.getCode());
         Assert.assertEquals("OK", response.getStatusLine().getReasonPhrase());
         response.setStatusLine(new BasicStatusLine(HttpVersion.HTTP_1_0, 500, "Boom"));
         Assert.assertEquals(HttpVersion.HTTP_1_0, response.getStatusLine().getProtocolVersion());
-        Assert.assertEquals(500, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(500, response.getCode());
         Assert.assertEquals("Boom", response.getStatusLine().getReasonPhrase());
     }
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/message/TestBasicMessages.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/message/TestBasicMessages.java?rev=1720981&r1=1720980&r2=1720981&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/message/TestBasicMessages.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/hc/core5/http/message/TestBasicMessages.java Sat Dec 19 23:51:44 2015
@@ -47,13 +47,13 @@ public class TestBasicMessages {
         HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_0, HttpStatus.SC_BAD_REQUEST, "Bad Request");
         Assert.assertNotNull(response.getProtocolVersion());
         Assert.assertEquals(HttpVersion.HTTP_1_0, response.getProtocolVersion());
-        Assert.assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(HttpStatus.SC_BAD_REQUEST, response.getCode());
 
         response = new BasicHttpResponse(new BasicStatusLine(
                 HttpVersion.HTTP_1_1, HttpStatus.SC_INTERNAL_SERVER_ERROR, "whatever"));
         Assert.assertNotNull(response.getProtocolVersion());
         Assert.assertEquals(HttpVersion.HTTP_1_1, response.getProtocolVersion());
-        Assert.assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, response.getCode());
         Assert.assertEquals("whatever", response.getStatusLine().getReasonPhrase());
     }
 
@@ -62,18 +62,18 @@ public class TestBasicMessages {
         HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK");
         Assert.assertNotNull(response.getProtocolVersion());
         Assert.assertNotNull(response.getStatusLine());
-        Assert.assertEquals(200, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(200, response.getCode());
 
         response = new BasicHttpResponse(HttpVersion.HTTP_1_0, HttpStatus.SC_BAD_REQUEST, "Bad Request");
         Assert.assertNotNull(response.getProtocolVersion());
         Assert.assertEquals(HttpVersion.HTTP_1_0, response.getProtocolVersion());
-        Assert.assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(HttpStatus.SC_BAD_REQUEST, response.getCode());
 
         response = new BasicHttpResponse(new BasicStatusLine(
                 HttpVersion.HTTP_1_1, HttpStatus.SC_INTERNAL_SERVER_ERROR, "whatever"));
         Assert.assertNotNull(response.getProtocolVersion());
         Assert.assertEquals(HttpVersion.HTTP_1_1, response.getProtocolVersion());
-        Assert.assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, response.getStatusLine().getStatusCode());
+        Assert.assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, response.getCode());
         Assert.assertEquals("whatever", response.getStatusLine().getReasonPhrase());
 
         response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");



Mime
View raw message