You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Mohamed Sherefudheen <sm...@yahoo.com> on 2005/04/20 21:54:39 UTC
Struts and Cactus
Hello All
I have a cactus test which i run using the url method
in the browser to run the test.
Now as i have hardcoded all the test data value in
the
cactus test itself it is very hard to change it as it
requires a recompile everytime i change it.
So i put in a small struts interface with fields open
in it and i wrote validations in a action form. And
then if everything is ok i send the request to a
action and in the action i set the attributes with
the data collected from request and finally forward
the request to the ServletTestRunner with cactus test
suite as a parameter.
Then in servlet test runner i am able to retrieve the
attributes which are set but when i try to retrieve
the attributes in the real cactus test suite they are
lost. I dont know why and how to do these test where
in I would be able to customise the data for the
test
data in class. Even if i set in action as attributes
in session and retrieve in cactus test it is still
lost>>>>>????????????
Please help me how can I do this test.?
Regards
Farouk
RE: Struts and Cactus
Posted by Vincent Massol <vm...@pivolis.com>.
Hi Mohamed,
If I understand correctly you're saving some data in the session. However
you should know that each Cactus tests is run with a new session (Ironically
to prevent side effect!).
If you really need to save data to share across tests, I'd suggest you save
them in the application scope instead.
Thanks
-Vincent
> -----Original Message-----
> From: Mohamed Sherefudheen [mailto:smohamedfarouk@yahoo.com]
> Sent: mercredi 20 avril 2005 21:55
> To: cactus-user@jakarta.apache.org
> Subject: Struts and Cactus
>
> Hello All
> I have a cactus test which i run using the url method
> in the browser to run the test.
> Now as i have hardcoded all the test data value in
> the
> cactus test itself it is very hard to change it as it
> requires a recompile everytime i change it.
> So i put in a small struts interface with fields open
> in it and i wrote validations in a action form. And
> then if everything is ok i send the request to a
> action and in the action i set the attributes with
> the data collected from request and finally forward
> the request to the ServletTestRunner with cactus test
> suite as a parameter.
>
> Then in servlet test runner i am able to retrieve the
> attributes which are set but when i try to retrieve
> the attributes in the real cactus test suite they are
> lost. I dont know why and how to do these test where
> in I would be able to customise the data for the
> test
> data in class. Even if i set in action as attributes
> in session and retrieve in cactus test it is still
> lost>>>>>????????????
>
> Please help me how can I do this test.?
> Regards
> Farouk
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org