> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 15 April 2002 13:52
> To: [EMAIL PROTECTED]
> Subject: Re: I'm probably misunderstanding something here...
> 
> On 11 Apr, To: Cactus Mailing List wrote:
> > Hi,
> >
> > I'm trying to run the attached servlet test, but when I do, I get an
> error
> > on the assertion of the content type as text/plain. If I use my Web
> browser
> > to access the URL, though, I get the correct type.
> > Here is the ant target that runs the test:
> >
> 
> Ouch! Seems like I'm on my own on this one. :-(

No you're not ... ! :-) I've just read you test case and you have that
line :

assertEquals("Unexpected type", "text/plain",
theResponse.getWebRequest().getContentType());

which looks strange to me because you're comparing the content type of
the HTTP request that was sent in beginXXX() to "text/plain". By default
Cactus sends a content type of "application/x-www-form-urlencoded". If
you wanted to specify the content type you would have to issue a
WebRequest.setContentType("text/plain") in beginXXX().

However, I believe that what you really want to do is assert the content
type of the _HTTP Response_ and not the one from the HTTP request, right
? You would do that easily by issuing a :

assertEquals("Unexpected type", "text/plain",
theResponse.getConnection().getContentType());

Cheers,
-Vincent

> 
> L
> 
> --
> Laurent Duperval <mailto:[EMAIL PROTECTED]>
> 
> "There's a bug born every minute, and two to replace him."
>         P. T. Bugem
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:cactus-user-
> [EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:cactus-user-
> [EMAIL PROTECTED]>
> 




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to