01: package com.opensymphony.webwork.views.jsp.ui;
02:
03: import com.mockobjects.dynamic.C;
04: import com.mockobjects.dynamic.Mock;
05: import com.opensymphony.webwork.TestAction;
06: import com.opensymphony.webwork.views.jsp.AbstractUITagTest;
07:
08: import javax.servlet.RequestDispatcher;
09: import javax.servlet.http.HttpServletRequest;
10: import javax.servlet.http.HttpServletResponse;
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 {
20: TestAction testAction = (TestAction) action;
21: testAction.setFoo("true");
22:
23: CheckboxTag tag = new CheckboxTag();
24: Mock rdMock = new Mock(RequestDispatcher.class);
25: rdMock.expect("include", C.args(
26: C.isA(HttpServletRequest.class), C
27: .isA(HttpServletResponse.class)));
28: RequestDispatcher dispatcher = (RequestDispatcher) rdMock
29: .proxy();
30: request.setupGetRequestDispatcher(dispatcher);
31: tag.setPageContext(pageContext);
32: tag.setTemplate("/test/checkbox.jsp");
33: tag.doStartTag();
34: tag.doEndTag();
35: rdMock.verify();
36: }
37: }
|