Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

There's a number of approaches you can take to unit-test your WebWork actions. The simplest is to instantiate your actions, call setters then execute(). This allows you to bypass all the complicated container setup.

Taken from Petsoar:

...

Yes. Struts 2 provides built-in support for JUnit 3.8 via an abstract StrutsTestCase, which provides common Struts variables and setup code. To learn what approaches you can take when testing your Struts Actions, see How can we test Actions.