Hi Roland and Oleg,

First thanks for you prompt reactions!

On 7/27/07, Oleg Kalnichevski <[EMAIL PROTECTED]> wrote:
>
> There are plenty of test cases in HttpCore that make use of mock HTTP
> connections (bound to a file or an array of bytes instead of a socket)
> to exercise HTTP message parsing code. You could use those as a starting
> point:

I found this testcase in the code:

    public void testSimpleParsing() throws Exception {
        HttpParams params = new BasicHttpParams();
        SessionInputBuffer inbuf = new SessionInputBuffer(1024, 128);
        HttpRequestFactory requestFactory = new DefaultHttpRequestFactory();
        HttpRequestParser requestParser = new HttpRequestParser(inbuf,
requestFactory, params);
        requestParser.fillBuffer(newChannel("GET /whatever
HTTP/1.1\r\nSome header: stuff\r\n\r\n"));
        HttpRequest request = (HttpRequest) requestParser.parse();
        assertNotNull(request);
        assertEquals("/whatever", request.getRequestLine().getUri());
        assertEquals(1, request.getAllHeaders().length);
    }

This looks a lot like what I need for my case. I'm now convinced that
your directions and HttpCore components I'm gonna solve my problem.
Thanks!

-- 

regards,

Jeroen

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to