You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2021/08/31 13:46:23 UTC

[httpcomponents-client] branch 5.1.x updated (75a694c -> d234e55)

This is an automated email from the ASF dual-hosted git repository.

olegk pushed a change to branch 5.1.x
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git.


 discard 75a694c  HTTPCLIENT-2173: test case for identity transfer encoded response messages
     new d234e55  HTTPCLIENT-2173: test case for identity transfer encoded response messages

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (75a694c)
            \
             N -- N -- N   refs/heads/5.1.x (d234e55)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../test/java/org/apache/hc/client5/testing/async/TestHttp1Async.java    | 1 -
 1 file changed, 1 deletion(-)

[httpcomponents-client] 01/01: HTTPCLIENT-2173: test case for identity transfer encoded response messages

Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

olegk pushed a commit to branch 5.1.x
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git

commit d234e555dbd5d94016ccd5c46f456514e5b89720
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Tue Aug 31 15:38:51 2021 +0200

    HTTPCLIENT-2173: test case for identity transfer encoded response messages
---
 .../async/AbstractHttpAsyncFundamentalsTest.java   |  6 ++--
 .../hc/client5/testing/async/TestHttp1Async.java   | 32 +++++++++++++++++++++-
 2 files changed, 34 insertions(+), 4 deletions(-)

diff --git a/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/async/AbstractHttpAsyncFundamentalsTest.java b/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/async/AbstractHttpAsyncFundamentalsTest.java
index a7e8cd6..ca7b494 100644
--- a/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/async/AbstractHttpAsyncFundamentalsTest.java
+++ b/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/async/AbstractHttpAsyncFundamentalsTest.java
@@ -62,7 +62,7 @@ public abstract class AbstractHttpAsyncFundamentalsTest<T extends CloseableHttpA
     }
 
     @Test
-    public void testSequenctialGetRequests() throws Exception {
+    public void testSequentialGetRequests() throws Exception {
         final HttpHost target = start();
         for (int i = 0; i < 3; i++) {
             final Future<SimpleHttpResponse> future = httpclient.execute(
@@ -80,7 +80,7 @@ public abstract class AbstractHttpAsyncFundamentalsTest<T extends CloseableHttpA
     }
 
     @Test
-    public void testSequenctialHeadRequests() throws Exception {
+    public void testSequentialHeadRequests() throws Exception {
         final HttpHost target = start();
         for (int i = 0; i < 3; i++) {
             final Future<SimpleHttpResponse> future = httpclient.execute(
@@ -97,7 +97,7 @@ public abstract class AbstractHttpAsyncFundamentalsTest<T extends CloseableHttpA
     }
 
     @Test
-    public void testSequenctialPostRequests() throws Exception {
+    public void testSequentialPostRequests() throws Exception {
         final HttpHost target = start();
         for (int i = 0; i < 3; i++) {
             final byte[] b1 = new byte[1024];
diff --git a/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/async/TestHttp1Async.java b/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/async/TestHttp1Async.java
index 944e284..d5d18a1 100644
--- a/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/async/TestHttp1Async.java
+++ b/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/async/TestHttp1Async.java
@@ -28,6 +28,8 @@ package org.apache.hc.client5.testing.async;
 
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.LinkedList;
+import java.util.Queue;
 import java.util.Random;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
@@ -50,6 +52,8 @@ import org.apache.hc.core5.http.HttpHeaders;
 import org.apache.hc.core5.http.HttpHost;
 import org.apache.hc.core5.http.URIScheme;
 import org.apache.hc.core5.http.config.Http1Config;
+import org.apache.hc.core5.http.protocol.DefaultHttpProcessor;
+import org.apache.hc.core5.http.protocol.RequestValidateHost;
 import org.hamcrest.CoreMatchers;
 import org.junit.Assert;
 import org.junit.Rule;
@@ -122,7 +126,7 @@ public class TestHttp1Async extends AbstractHttpAsyncFundamentalsTest<CloseableH
     }
 
     @Test
-    public void testSequenctialGetRequestsCloseConnection() throws Exception {
+    public void testSequentialGetRequestsCloseConnection() throws Exception {
         final HttpHost target = start();
         for (int i = 0; i < 3; i++) {
             final Future<SimpleHttpResponse> future = httpclient.execute(
@@ -141,6 +145,32 @@ public class TestHttp1Async extends AbstractHttpAsyncFundamentalsTest<CloseableH
     }
 
     @Test
+    public void testGetRequestsIdentityEncodingResponse() throws Exception {
+        final HttpHost target = start(new DefaultHttpProcessor(new RequestValidateHost()), Http1Config.DEFAULT);
+
+        final int reqCount = 20;
+
+        final Queue<Future<SimpleHttpResponse>> queue = new LinkedList<>();
+        for (int i = 0; i < reqCount; i++) {
+            final Future<SimpleHttpResponse> future = httpclient.execute(
+                    SimpleRequestBuilder.get()
+                            .setHttpHost(target)
+                            .setPath("/random/2048")
+                            .build(), null);
+            queue.add(future);
+        }
+        while (!queue.isEmpty()) {
+            final Future<SimpleHttpResponse> future = queue.remove();
+            final SimpleHttpResponse response = future.get();
+            Assert.assertThat(response, CoreMatchers.notNullValue());
+            Assert.assertThat(response.getCode(), CoreMatchers.equalTo(200));
+            final String body = response.getBodyText();
+            Assert.assertThat(body, CoreMatchers.notNullValue());
+            Assert.assertThat(body.length(), CoreMatchers.equalTo(2048));
+        }
+    }
+
+    @Test
     public void testConcurrentPostsOverMultipleConnections() throws Exception {
         connManager.setDefaultMaxPerRoute(20);
         connManager.setMaxTotal(100);