Return-Path: Delivered-To: apmail-jakarta-cactus-user-archive@apache.org Received: (qmail 20279 invoked from network); 5 Mar 2002 16:51:51 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 5 Mar 2002 16:51:51 -0000 Received: (qmail 15623 invoked by uid 97); 5 Mar 2002 16:51:36 -0000 Delivered-To: qmlist-jakarta-archive-cactus-user@jakarta.apache.org Received: (qmail 15529 invoked by uid 97); 5 Mar 2002 16:51:35 -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 15414 invoked from network); 5 Mar 2002 16:51:34 -0000 From: "Vincent Massol" To: "'Cactus Users List'" Subject: RE: com.meterware.httpunit.WebResponse Date: Tue, 5 Mar 2002 22:20:17 +0530 Organization: OCTO Technology Message-ID: <008901c1c465$d978acf0$1a53c5cb@octovma> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal In-Reply-To: <3C84E5B5.3932A2C1@inceptor.com> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Kim, As an educated guess, I would say it looks like a HttpUnit bug ;-) This is my guess because Cactus is completely transparent with regards to the HttpServletResponse object (no wrapping, nothing). Also, on the client side, the content type is set using : connection.setRequestProperty("Content-type", theRequest.getContentType()); where connection is a HttpURLConnection object. Have you sent this mail to the HttpUnit mailing-list. -Vincent P.S.: Can you please not use BCC when sending mail to the list ? > -----Original Message----- > From: kim [mailto:kim] On Behalf Of Kim Madsen > Sent: 05 March 2002 21:05 > Subject: com.meterware.httpunit.WebResponse > > 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? > > The code is as follows: > > > /* Bug in Cactus or Meterware? > * Context header comes back as "text/html, text/html" > * Where it was expected to be "text/html". > */ > public void endServeResource(com.meterware.httpunit.WebResponse > theResponse) { > > try { > assertEquals("Unexpected content type", > "text/html", > theResponse.getHeaderField("Content-Type")); > } catch (Exception e) { > fail(e); > } > } > > /* This works fine > */ > public void endServeResource(org.apache.cactus.WebResponse > theResponse) { > > try { > java.net.HttpURLConnection connection = > theResponse.getConnection(); > > assertEquals("Unexpected content type", > "text/html", connection.getContentType()); > } catch (Exception e) { > fail(e); > } > } > > > Again this is not an urgent problem, as I already found the work arround > it. > > Cheers, Kim > > -- > To unsubscribe, e-mail: unsubscribe@jakarta.apache.org> > For additional commands, e-mail: help@jakarta.apache.org> > -- To unsubscribe, e-mail: For additional commands, e-mail: