Code example for BasicHeader

0
        super(testName);
    } 
 
    public void testContentType() throws Exception { 
        HttpEntityMockup httpentity = new HttpEntityMockup();
        httpentity.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, HTTP.PLAIN_TEXT_TYPE));
        assertEquals(HTTP.CONTENT_TYPE, httpentity.getContentType().getName());
        assertEquals(HTTP.PLAIN_TEXT_TYPE, httpentity.getContentType().getValue());
 
        httpentity.setContentType(HTTP.PLAIN_TEXT_TYPE);
        assertEquals(HTTP.CONTENT_TYPE, httpentity.getContentType().getName());
        assertEquals(HTTP.PLAIN_TEXT_TYPE, httpentity.getContentType().getValue());
 
        httpentity.setContentType((Header)null);
        assertNull(httpentity.getContentType());
        httpentity.setContentType((String)null);
        assertNull(httpentity.getContentType());
    } 
 
    public void testContentEncoding() throws Exception {