@Test
public void testInvalidHeaderParsing() throws Exception {

    final CharArrayBuffer buffer = new CharArrayBuffer(16);
    buffer.clear();
    buffer.append("");
    try {
        this.parser.parseHeader(buffer);
        Assert.fail("ParseException should have been thrown");
    } catch (final ParseException e) {
        //expected
    }
    buffer.clear();
    buffer.append("blah");
    try {
        this.parser.parseHeader(buffer);
        Assert.fail("ParseException should have been thrown");
    } catch (final ParseException e) {
        //expected
    }
    buffer.clear();
    buffer.append(":");
    try {
        this.parser.parseHeader(buffer);
        Assert.fail("ParseException should have been thrown");
    } catch (final ParseException e) {
        //expected
    }
    buffer.clear();
    buffer.append("   :");
    try {
        this.parser.parseHeader(buffer);
        Assert.fail("ParseException should have been thrown");
    } catch (final ParseException e) {
        //expected
    }
    buffer.clear();
    buffer.append(": blah");
    try {
        this.parser.parseHeader(buffer);
        Assert.fail("ParseException should have been thrown");
    } catch (final ParseException e) {
        //expected
    }
    buffer.clear();
    buffer.append(" : blah");
    try {
        this.parser.parseHeader(buffer);
        Assert.fail("ParseException should have been thrown");
    } catch (final ParseException e) {
        //expected
    }
    buffer.clear();
    buffer.append("header : blah");
    try {
        this.parser.parseHeader(buffer);
        Assert.fail("ParseException should have been thrown");
    } catch (final ParseException e) {
        //expected
    }
}