A project that Im working on uses Spring and Struts.
Up until now, we we using using Struts 2.1.8.1. All my unit tests extended the StrutsSpringTestCase which in turn extended the StrutsTestCase. However, this used JUnit 3.8.2 and hence had no annotation support.
For Struts 2.2.3, the dev team added a Junit4 TestCase, called StrutsJUnit4TestCase. This test case however, does not the have the supporting functions that StrutsTestCase did e.g. for issuing struts actions. I tried to find some tutorials using this new test case, but haven’t had any luck.
I should mention that I’m trying to use the Rollback annotations, to rollback the automatically rollback database changes that occur during the test.
How exactly am I supposed to use this new StrutsJunit4TestCase?
at least the following one works in my computer
the getContextLocations method is important, because this is the method which defines where your applicationContext for testing is.
oh, i’m using junit 4.4