jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry Tambascio" <ltambas...@charter.net>
Subject Content type/httpunit endXxx
Date Tue, 03 Sep 2002 19:04:25 GMT
Hey,

I'm having trouble in my endXxx method.  I'm using the 
HttpUnit integration to verify some of the output from my 
XSL translation.  I call pResponse.getTables() and I get 
an exception stating that the document needs to have a 
content type of "text/html".  I put an assert in front of 
that like this:

	assertEquals ("Content type", "text/html", 
pResponse.getContentType());

And indeed the test fails with an actual value of 
text/plain.  When I look at the actual HTML through a 
browser (view/source), I get the following line:

<META http-equiv="Content-Type" content="text/html; 
charset=UTF-8">

And in the XSL stylesheet, I have the appropriate:

	<xsl:output method="html" encoding="UTF-8" 
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>

So I'm not sure why Cactus/HttpUnit in the endXxx method 
doesn't think it has HTML.  A potential culprit could be 
the way I'm executing things.  In my testXxx method, I'm 
forwarding the request and response on to the controller 
servlet using the request dispatcher's forward method. 
 It's just too much of a nightmare to instantiate it in 
the test case.  Don't know if that would be getting in the 
way of things, but I figure it's worth mentioning.  Am I 
doing something wrong??

Thanks!!
-Larry

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


Mime
View raw message