From: markt Date: Tue, 1 Mar 2011 09:00:01 +0000 (+0000) Subject: Better fix, we actually need to read 20 byres for the test to pass X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=6fb605f8a0eb64f78e5293f504985d101a590b8c;p=tomcat7.0 Better fix, we actually need to read 20 byres for the test to pass git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1075719 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/test/org/apache/catalina/startup/TestTomcat.java b/test/org/apache/catalina/startup/TestTomcat.java index 1afb5ba60..ee65d9ebf 100644 --- a/test/org/apache/catalina/startup/TestTomcat.java +++ b/test/org/apache/catalina/startup/TestTomcat.java @@ -110,11 +110,15 @@ public class TestTomcat extends TomcatBaseTest { InputStream is = null; Reader reader = null; char cbuf[] = new char[20]; + int read = 0; try { - is = conn.getInputStream(); - reader = new InputStreamReader(is); - int len = reader.read(cbuf); - res.getWriter().write(cbuf, 0, len); + while (read < 20) { + is = conn.getInputStream(); + reader = new InputStreamReader(is); + int len = reader.read(cbuf, read, cbuf.length - read); + res.getWriter().write(cbuf, 0, len); + read = read + len; + } } finally { if (reader != null) { try { reader.close(); } catch(IOException ioe) {/*Ignore*/}