Methods Summary |
---|
protected void | setUp()
super.setUp();
stack = ValueStackFactory.getFactory().createValueStack();
jspWriter = new MockJspWriter();
StrutsMockHttpServletRequest request = new StrutsMockHttpServletRequest();
StrutsMockServletContext servletContext = new StrutsMockServletContext();
servletContext.setServletInfo("not-weblogic");
pageContext = new MockPageContext();
pageContext.setJspWriter(jspWriter);
pageContext.setRequest(request);
pageContext.setServletContext(servletContext);
request.setAttribute(ServletActionContext.STRUTS_VALUESTACK_KEY, stack);
|
public void | testIfIsFalseElseIfIsFalse()
stack.getContext().put(If.ANSWER, Boolean.FALSE);
ElseIfTag tag = new ElseIfTag();
tag.setPageContext(pageContext);
tag.setTest("false");
int result = tag.doStartTag();
tag.doEndTag();
assertEquals(result, TagSupport.SKIP_BODY);
|
public void | testIfIsFalseElseIfIsTrue()
stack.getContext().put(If.ANSWER, Boolean.FALSE);
ElseIfTag tag = new ElseIfTag();
tag.setPageContext(pageContext);
tag.setTest("true");
int result = tag.doStartTag();
tag.doEndTag();
assertEquals(result, TagSupport.EVAL_BODY_INCLUDE);
|
public void | testIfIsTrueElseIfIsFalse()
stack.getContext().put(If.ANSWER, Boolean.TRUE);
ElseIfTag tag = new ElseIfTag();
tag.setPageContext(pageContext);
tag.setTest("false");
int result = tag.doStartTag();
tag.doEndTag();
assertEquals(result, TagSupport.SKIP_BODY);
|
public void | testIfIsTrueElseIfIsTrue()
stack.getContext().put(If.ANSWER, Boolean.TRUE);
ElseIfTag tag = new ElseIfTag();
tag.setPageContext(pageContext);
tag.setTest("true");
int result = tag.doStartTag();
tag.doEndTag();
assertEquals(result, TagSupport.SKIP_BODY);
|