1 17 package servletunit.struts.tests.cactus; 18 19 import servletunit.struts.CactusStrutsTestCase; 20 import junit.framework.AssertionFailedError; 21 22 public class TestTilesForward extends CactusStrutsTestCase { 23 24 public TestTilesForward(String testName) { 25 super(testName); 26 } 27 28 public void setUp() throws Exception { 29 super.setUp(); 30 } 31 32 public void testTilesForward() { 33 addRequestParameter("username","deryl"); 34 addRequestParameter("password","radar"); 35 setRequestPathInfo("tiles","/tilesForward"); 36 actionPerform(); 37 verifyForward("success"); 38 verifyForwardPath("/layouts/pageLayout.jsp"); 39 verifyTilesForward("success","page.library"); 40 } 41 42 public void testTilesInputForward() { 43 setRequestPathInfo("tiles","/tilesInputForward.do"); 44 actionPerform(); 45 verifyInputForward(); 46 } 47 48 public void testTileForwardFail() { 49 addRequestParameter("username","deryl"); 50 addRequestParameter("password","radar"); 51 setRequestPathInfo("tiles","/tilesForward.do"); 52 actionPerform(); 53 verifyForward("success"); 54 verifyForwardPath("/layouts/pageLayout.jsp"); 55 try { 56 verifyTilesForward("success","foo.fail"); 57 } catch (AssertionFailedError afe) { 58 return; 59 } 60 fail("Should have failed."); 61 } 62 63 78 79 } 80 | Popular Tags |