コード例 #1
0
  public void testBasics() throws Exception {
    String s = "Message content";
    StringEntity httpentity = new StringEntity(s, HTTP.ISO_8859_1);
    httpentity.setContentType(HTTP.PLAIN_TEXT_TYPE);
    httpentity.setContentEncoding(HTTP.IDENTITY_CODING);
    HttpEntityWrapper wrapped = new HttpEntityWrapper(httpentity);

    assertEquals(httpentity.getContentLength(), wrapped.getContentLength());
    assertEquals(httpentity.getContentType(), wrapped.getContentType());
    assertEquals(httpentity.getContentEncoding(), wrapped.getContentEncoding());
    assertEquals(httpentity.isChunked(), wrapped.isChunked());
    assertEquals(httpentity.isRepeatable(), wrapped.isRepeatable());
    assertEquals(httpentity.isStreaming(), wrapped.isStreaming());
    assertNotNull(wrapped.getContent());
  }