You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Michael Becke <be...@u.washington.edu> on 2004/10/12 04:04:19 UTC
Invalid response tests
Hello All,
I've been starting to refactor some of the webapp test and have come
upon a bit of a problem. I'm not terribly familiar with the
SimpleHttpServer setup so perhaps there is "simple" solution that is
eluding me. The problem is that sending invalid responses can be quite
difficult. Specifically I'm trying to send a response with content but
no content length. Is there an easy way to do this?
Mike
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org
Re: Invalid response tests
Posted by Michael Becke <be...@u.washington.edu>.
Ah, I see. Thanks for the pointer.
Mike
On Oct 12, 2004, at 5:44 AM, Oleg Kalnichevski wrote:
> On Tue, 2004-10-12 at 04:04, Michael Becke wrote:
>> Hello All,
>>
>> I've been starting to refactor some of the webapp test and have come
>> upon a bit of a problem. I'm not terribly familiar with the
>> SimpleHttpServer setup so perhaps there is "simple" solution that is
>> eluding me. The problem is that sending invalid responses can be
>> quite
>> difficult. Specifically I'm trying to send a response with content
>> but
>> no content length. Is there an easy way to do this?
>>
>> Mike
>>
>
> Mike,
>
> HttpRequestHandler provides direct access to
> SimpleHttpServerConnection,
> which should be sufficient to simulate pretty much any type of
> malformed
> responses:
>
> http://jakarta.apache.org/commons/httpclient/3.0/xref-test/org/apache/
> commons/httpclient/server/HttpRequestHandler.html
>
> You may want to take a look at TestBadContentLength as an example of
> using HttpRequestHandler
>
> http://jakarta.apache.org/commons/httpclient/3.0/xref-test/org/apache/
> commons/httpclient/TestBadContentLength.html
>
> Oleg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> commons-httpclient-dev-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org
Re: Invalid response tests
Posted by Oleg Kalnichevski <ol...@apache.org>.
On Tue, 2004-10-12 at 04:04, Michael Becke wrote:
> Hello All,
>
> I've been starting to refactor some of the webapp test and have come
> upon a bit of a problem. I'm not terribly familiar with the
> SimpleHttpServer setup so perhaps there is "simple" solution that is
> eluding me. The problem is that sending invalid responses can be quite
> difficult. Specifically I'm trying to send a response with content but
> no content length. Is there an easy way to do this?
>
> Mike
>
Mike,
HttpRequestHandler provides direct access to SimpleHttpServerConnection,
which should be sufficient to simulate pretty much any type of malformed
responses:
http://jakarta.apache.org/commons/httpclient/3.0/xref-test/org/apache/commons/httpclient/server/HttpRequestHandler.html
You may want to take a look at TestBadContentLength as an example of
using HttpRequestHandler
http://jakarta.apache.org/commons/httpclient/3.0/xref-test/org/apache/commons/httpclient/TestBadContentLength.html
Oleg
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org