struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Lindholm <>
Subject Re: Struts 2.1.6 Test Examples
Date Thu, 14 May 2009 13:58:22 GMT

If you just want to test your actions in isolation then the statement is
true. In a test case just create a new action object, call the setters, call
the execute method, check the results.  This simplistic test case really
doesn't need examples but it also doesn't really feel like you have fully
unit tested your actions.

I wanted to be able to test my actions "in full context" which includes the
Struts configuration of the actions, results, interceptor stack, and

Here is my write up on how you do this kind of unit testing:

Doug Pham wrote:
> Hi All,
>      In the main page one of the bullet point is:
> Easy-to-test Actions - Test Struts2 Actions directly, without resorting to
> mock HTTP objects.
> I would love to see a few examples of these.
> Cheers,
> Doug

View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message