コード例 #1
0
  @Before
  public void setUp() throws Exception {
    buffer = new StringBuffer();

    response = new ChunkedResponse("html");
    response.readyToSend(this);
  }
コード例 #2
0
 @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);
 }