Return-Path: Delivered-To: apmail-jakarta-cactus-user-archive@apache.org Received: (qmail 89752 invoked from network); 6 Mar 2002 10:18:12 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 6 Mar 2002 10:18:12 -0000 Received: (qmail 4937 invoked by uid 97); 6 Mar 2002 10:18:23 -0000 Delivered-To: qmlist-jakarta-archive-cactus-user@jakarta.apache.org Received: (qmail 4895 invoked by uid 97); 6 Mar 2002 10:18:22 -0000 Mailing-List: contact cactus-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Cactus Users List" Reply-To: "Cactus Users List" Delivered-To: mailing list cactus-user@jakarta.apache.org Received: (qmail 4884 invoked from network); 6 Mar 2002 10:18:21 -0000 Sender: kim Message-ID: <3C85EC30.571C5283@inceptor.com> Date: Wed, 06 Mar 2002 10:15:12 +0000 From: Kim Madsen Organization: Inceptor Ltd. X-Mailer: Mozilla 4.7 [en] (X11; I; SunOS 5.6 sun4u) X-Accept-Language: en MIME-Version: 1.0 To: Cactus Users List Subject: Re: com.meterware.httpunit.WebResponse References: <3C7E5182.69A864FC@inceptor.com> <3C84E5B5.3932A2C1@inceptor.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 06 Mar 2002 10:15:29.0862 (UTC) FILETIME=[D7BE3E60:01C1C4F7] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Thanks for your help, that make me realize that it was caused by me not using the Servlet API correctly... Was was using response.setHeader("Content-Type", "text/html"); where I should have been using response.setContentType("text/html"); I have changed that in my servlet, and it now works on the same version of HttpUnit, where it previously failed. However, it was probably for the best, that it was discovered, because even when I used response.setHeader("Content-Type", "text/html"); the Servlet was working (returning the ContentType Header correctly) when invoked directly (e.g. using telnet). Cheers, Kim Russell Gold wrote: > > 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: but was: >text/html> > > > >junit.framework.AssertionFailedError: Unexpected content type > >expected: but was: > > > > > >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 method. > -- > ------------------------------------------------------------------------ > 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: > For additional commands, e-mail: -- To unsubscribe, e-mail: For additional commands, e-mail: