}
public void testDetectLineLimitEarly() throws Exception {
HttpParams params = new BasicHttpParams();
SessionInputBuffer inbuf = new SessionInputBufferImpl(2, 128, params);
HttpRequestFactory requestFactory = new DefaultHttpRequestFactory();
params.setIntParameter(CoreConnectionPNames.MAX_LINE_LENGTH, 2);
HttpRequestParser requestParser = new HttpRequestParser(inbuf, null, requestFactory, params);
ReadableByteChannel channel = newChannel("GET / HTTP/1.0\r\nHeader: one\r\n\r\n");
assertEquals(2, requestParser.fillBuffer(channel));