struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Lindholm <glindh...@yahoo.com>
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
validation.

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

http://glindholm.wordpress.com/2008/06/30/unit-testing-struts-2-actions/


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: http://www.nabble.com/Struts-2.1.6-Test-Examples-tp23524593p23541135.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Mime
View raw message