Russell Gold wrote:
> 
> At first glance, I see two ways to accomplish this:
> 
> 1) The "arms length" approach.
> 
> I need to refactor HttpWebResponse and WebResponse to allow subclasses to
> supply an input stream and (initial) set of headers. This is on my todo
> list to support <meta> tags in servletunit clients. Once this is done, it
> will be easy to create a CactusWebResponse to extend WebResponse.
> 

Excellent.


> It might then be desirable to let clients define their endXXX method to
> take either a WebResponse or an HttpURLConnection. Implementations which
> chose the former interface would receive the CactusWebResponse.

which is something we could worry about from our end once your
refactoring of the two response classes is done.

> 
> 2) The "tight integration" approach.
> 
> It would be possible along these lines to have Cactus use WebConversation
> as its HTTP client. This impacts many more classes, so would be a lot more
> work. The potential advantage would be the ability to chain tests, using
> the results from one request to create the next request. It is not clear to
> me whether this is worth the effort, as Cactus does not seem to preserve
> server state between calls, so chaining could be more confusing to users
> than helpful.
> 

I did think about this - not necessarily for the ability to chain tests,
but so that we wouldn't need to maintain our own HttpClient
functionality - it means we get all the pairs of eyes looking for bugs
in Httpunit web client code rather than duplicating the functionality.
:)

You _could_ chain tests together if you wanted to do a "server side"
only functional test, but I tend to Vincent's view that for the moment
that would be confusing. i.e. let's get unit testing sorted properly
before taking on another feature.


> I could accomplish at least most of (1) fairly soon, I think.
> 

Given that you need to do (1) anyway for another reason, and that it
doesn't rule out (2) then yes, go with (1). 


> BTW, who is "Heath Robinson"?

A Victorian artist, known for producing cartoon sketches, and
particularly for absurd machines, hence the phrase in the UK of
describing something as "a Heath Robinson affair" - you know the sort of
weird and wacky machines you get in RoadRunner cartoons from ACME
corporation? Well he drew sketches like that at the turn of the century. 

See:
a short biography
http://www.bpib.com/illustrat/whrobin.htm

an example of his art
http://www.a.ghinn.btinternet.co.uk/multimov.htm
"The Multi-movement bomb catcher"
--
Jari Worsley
Senior Programmer
Hyperlink Interactive Ltd

Reply via email to