add test for gzip streaming and flushing write
This commit is contained in:
parent
c089335f51
commit
f262dce23b
|
@ -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));
|
||||
|
|
|
@ -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"))
|
||||
|
|
Loading…
Reference in New Issue