Package org.apache.myfaces.test.mock

Examples of org.apache.myfaces.test.mock.MockStateManager


    /*
     * Test method for 'javax.faces.application.StateManager.isSavingStateInClient(FacesContext)'
     */
    public void testNullThrowsIsSavingStateInClient()
    {
        MockStateManager subject = new MockStateManager();
        try
        {
            subject.isSavingStateInClient(null);
            fail("should have thrown an exception");
        }
        catch (RuntimeException e)
        {
        }
View Full Code Here


        contextControl.replay();
        external.getInitParameter(StateManager.STATE_SAVING_METHOD_PARAM_NAME);
        externalControl.setReturnValue("client");
        externalControl.replay();

        MockStateManager subject = new MockStateManager();
        assertEquals(true, subject.isSavingStateInClient(context));
    }
View Full Code Here

        contextControl.replay();
        external.getInitParameter(StateManager.STATE_SAVING_METHOD_PARAM_NAME);
        externalControl.setReturnValue("server");
        externalControl.replay();

        MockStateManager subject = new MockStateManager();
        assertEquals(false, subject.isSavingStateInClient(context));
        // calling a second time asserts that the code is caching the value correctly
        assertEquals(false, subject.isSavingStateInClient(context));
    }
View Full Code Here

        externalControl.setReturnValue("blorf");
        external.log("Illegal state saving method 'blorf', default server state saving will be used");
        externalControl.setVoidCallable();
        externalControl.replay();

        MockStateManager subject = new MockStateManager();
        assertEquals(false, subject.isSavingStateInClient(context));
    }
View Full Code Here

        externalControl.setReturnValue(null);
        external.log("No state saving method defined, assuming default server state saving");
        externalControl.setVoidCallable();
        externalControl.replay();

        MockStateManager subject = new MockStateManager();
        assertEquals(false, subject.isSavingStateInClient(context));
    }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.test.mock.MockStateManager

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.