01: package servletunit.struts.tests.cactus;
02:
03: import servletunit.struts.MockStrutsTestCase;
04: import servletunit.struts.CactusStrutsTestCase;
05: import junit.framework.AssertionFailedError;
06:
07: /**
08: * Created by IntelliJ IDEA.
09: * User: deryl
10: * Date: Apr 28, 2003
11: * Time: 9:26:32 AM
12: * To change this template use Options | File Templates.
13: */
14: public class TestBadModuleName extends CactusStrutsTestCase {
15:
16: public TestBadModuleName(String testName) {
17: super (testName);
18: }
19:
20: public void setUp() throws Exception {
21: super .setUp();
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: }
|