struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <>
Subject Re: Struts testing
Date Mon, 16 Apr 2007 06:03:15 GMT
puchacz wrote:
> Hi
> I would like to ask if You (as Struts programmers) see some + or - of
> testing Struts? I know JSF where I can test  all components as a standalone
> programs. How it looks in Struts? If in Struts are a lot of dependencies
> which make Struts testing hard to test? 

It depends somewhat on which version of Struts you're talking about. 
Generally, Struts 2 makes testing easier by reducing dependencies 
through well defined abstraction interfaces.

For Struts 1 actions, it's a bit trickier since they generally expect 
certain HTTP Servlet-specific objects to be available. You will 
generally want to keep your actions as simple as possible and move most 
of your application/business logic into POJO service classes to make 
unit testing easier.

You can also use tools such as Cactus and HtmlUnit to help with creating 
integration tests and such. Mock frameworks such as the one Martin 
mentioned can also be a good choice.


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

View raw message