Yes, you are correct in that you have to manually wire your actions in your test cases. One solution to this problem may be extending StrutsTestCase instead of BaseActionTestCase.
http://struts.apache.org/2.0.9/struts2-core/apidocs/org/apache/struts2/StrutsTestCase.html Matt On 8/19/07, Derek Broughton <[EMAIL PROTECTED]> wrote: > Derek Broughton wrote: > > > In a new (2.0m5) project created in Eclipse with Candy4Appfuse, I get the > > following error on "mvn surefire:test". While I thought I had followed > > the instructions in http://www.appfuse.org/display/APF/Using+Struts+2, I > > think > > this must mean that I don't have zeroconfig setup correctly. Am I on the > > right track? > > > > ------------------------------------------------------------------------------- > > Test set: ca.pointerstop.cocoa.webapp.action.AccountActionTest > > ------------------------------------------------------------------------------- > > Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 11.676 sec > > <<< FAILURE! > > testSearch(ca.pointerstop.cocoa.webapp.action.AccountActionTest) Time > > elapsed: 11.281 sec <<< ERROR! > > org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean > > named 'accountManager' is defined > > > > Since I couldn't find any hint of log information showing the auto-wiring > that should have occurred when it failed in the unit test, I did what any > good developer would do and skipped the testing :-) I renamed my > AccountActionTest so that it wouldn't get executed, and ran "mvn > jetty:run-war", voila! the action actually executes, so clearly the > autowiring process _does_ work. It's a little awkward to write unit tests > though, if the testing process doesn't go through the same steps as the > actual live run. :-( > -- > derek > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- http://raibledesigns.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
