struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xianpants <>
Subject [S2] Writing tests that assert actions render their freemarker view without exceptions
Date Wed, 29 Aug 2007 21:24:29 GMT

We're using Struts 2 with Freemarker for our views, and we're running into
the classic problem of introducing invalid property references (expressions)
when we refactoring the backing-model.  In some cases property names have
changed and in others, a more significant hunk of an expression may be

At some point we'll introduce true integration/functional tests using
Selenium (or some such) which would be useful in identifying these problems. 
However, I'm really interested in first building out the unit testing
infrastructure to catch these problems when we run our standard unit tests.

What's the best way to invoke an Action and the rendering of its view to
assert that no exceptions or freemarker errors are raised?

This would go a long way in giving us confidence that we haven't busted
anything during a refactor.

Interestingly, Rails provides a means for testing not only that a controller
(Action) works but that is also doesn't produce any errors while rendering
the produced model.  It seems like S2 should be able to do the same.

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