KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > servletunit > struts > tests > TestMultipleConfigFiles


1 package servletunit.struts.tests;
2
3 import servletunit.struts.MockStrutsTestCase;
4
5 public class TestMultipleConfigFiles extends MockStrutsTestCase
6  {
7
8     protected void setUp() throws Exception JavaDoc {
9         super.setUp();
10         setServletConfigFile("/WEB-INF/web.xml");
11         setConfigFile("/WEB-INF/struts-config-tiles.xml,/WEB-INF/struts-config.xml");
12     }
13
14     public void testTilesForward() {
15         addRequestParameter("username","deryl");
16         addRequestParameter("password","radar");
17         setRequestPathInfo("/tilesForward.do");
18         actionPerform();
19         verifyForward("success");
20         verifyForwardPath("/layouts/pageLayout.jsp");
21         verifyTilesForward("success","page.library");
22         clearRequestParameters();
23         addRequestParameter("username","deryl");
24         addRequestParameter("password","radar");
25         setRequestPathInfo("/login");
26         actionPerform();
27         verifyForward("success");
28     }
29 }
30
Popular Tags