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 ; 9 import javax.servlet.http.HttpServletRequest ; 10 import javax.servlet.http.HttpServletResponse ; 11 12 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(C.isA(HttpServletRequest .class), C.isA(HttpServletResponse .class))); 26 RequestDispatcher dispatcher = (RequestDispatcher ) 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 |