| 1 9 package org.jboss.portal.test.core; 10 11 import java.io.IOException ; 12 13 import javax.servlet.ServletException ; 14 import javax.servlet.http.HttpServletRequest ; 15 import javax.servlet.http.HttpServletResponse ; 16 17 import org.apache.cactus.JspTestCase; 18 import org.jboss.portal.common.context.Context; 19 import org.jboss.portal.common.context.DelegateContext; 20 import org.jboss.portal.core.servlet.jsp.PortalJsp; 21 import org.jboss.portal.core.servlet.jsp.taglib.PortalLib; 22 23 28 public class OutELTestCase 29 extends JspTestCase 30 { 31 32 public void test01() throws ServletException , IOException { 33 37 38 PortalJsp jbossJsp = new PortalJsp() 39 { 40 public void _jspService(HttpServletRequest arg0, HttpServletResponse arg1) throws ServletException , IOException  41 { 42 assertEquals("value", PortalLib.out("key")); 43 } 44 }; 45 46 Context ctx = new DelegateContext(); 47 ctx.put("key", "value"); 48 request.setAttribute(PortalJsp.CTX_REQUEST, ctx); 49 50 jbossJsp.service(request, response); 51 jbossJsp.destroy(); 52 } 53 54 55 56 } 57 | Popular Tags |