@Before public void setUp() throws Exception { buffer = new StringBuffer(); response = new ChunkedResponse("html"); response.readyToSend(this); }
@Test public void xmlHeaders() throws Exception { response = new ChunkedResponse("xml"); response.readyToSend(this); assertTrue(response.isReadyToSend()); assertTrue(response.isReadyToSend()); String text = buffer.toString(); assertHasRegexp("Transfer-Encoding: chunked", text); assertTrue(text.startsWith("HTTP/1.1 200 OK\r\n")); assertHasRegexp("Content-Type: text/xml", text); }