add test for gzip streaming and flushing write

This commit is contained in:
Jesse McConnell 2013-06-28 15:39:12 -05:00
parent c089335f51
commit f262dce23b
2 changed files with 7 additions and 2 deletions

View File

@ -117,7 +117,11 @@ public class GzipTester
// Assert the response headers
Assert.assertThat("Response.method",response.getMethod(),nullValue());
// Assert.assertThat("Response.status",response.getStatus(),is(HttpServletResponse.SC_OK));
Assert.assertThat("Response.header[Content-Length]",response.getHeader("Content-Length"),notNullValue());
if ( response.getHeader("X-Testing-Skip-Content-Length") == null )
{
Assert.assertThat("Response.header[Content-Length]",response.getHeader("Content-Length"),notNullValue());
}
int qindex = compressionType.indexOf(";");
if (qindex < 0)
Assert.assertThat("Response.header[Content-Encoding]",response.getHeader("Content-Encoding"),containsString(compressionType));

View File

@ -54,7 +54,8 @@ public class TestServletStreamLengthTypeWriteWithFlush extends TestDirContentSer
ServletOutputStream out = response.getOutputStream();
response.setContentLength(dataBytes.length);
response.setHeader("X-Testing-Skip-Content-Length","true");
if (fileName.endsWith("txt"))
response.setContentType("text/plain");
else if (fileName.endsWith("mp3"))