public void testHandlerExplicitFlushAndThrow() throws Exception
{
server.setHandler(new ExplicitFlushHandler(true));
server.start();
SimpleHttpResponse response = executeRequest();
// Since the 200 was committed, the 500 did not get the chance to be written
assertThat("response code is 200", response.getCode(), is("200"));
assertThat("response body is foobar", response.getBody(), is("foobar"));
if (!"HTTP/1.0".equals(httpVersion))
assertHeader(response, "transfer-encoding", "chunked");
}