> -----Original Message-----
> From: Anil Agrawal [mailto:[EMAIL PROTECTED]
> Sent: 29 May 2003 08:07
> To: [EMAIL PROTECTED]
> Subject: Facing problem in beginXXX() method
>
> I have successfully tested many jsp tags using cactus frame work.
>
> In one tag I am facing problem.
>
> In beginXXX() method I set all my request parameter as
> follows.
>
> webRequest.addParameter("KEY_Name_First","hpuser50");
> webRequest.addParameter("KEY_Name_Middle","M.");
> webRequest.addParameter("KEY_Name_Last","Shah");
> webRequest.addParameter("KEY_Name_Suffix","Sr.");
> webRequest.addParameter("KEY_Name_Suffix",password);
>
> but value of one parameter is not hardcoded.
> Another tag genrates password, and My requirement is that
> I want to pass this password as a request parameter.
Cactus is a tool for *UNIT* testing, i.e. you test *EACH* method in
isolation. Thus you have to set up the full environment before each
test.
>
> like
> webRequest.addParameter("KEY_Name_Suffix",password);
>
> When I call another tag from beginXXX() than beginXXX()
> cries.
beginXXX() is executed on the client side so if you call server-side
methods there it won't work.
>
> From setup method I am able to genrate the require password.
> But problem is how to pass it to beginXXX() so tag under test
> will get the require parameter from request.
Lifecycle is:
Client side: begin()
Client side: beginXXX()
Server side: setUp()
Server side: testXXX()
Server side: tearDown()
Client side:endXXX()
Client side:end()
so beginXXX() comes before setUp() and is executed on the client side.
>
> please help me.
Simply set a controlled value as the password. If need be, preset your
database with correct data (if you have any database).
-Vincent
>
> with regards
> anil
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]