01: package servletunit.struts.tests;
02:
03: import servletunit.struts.MockStrutsTestCase;
04:
05: public class TestMultipleConfigFiles extends MockStrutsTestCase {
06:
07: protected void setUp() throws Exception {
08: super .setUp();
09: setServletConfigFile("/WEB-INF/web.xml");
10: setConfigFile("/WEB-INF/struts-config-tiles.xml,/WEB-INF/struts-config.xml");
11: }
12:
13: public void testTilesForward() {
14: addRequestParameter("username", "deryl");
15: addRequestParameter("password", "radar");
16: setRequestPathInfo("/tilesForward.do");
17: actionPerform();
18: verifyForward("success");
19: verifyForwardPath("/layouts/pageLayout.jsp");
20: verifyTilesForward("success", "page.library");
21: clearRequestParameters();
22: addRequestParameter("username", "deryl");
23: addRequestParameter("password", "radar");
24: setRequestPathInfo("/login");
25: actionPerform();
26: verifyForward("success");
27: }
28: }
|