I think that if we wish to provide a strong and reliable http client
framework  we ought to have a good suite of unit test that we will enrich as
we go along and find bugs. I have had a brief look at the current tests and
we really need to refine them.

They also rely on the installation of a web server on your machine which I
don't like too much as the test will pass and fail depending on which one
you use ...

Instead I propose to simply use Mock Objects to provide a reliable suite of
tests, which is independent of the web server installed. The principle is
simple: we simply need to create a mock Socket class and a way to pass this
mock to the HttpClient class. The idea is that it is possible from our test
case to set the behaviour that we expect from the mock Socket class, like
what data it will return on the output stream, ... there is absolutely no
logic in the mock implementation, just setters and getters.

I'll write one ASAP but I'd like to know if I can be voted in .... I am
yearning to go forward especially as Cactus now relies on HttpClient.

Tell me what you think.
Thanks
-Vincent


Reply via email to