This is the mail archive of the mailing list for the Mauve project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: HTTPTestServer

Wolfgang Baer wrote:

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

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 <>

	* gnu/testlet/java/net/HttpURLConnection/ New file.
	* gnu/testlet/java/net/HttpURLConnection/
	New test using
	* gnu/testlet/java/net/HttpURLConnection/

Comments or OK to commit ?

I am of a mixed mind on that.

Here in mauve, no formal permission is needed to commit.

At the highest level this is what I had in mind, but I had pictured it in my mind as being implemented slightly differently. I was thinking about something similar to a servlet engine, where the capabilities of the server could be changed by writing different plug-in classes for it. You have a limited set of capabilities hard coded in the server, so the server has to change if we want to do something that it does not support. Also it has no support for multiple connections or multiple requests on a keep-alive connection.

Not withstanding all of that, I think it is an excellent start to a very much needed capability. Just because it is not exactly what I would have done does not mean that it is not good and useful.

My call: You decide. Commit it in as is, or keep hacking and commit later.

David Daney

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]