Andy Stevens - 2008-06-09

Hi,

I'm using the MockStrutsTestCase from strutstest214-1.2_2.3.zip with Struts 1.3.8.  Although I saw in the release notes that the ComposableRequestProcessor wasn't supported, I didn't realise at first that I was using that; although the Struts docs [1] do say that it's the default processor, the TilesPlugin javadocs [2] say that the plugin "changes the Struts configuration by specifying a TilesRequestProcessor as request processor".  Unfortunately, that's not always true; a closer look at the source code revealed that it checks for the ComposableRequestProcessor and leaves it alone...

...which probably explains why my tests were behaving strangely (e.g. verifyForward("success") would error with "was expecting '/WEB-INF/jsp/layout/mylayout.jsp' but received 'page.viewdetails'", and verifyTilesForward("success", "page.viewdetails") would succeed whatever forward had been returned).  When I changed the struts-config.xml to use <controller processorClass="org.apache.struts.action.RequestProcessor" inputForward="true" /> instead of just <controller inputForward="true" /> things started to behave a bit better (i.e. verifyForward("success") now works) although I still found that
            actionPerform();
            verifyTilesForward("failure", "auth.password-change.page");
            verifyTilesForward("success", "auth.confirm-update.page");
passes, which is strange since the action surely can't have returned more than one forward!

So, I have two questions:
1. Am I right to expect one of those verifyTilesForward calls to fail, or do they just test the forward definitions rather than what the action actually returned? (in which case, you need to update your javadocs [3])
2. Is there any planned release schedule for adding ComposableRequestProcessor support ?

Andy.

[1] http://struts.apache.org/1.3.8/userGuide/building_controller.html#request_processor
[2] http://struts.apache.org/1.3.8/apidocs/org/apache/struts/tiles/TilesPlugin.html
[3] http://strutstestcase.sourceforge.net/api/servletunit/struts/MockStrutsTestCase.html#verifyTilesForward\(java.lang.String,%20java.lang.String)