tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1075719 - /tomcat/trunk/test/org/apache/catalina/startup/TestTomcat.java
Date Tue, 01 Mar 2011 09:00:01 GMT
Author: markt
Date: Tue Mar  1 09:00:01 2011
New Revision: 1075719

URL: http://svn.apache.org/viewvc?rev=1075719&view=rev
Log:
Better fix, we actually need to read 20 byres for the test to pass

Modified:
    tomcat/trunk/test/org/apache/catalina/startup/TestTomcat.java

Modified: tomcat/trunk/test/org/apache/catalina/startup/TestTomcat.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/startup/TestTomcat.java?rev=1075719&r1=1075718&r2=1075719&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/startup/TestTomcat.java (original)
+++ tomcat/trunk/test/org/apache/catalina/startup/TestTomcat.java Tue Mar  1 09:00:01 2011
@@ -110,11 +110,15 @@ public class TestTomcat extends TomcatBa
                 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*/}



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


Mime
View raw message