KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > webwork > views > jsp > ui > JspTemplateTest


1 package com.opensymphony.webwork.views.jsp.ui;
2
3 import com.mockobjects.dynamic.C;
4 import com.mockobjects.dynamic.Mock;
5 import com.opensymphony.webwork.TestAction;
6 import com.opensymphony.webwork.views.jsp.AbstractUITagTest;
7
8 import javax.servlet.RequestDispatcher JavaDoc;
9 import javax.servlet.http.HttpServletRequest JavaDoc;
10 import javax.servlet.http.HttpServletResponse JavaDoc;
11
12 /**
13  * JspTemplateTest
14  * Date: Sep 29, 2004 12:14:34 PM
15  *
16  * @author jcarreira
17  */

18 public class JspTemplateTest extends AbstractUITagTest {
19     public void testCheckBox() throws Exception JavaDoc {
20         TestAction testAction = (TestAction) action;
21         testAction.setFoo("true");
22
23         CheckboxTag tag = new CheckboxTag();
24         Mock rdMock = new Mock(RequestDispatcher JavaDoc.class);
25         rdMock.expect("include",C.args(C.isA(HttpServletRequest JavaDoc.class), C.isA(HttpServletResponse JavaDoc.class)));
26         RequestDispatcher JavaDoc dispatcher = (RequestDispatcher JavaDoc) rdMock.proxy();
27         request.setupGetRequestDispatcher(dispatcher);
28         tag.setPageContext(pageContext);
29         tag.setTemplate("/test/checkbox.jsp");
30         tag.doStartTag();
31         tag.doEndTag();
32         rdMock.verify();
33     }
34 }
35
Popular Tags