Пример #1
0
 @Test
 public void testTrailingHeaders() throws Exception {
   response.closeChunks();
   buffer = new StringBuffer();
   response.addTrailingHeader("Some-Header", "someValue");
   assertEquals("Some-Header: someValue\r\n", buffer.toString());
   response.closeTrailer();
   response.close();
   assertTrue(closed);
 }
Пример #2
0
 @Test
 public void testClosingInSteps() throws Exception {
   assertFalse(closed);
   buffer = new StringBuffer();
   response.closeChunks();
   assertEquals("0\r\n", buffer.toString());
   assertFalse(closed);
   buffer = new StringBuffer();
   response.closeTrailer();
   assertEquals("\r\n", buffer.toString());
   assertFalse(closed);
   response.close();
   assertTrue(closed);
 }