struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Yuen" <>
Subject RE: Advice on unit testing struts action classes
Date Fri, 22 Jun 2007 15:56:58 GMT
Can anyone give me any advice on a good tool to use for unit testing struts action classes.
I am currently using struts 1.2.9 with spring 1.2.9 and hibernate. I have looked into StrutsTestCase
but cannot get it to work. I get the following error:
    [junit] Testsuite: com.chisq.common.action.PersonActionTest
    [junit] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 1.266 sec
    [junit] ------------- Standard Output ---------------
    [junit] 08:47:40,547 DEBUG PersonActionTest:48 - .......running testSavePerson()
    [junit] 08:47:40,922 ERROR RequestProcessor:676 - Invalid path was requested /Person
    [junit] ------------- ---------------- ---------------
    [junit] Testcase: testSavePerson(com.chisq.common.action.PersonActionTest): FAILED
    [junit] received error 404 : Invalid path was requested
    [junit] junit.framework.AssertionFailedError: received error 404 : Invalid path was requested
    [junit]     at servletunit.HttpServletResponseSimulator.sendError(
    [junit]     at org.apache.struts.action.RequestProcessor.processMapping(
    [junit]     at org.apache.struts.action.RequestProcessor.process(
    [junit]     at org.apache.struts.action.ActionServlet.process(
    [junit]     at org.apache.struts.action.ActionServlet.doPost(
    [junit]     at servletunit.struts.MockStrutsTestCase.actionPerform(
    [junit]     at com.chisq.common.action.PersonActionTest.testSavePerson(

I have checked in my strut-config.xml file and /Person is defined as well in my action-servlet.xml
file as well.

View raw message