1 9 package org.jboss.portal.test.core; 10 11 import java.io.IOException ; 12 13 import javax.servlet.RequestDispatcher ; 14 import javax.servlet.ServletException ; 15 16 import org.apache.cactus.JspTestCase; 17 import org.apache.cactus.WebResponse; 18 19 23 public class IncludeTagTestCase 24 extends JspTestCase 25 { 26 public void test01() throws ServletException , IOException 27 { 28 RequestDispatcher rd = config.getServletContext(). 29 getRequestDispatcher("/WEB-INF/jsp/test/testInclude01.jsp"); 30 rd.forward(request, response); 31 } 32 33 public void end01(WebResponse webResponse) 34 { 35 assertEquals("BeginInclude:Include:EndInclude", webResponse.getText().replaceAll("[ \n\t]", "")); 36 } 37 38 public void test02() throws ServletException , IOException 39 { 40 RequestDispatcher rd = config.getServletContext(). 41 getRequestDispatcher("/WEB-INF/jsp/test/testInclude03.jsp"); 42 rd.forward(request, response); 43 } 44 45 public void end02(WebResponse webResponse) 46 { 47 assertEquals("Foo:BeginInclude:Include:EndInclude:Bar", webResponse.getText().replaceAll("[ \n\t]", "")); 48 } 49 50 51 52 } 53 | Popular Tags |