Author: markt Date: Mon Apr 28 13:43:25 2014 New Revision: 1590635 URL: http://svn.apache.org/r1590635 Log: Increase length of text written so expected exception is triggered on client disconnect with NIO2.
Modified: tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java Modified: tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java?rev=1590635&r1=1590634&r2=1590635&view=diff ============================================================================== --- tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java (original) +++ tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java Mon Apr 28 13:43:25 2014 @@ -40,6 +40,17 @@ import org.apache.tomcat.util.buf.ByteCh public class TestCoyoteAdapter extends TomcatBaseTest { + public static final String TEXT_1K; + public static final byte[] BYTES_1K; + + static { + StringBuilder sb = new StringBuilder(1024); + for (int i = 0; i < 64; i++) { + sb.append("0123456789ABCDEF"); + } + TEXT_1K = sb.toString(); + BYTES_1K = TEXT_1K.getBytes(StandardCharsets.UTF_8); + } @Test public void testPathParmsRootNone() throws Exception { pathParamTest("/", "none"); @@ -295,7 +306,9 @@ public class TestCoyoteAdapter extends T client.sendRequest(); for (int i = 0; i < 10; i++) { - System.err.println(client.readLine()); + String line = client.readLine(); + if (line != null && line.length() > 20) + System.err.println(line.subSequence(0, 20) + "..."); } client.disconnect(); @@ -347,7 +360,7 @@ public class TestCoyoteAdapter extends T public void run() { for (int i = 0; i < 20; i++) { try { - os.write("TEST".getBytes(StandardCharsets.UTF_8)); + os.write(BYTES_1K); os.flush(); Thread.sleep(1000); } catch (Exception e) { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org