1 package servletunit.struts.tests; 2 3 import servletunit.struts.MockStrutsTestCase; 4 import junit.framework.AssertionFailedError; 5 6 13 public class TestBadModuleName extends MockStrutsTestCase { 14 15 public TestBadModuleName(String testName) { 16 super(testName); 17 } 18 19 public void setUp() throws Exception { 20 super.setUp(); 21 setServletConfigFile("/WEB-INF/web.xml"); 22 setConfigFile("tiles","/WEB-INF/struts-config-tiles.xml"); 23 } 24 25 public void testBadName() { 26 try { 27 addRequestParameter("username","deryl"); 28 addRequestParameter("password","radar"); 29 setRequestPathInfo("doesnotexist","/tilesForward"); 30 actionPerform(); 31 verifyForward("success"); 32 verifyForwardPath("/layouts/pageLayout.jsp"); 33 } catch (AssertionFailedError afe) { 34 return; 35 } 36 fail("Should have thrown a JUnit error!"); 37 } 38 39 } 40 | Popular Tags |