jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Russell Gold <russg...@acm.org>
Subject Re: com.meterware.httpunit.WebResponse
Date Wed, 06 Mar 2002 03:54:23 GMT
At 3:35 PM +0000 3/5/02, Kim Madsen wrote:
>I have found a problem when using
>public void endXXX(com.meterware.httpunit.WebResponse theResponse)
>in a Cactus test case.
>In my Servlet I do a
>	response.setHeader("Content-Type", "text/html");
>When I latter check it using com.meterware.httpunit.WebResponse I get an
>assertion error because it says the header is "text/html, text/html":
>Unexpected content type expected:<text/html> but was:<text/html,
>junit.framework.AssertionFailedError: Unexpected content type
>expected:<text/html> but was:<text/html, text/html>
>However, if I use
>public void endXXX(org.apache.cactus.WebResponse theResponse)
>in my Cactus test case, the headers is "text/html" - as expected.
>I do not know, if this is a Cactus bug or a Meterware bug.
>Any advice?

I have found and fixed a bug in HttpUnit which could possibly cause this. The scenario occurs
when a servlet returns multiple headers with the same key. Normally, this should not be possible
AFAIK, but it may be that you have found a way around it.

The newest code in cvs (soon to be released) will check only the first header for the getContentType
Russell Gold                     | "... society is tradition and order
russgold@acm.org                 | and reverence, not a series of cheap
                                 | bargains between selfish interests."
http://www.httpunit.org          |   - Poul Anderson, "Iron"

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

View raw message