FileDocCategorySizeDatePackage
BeanTagTest.javaAPI DocExample1766Mon Jul 23 13:26:16 BST 2007org.apache.struts2.views.jsp

BeanTagTest

public class BeanTagTest extends AbstractUITagTest

Fields Summary
Constructors Summary
Methods Summary
public voidtestSimple()

        BeanTag tag = new BeanTag();
        tag.setPageContext(pageContext);
        tag.setName("org.apache.struts2.TestAction");

        try {
            tag.doStartTag();
            tag.component.addParameter("result", "success");

            assertEquals("success", stack.findValue("result"));
            // TestAction from bean tag, Action from execution and DefaultTextProvider
            assertEquals(3, stack.size());
            tag.doEndTag();
            assertEquals(2, stack.size());
        } catch (JspException ex) {
            ex.printStackTrace();
            fail();
        }

        request.verify();
        pageContext.verify();