From: fhanik Date: Tue, 1 Mar 2011 20:34:00 +0000 (+0000) Subject: Make sure we also validate the content that is sent and received X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=6c2f5b12894a391039b680f6f37437bdb1911ec5;p=tomcat7.0 Make sure we also validate the content that is sent and received git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1076015 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/test/org/apache/tomcat/util/net/TestClientCert.java b/test/org/apache/tomcat/util/net/TestClientCert.java index 9fb465a7a..459c8c245 100644 --- a/test/org/apache/tomcat/util/net/TestClientCert.java +++ b/test/org/apache/tomcat/util/net/TestClientCert.java @@ -18,6 +18,7 @@ package org.apache.tomcat.util.net; import java.io.IOException; import java.io.InputStream; +import java.util.Arrays; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; @@ -40,7 +41,8 @@ import org.apache.tomcat.util.buf.ByteChunk; * repository since not all of them are AL2 licensed. */ public class TestClientCert extends TomcatBaseTest { - + public static final byte DATA = (byte)33; + public void testClientCertGet() throws Exception { // Unprotected resource ByteChunk res = @@ -74,6 +76,7 @@ public class TestClientCert extends TomcatBaseTest { throws Exception { byte[] body = new byte[bodySize]; + Arrays.fill(body, DATA); // Unprotected resource ByteChunk res = postUrl(body, @@ -163,16 +166,23 @@ public class TestClientCert extends TomcatBaseTest { int len = 0; byte[] buffer = new byte[4096]; InputStream is = req.getInputStream(); + boolean contentOK = true; while (len > -1) { len = is.read(buffer); read = read + len; + for (int i=0; i