Hi,
Wolfgang Baer wrote:
Tom Tromey wrote:
David Daney had the interesting idea that we could have a mini http
server inside of Mauve, which we could then use to test all the http
modes we care about. Specifically what he had suggested was encoding
the desired response into the request, so we could check 404s,
redirects, chunking, etc.
Thats definitly the way to go.
Just in case you're really motivated to hack in this area ... :-)
Not at this time. I just tried to get the bugs fixed I found during
working on the IPP backend for printing and which prevented me from
hacking.
Well, as I wanted to test Davids Headers rewrite patch I needed to do
a first hack of a TestHttpServer.
Here we go:
The TestHttpServer has methods to set the Headers and the Body it
should return upon request. Furthermore it provides an interface
which can be implemented to test the serverside received headers and body.
As I am not experienced in this networking area this might be a hack.
However a hack which is working so far :-)
I also wrote two tests to show the usage.
responseCodeTest - test for all error codes the correct handling for
getInputStream and getErrorStream.
responseHeadersTest - tests everything with response headers.
2006-03-02 Wolfgang Baer <WBaer@gmx.de>
* gnu/testlet/java/net/HttpURLConnection/TestHttpServer.java: New file.
* gnu/testlet/java/net/HttpURLConnection/responseCodeTest.java:
New test using TestHttpServer.java.
* gnu/testlet/java/net/HttpURLConnection/responseHeadersTest.java:
Likewise.
Comments or OK to commit ?