/**
   * Test case for new lines at the start of a request. RFC2616 does not permit any, but Tomcat is
   * tolerant of them if they are present.
   */
  @Test
  public void testNewLines() {

    NewLinesClient client = new NewLinesClient(10);

    client.doRequest();
    assertTrue(client.isResponse200());
    assertTrue(client.isResponseBodyOK());
  }
  /**
   * Test case for new lines at the start of a request. RFC2616 does not permit any, but Tomcat is
   * tolerant of them if they are present.
   */
  @Test
  public void testNewLinesExcessive() {

    NewLinesClient client = new NewLinesClient(10000);

    // If the connection is closed fast enough, writing the request will
    // fail and the response won't be read.
    Exception e = client.doRequest();
    if (e == null) {
      assertTrue(client.isResponse400());
    }
    assertFalse(client.isResponseBodyOK());
  }