Package org.apache.struts.mock

Examples of org.apache.struts.mock.MockFormBean


            assertNull("map is null", map);
        }
    }

    public void testComputeParametersParamIdParamPropThrowException() {
        request.getSession().setAttribute("SomeBean", new MockFormBean(true));

        Map map = null;

        try {
            map = tagutils.computeParameters(pageContext, "paramId",
View Full Code Here


        }
    }

    public void testComputeParametersParamValueToString() {
        request.getSession().setAttribute("SomeBean",
            new MockFormBean(false, false, new Double(1)));

        Map map = null;

        try {
            map = tagutils.computeParameters(pageContext, "paramId",
View Full Code Here

        assertEquals("Parameter value", "bar", (String) map.get("foo"));
    }

    // Single parameter -- scope + name + property
    public void testComputeParameters1c() {
        request.setAttribute("attr", new MockFormBean("bar"));

        Map map = null;

        try {
            map = tagutils.computeParameters(pageContext, "foo", "attr",
View Full Code Here

        assertEquals("Parameter foo2 value", "bar2", (String) map.get("foo2"));
    }

    // Provided map -- scope + name + property
    public void testComputeParameters2c() {
        request.setAttribute("attr", new MockFormBean());

        Map map = null;

        try {
            map = tagutils.computeParameters(pageContext, null, null, null,
View Full Code Here

        assertEquals("Values count", 2, values.length);
    }

    // Kitchen sink combination of parameters with a merge
    public void testComputeParameters3a() {
        request.setAttribute("attr", new MockFormBean("bar3"));
        request.getSession().setAttribute(Globals.TRANSACTION_TOKEN_KEY, "token");

        Map map = null;

        try {
View Full Code Here

    }

    // Kitchen sink combination of parameters with a merge
    // with array values in map
    public void testComputeParameters3aa() {
        request.setAttribute("attr", new MockFormBean("bar3"));
        request.getSession().setAttribute(Globals.TRANSACTION_TOKEN_KEY, "token");

        Map map = null;

        try {
View Full Code Here

            (String) map.get(Constants.TOKEN_KEY));
    }

    // Kitchen sink combination of parameters with a merge
    public void testComputeParameters3b() {
        request.setAttribute("attr", new MockFormBean("bar3"));
        request.getSession().setAttribute(Globals.TRANSACTION_TOKEN_KEY, "token");

        Map map = null;

        try {
View Full Code Here

        }
    }

    // String Array (thrown JspException)
    public void testGetActionErrors1d() {
        request.setAttribute("foo", new MockFormBean());

        ActionMessages errors = null;

        try {
            errors = tagutils.getActionMessages(pageContext, "foo");
View Full Code Here

        }
    }

    // String Array (thrown JspException)
    public void testActionMessages_getActionMessages_PageContext_String5() {
        request.setAttribute("foo", new MockFormBean());

        ActionMessages messages = null;

        try {
            messages = tagutils.getActionMessages(pageContext, "foo");
View Full Code Here

    }

    // -- 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));
View Full Code Here

TOP

Related Classes of org.apache.struts.mock.MockFormBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.