jakarta-watchdog-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Lubke <Ryan.Lu...@Sun.COM>
Subject Re: watchdog, servletapi, karma
Date Fri, 14 Jun 2002 16:37:23 GMT
On Fri, 2002-06-14 at 10:36, Christopher K. St. John wrote:
> Ryan Lubke wrote:
> > 
> > You can send me the Watchdog patches and I'll look them over.
> > 
> 
> My original failed tests turned out to be my fault. I
> didn't update my servlet-test.war. I downgraded the
> severity of 9794 from "Blocker" to "Normal", since it
> turns out there really are problems.
> 
> The Watchdog GTest "HTTP" engine reads body content
> through a filter that maps CRLF into a single LF. That
> means a golden file (which uses plain LF as EOL) can be
> compared with a response that was generated using
> PrintWriter.println() on an O/S that uses either LF or
> CRLF as EOL. That leads to some weirdness.
> 
> First off, systems that use plain CR as EOL, like old
> Macs, will presumably fail tests. That isn't such a big
> deal, because old Macs don't run Java 2, but it isn't good
> for a conformance testing tool to have that sort or
> problem built in.
> 
> More importantly, systems that use single char EOL's are
> now generating illegal HTTP but still passing the
> tests. For example, on Unix, the SetContentLength servlet
> indicates a content-length of 33 but only sends 32
> characters. This works because all the tests are currently
> hardcoded to be HTTP/1.0, which closes the stream at the
> end of the body. But's it's wrong. Try:
> 
>   $ wget http://localhost:8080/servlet-tests/SetContentLengthTest
> 
> Long term, Watchdog probably needs to move to a proper
> HTTP client library.

Agreed.  I've been thinking about prototyping a replacement
using Latka from the Commons project (based of the HttpClient
library, also in the Commons project), but haven't had
a lot of time to work on this.

Do you have any thoughts on this?  Have you taken a look
at Latka?  Do you have an alternate suggestion?

> 
> Medium term the places where Watchdog servlets use
> println("data") need to be changed to use
> print(data+"\r\n") or print(data+"\n") or whatever, as
> long as they do it consistently, and the number of magic
> constants needs to be minimzied.

I will start going through the existing test code and make
changes as appropriate.

> 
> Short term, I fixed SetContentLengthTestServlet and
> ServletResponseWrapperSetContentLengthTestServlet to both
> hardcode CRLF instead of depending on println(). (see the
> attached patches)

Thanks, I'll apply the patches today.

> 
> I'd like to get rid of the mystery constants "2" and "48",
> but that would involve a further rewrite, and I wanted to
> hold off until there was some discussion about the
> appropriate med/long term solution.
> 
> 
> -- 
> Christopher St. John cks@distributopia.com
> DistribuTopia http://www.distributopia.com
> 
> --
> To unsubscribe, e-mail:   <mailto:watchdog-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:watchdog-dev-help@jakarta.apache.org>
> 



--
To unsubscribe, e-mail:   <mailto:watchdog-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:watchdog-dev-help@jakarta.apache.org>


Mime
View raw message