jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anil Agrawal" <a.agra...@popnet.co.in>
Subject RE: Facing problem in beginXXX() method
Date Thu, 29 May 2003 08:02:54 GMT
Thanks Vincent for your prompt reply.

WITH REGARDS
ANIL






-----Original Message-----
From: Vincent Massol [mailto:vmassol@pivolis.com] 
Sent: Thursday, May 29, 2003 12:50 PM
To: 'Cactus Users List'
Subject: RE: Facing problem in beginXXX() method




> -----Original Message-----
> From: Anil Agrawal [mailto:a.agrawal@popnet.co.in]
> Sent: 29 May 2003 08:07
> To: cactus-user@jakarta.apache.org
> 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: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org



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


Mime
View raw message