public void testStrutsScope() throws JspException { tag.setName("foo"); tag.setValue("name"); tag.doStartTag(); tag.doEndTag(); assertEquals("chewie", context.get("foo")); }
public void testRequestScope() throws JspException { tag.setName("foo"); tag.setValue("name"); tag.setScope("request"); tag.doStartTag(); tag.doEndTag(); assertEquals("chewie", request.getAttribute("foo")); }
public void testSessionScope() throws JspException { tag.setName("foo"); tag.setValue("name"); tag.setScope("session"); tag.doStartTag(); tag.doEndTag(); assertEquals("chewie", session.get("foo")); }
public void testPageScope() throws JspException { tag.setName("foo"); tag.setValue("name"); tag.setScope("page"); tag.doStartTag(); tag.doEndTag(); assertEquals("chewie", pageContext.getAttribute("foo")); }
public void testApplicationScope() throws JspException { tag.setName("foo"); tag.setValue("name"); tag.setScope("application"); tag.doStartTag(); tag.doEndTag(); assertEquals("chewie", servletContext.getAttribute("foo")); }
protected void setUp() throws Exception { super.setUp(); tag = new SetTag(); chewie = new Chewbacca("chewie", true); stack.push(chewie); tag.setPageContext(pageContext); }