01: package servletunit.struts.tests;
02:
03: import servletunit.struts.MockStrutsTestCase;
04: import junit.framework.AssertionFailedError;
05:
06: /**
07: * Created by IntelliJ IDEA.
08: * User: deryl
09: * Date: Apr 28, 2003
10: * Time: 9:26:32 AM
11: * To change this template use Options | File Templates.
12: */
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: }
|