Search in sources :

Example 21 with MockFormBean

use of org.apache.struts.mock.MockFormBean in project sonarqube by SonarSource.

the class TestTagUtils method test_Object_lookup_PageContext_String__String1.

// -- public Object lookup(PageContext pageContext, String name, String scopeName)
// lookup with null scope
public void test_Object_lookup_PageContext_String__String1() {
    pageContext.setAttribute("bean", new MockFormBean());
    try {
        Object val = tagutils.lookup(pageContext, "bean", null);
        assertNotNull((val));
    } catch (JspException e) {
        fail("bean not found:" + e.getMessage());
    }
}
Also used : JspException(javax.servlet.jsp.JspException) MockFormBean(org.apache.struts.mock.MockFormBean)

Aggregations

MockFormBean (org.apache.struts.mock.MockFormBean)21 JspException (javax.servlet.jsp.JspException)15 HashMap (java.util.HashMap)8 Map (java.util.Map)8 ActionForm (org.apache.struts.action.ActionForm)5 DynaActionForm (org.apache.struts.action.DynaActionForm)5 ActionMapping (org.apache.struts.action.ActionMapping)3 ActionMessages (org.apache.struts.action.ActionMessages)2 ServletException (javax.servlet.ServletException)1 MockMultipartRequestHandler (org.apache.struts.mock.MockMultipartRequestHandler)1