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

remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
     new fe924f1  Use a BAOS
fe924f1 is described below

commit fe924f1de1f7bc92e964ff36ae6650ee7f1ab247
Author: remm <r...@apache.org>
AuthorDate: Wed Mar 4 14:31:05 2020 +0100

    Use a BAOS
    
    Attempt to make the test avoid frame buffering.
    Remove HTTP header output.
---
 test/org/apache/coyote/http2/Http2TestBase.java   |  3 ---
 test/org/apache/coyote/http2/TestLargeUpload.java | 11 ++++++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/test/org/apache/coyote/http2/Http2TestBase.java 
b/test/org/apache/coyote/http2/Http2TestBase.java
index f622569..3f65876 100644
--- a/test/org/apache/coyote/http2/Http2TestBase.java
+++ b/test/org/apache/coyote/http2/Http2TestBase.java
@@ -648,9 +648,6 @@ public abstract class Http2TestBase extends TomcatBaseTest {
 
     boolean readHttpUpgradeResponse() throws IOException {
         String[] responseHeaders = readHttpResponseHeaders();
-        for (String header : responseHeaders) {
-            System.out.println("HEADER: " + header);
-        }
 
         if (responseHeaders.length < 3) {
             return false;
diff --git a/test/org/apache/coyote/http2/TestLargeUpload.java 
b/test/org/apache/coyote/http2/TestLargeUpload.java
index 1e657af..ce366ce 100644
--- a/test/org/apache/coyote/http2/TestLargeUpload.java
+++ b/test/org/apache/coyote/http2/TestLargeUpload.java
@@ -16,6 +16,7 @@
  */
 package org.apache.coyote.http2;
 
+import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.nio.ByteBuffer;
@@ -44,8 +45,8 @@ public class TestLargeUpload extends Http2TestBase {
 
         ((AbstractHttp11Protocol<?>) 
http2Protocol.getHttp11Protocol()).setAllowedTrailerHeaders(TRAILER_HEADER_NAME);
 
-        int bodySize = 16384;
-        int bodyCount = 20;
+        int bodySize = 15000;
+        int bodyCount = 100;
 
         byte[] headersFrameHeader = new byte[9];
         ByteBuffer headersPayload = ByteBuffer.allocate(128);
@@ -60,9 +61,13 @@ public class TestLargeUpload extends Http2TestBase {
         // Write the headers
         writeFrame(headersFrameHeader, headersPayload);
         // Body
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
         for (int i = 0; i < bodyCount; i++) {
-            writeFrame(dataFrameHeader, dataPayload);
+            baos.write(dataFrameHeader);
+            baos.write(dataPayload.array(), dataPayload.arrayOffset(), 
dataPayload.limit());
         }
+        os.write(baos.toByteArray());
+        os.flush();
 
         // Trailers
         writeFrame(trailerFrameHeader, trailerPayload);


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to