KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > test > core > OutELTestCase


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  *****************************************/

9 package org.jboss.portal.test.core;
10
11 import java.io.IOException JavaDoc;
12
13 import javax.servlet.ServletException JavaDoc;
14 import javax.servlet.http.HttpServletRequest JavaDoc;
15 import javax.servlet.http.HttpServletResponse JavaDoc;
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 /**
24  * Test the out EL
25  * @author <a HREF="theute@jboss.org">Thomas Heute</a>
26  * $Revision: 1.1 $
27  */

28 public class OutELTestCase
29       extends JspTestCase
30 {
31
32    public void test01() throws ServletException JavaDoc, IOException JavaDoc {
33       /**
34       ServletRequest request = new HttpServletRequestImpl();
35       ServletResponse response = new HttpServletResponseImpl();
36     */

37       
38       PortalJsp jbossJsp = new PortalJsp()
39       {
40          public void _jspService(HttpServletRequest JavaDoc arg0, HttpServletResponse JavaDoc arg1) throws ServletException JavaDoc, IOException JavaDoc
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