public void testParsingInvalidHeaders() throws Exception {
String s = " stuff\r\n" +
"header1: stuff\r\n" +
"\r\n";
SessionInputBuffer receiver = new SessionInputBufferMockup(s, "US-ASCII");
try {
AbstractMessageParser.parseHeaders(receiver, -1, -1, null);
fail("ProtocolException should have been thrown");
} catch (ProtocolException ex) {
// expected
}
s = " : stuff\r\n" +
"header1: stuff\r\n" +
"\r\n";
receiver = new SessionInputBufferMockup(s, "US-ASCII");
try {
AbstractMessageParser.parseHeaders(receiver, -1, -1, null);
fail("ProtocolException should have been thrown");
} catch (ProtocolException ex) {
// expected