|
Hi Amar,
Not sure why you would want to do this. There are 2 goals in Cactus
:
- to provide a unit testing framework
- to formalize a methodology for automating unit testing in
containers
If you have to enter form values before each test, it does not bring the
benefit of automation.
Cactus is about unit testing, meaning you don't test
interations from end to end, this would be functional testing (using a tool like
HttpUnit). What you unit test however, is for example the LogonForm class. This
class has several methods but the most interesting one to test is the validate()
method. This method takes 2 parameters : a ActionMapping object and a
HttpServletRequest object. What you'll write in your unit test is different
scenarios corresponding to different values set in these 2 classes in order to
verify the correct behaviour of LogonForm in different cases. Cactus provides a
simulated HttpServletRequest for you. However fror the ActionMapping, you have
to construct one yourself, as part of your test
initialization.
Is that clear ?
Cheers,
Vincent
|
Title: Access to HttpServletRequest.getInputStream() in Cactus
- unittesting struts using cactus Nanduri, Amarnath
- RE: unittesting struts using cactus Vincent Massol
- RE: unittesting struts using cactus Nanduri, Amarnath
