No it isn't ... :-). But please continue to answer questions, we need
your help ! :0)
setURL() is simply used to simulate a URL. The correct way is :
public void beginDoGet(WebRequest request)
{
request.addParameter("name1, "value1");
request.addParameter("name2, "value2");
}
[...]
BTW, Cactus comes with several examples which show how to do almost
everything you might dream of ... :-). Have a look at them for
reference.
-Vincent
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 16 April 2002 12:46
> To: [EMAIL PROTECTED]
> Subject: Re: Servlet Testing with Attributes
>
> On 16 Apr, [EMAIL PROTECTED] wrote:
> > Hi
> >
> > I have a test servlet , which does the following:
> >
> > 1. In the setup method, i am instantiating the actual servlet to be
> tested.
> > 2. In the test method, i am calling the servlet's doGet method,
which is
> to
> > be tested. doGet method in the actual servlet accepts two parameters
as
> > part of the Query String. (thru getAttribute).
> >
> > My question is, how can I set this in my test method before calling
the
> > doGet method.
> >
>
> I think this is the correct way:
>
> public void beginDoGet(WebRequest theRequest) {
> theRequest.setURL("localhost:8080", "/servletcontext",
> "/YourTestServlet", null, "param1=foo,param2=bar");
> }
>
> L
>
> --
> Laurent Duperval <mailto:[EMAIL PROTECTED]>
>
> People have one thing in common--they are all different.
>
>
>
> --
> 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]>