1 5 package servletunit.struts.tests; 6 7 import servletunit.struts.MockStrutsTestCase; 8 9 public class TestDispatchAction extends MockStrutsTestCase { 10 11 public TestDispatchAction(String testName) { 12 super(testName); 13 } 14 15 public void setUp() throws Exception { 16 super.setUp(); 17 setServletConfigFile("/WEB-INF/web.xml"); 18 } 19 20 public void testDispatchAction() { 21 addRequestParameter("method","actionOne"); 22 setRequestPathInfo("test","/testDispatchAction"); 23 actionPerform(); 24 verifyNoActionErrors(); 25 verifyForward("action1"); 26 addRequestParameter("method","actionTwo"); 27 setRequestPathInfo("test","/testDispatchAction"); 28 actionPerform(); 29 verifyNoActionErrors(); 30 verifyForward("action2"); 31 32 } 33 34 } 35 | Popular Tags |