Examples of ForwardConfig


Examples of org.apache.struts.config.ForwardConfig

        customSub.setName("failure");
        customSub.setExtends("success");
        moduleConfig.addForwardConfig(customSub);

        ForwardConfig result =
            actionServlet.processForwardConfigClass(customSub, moduleConfig);

        assertTrue("Incorrect class of forward config",
            result instanceof CustomForwardConfig);
        assertEquals("Incorrect name", customSub.getName(), result.getName());
        assertEquals("Incorrect path", customSub.getPath(), result.getPath());
        assertEquals("Incorrect extends", customSub.getExtends(),
            result.getExtends());

        assertSame("Result was not registered in the module config", result,
            moduleConfig.findForwardConfig("failure"));
    }
View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

     */
    public void testProcessForwardConfigClassNoExtends()
        throws Exception {
        moduleConfig.addForwardConfig(baseForward);

        ForwardConfig result = null;

        try {
            result =
                actionServlet.processForwardConfigClass(baseForward,
                    moduleConfig);
View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

     */
    public void testProcessForwardConfigClassSubConfigCustomClass()
        throws Exception {
        moduleConfig.addForwardConfig(baseForward);

        ForwardConfig customSub = new ActionForward();

        customSub.setName("failure");
        customSub.setExtends("success");
        moduleConfig.addForwardConfig(customSub);

        ForwardConfig result =
            actionServlet.processForwardConfigClass(customSub, moduleConfig);

        assertSame("The instance returned should be the param given it.",
            customSub, result);
    }
View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

     * Make sure the code throws the correct exception when it can't create an
     * instance of the base config's custom class.
     */
    public void notestProcessForwardConfigClassError()
        throws Exception {
        ForwardConfig customBase =
            new CustomForwardConfigArg("success", "/success.jsp");

        moduleConfig.addForwardConfig(customBase);

        ForwardConfig customSub = new ActionForward();

        customSub.setName("failure");
        customSub.setExtends("success");
        moduleConfig.addForwardConfig(customSub);

        try {
            actionServlet.processForwardConfigClass(customSub, moduleConfig);
            fail("Exception should be thrown");
View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

     */
    public void testProcessForwardConfigClassOverriddenSubConfigClass()
        throws Exception {
        moduleConfig.addForwardConfig(baseForward);

        ForwardConfig customSub =
            new CustomForwardConfigArg("failure", "/failure.jsp");

        customSub.setExtends("success");
        moduleConfig.addForwardConfig(customSub);

        try {
            actionServlet.processForwardConfigClass(customSub, moduleConfig);
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

    protected void tearDown() {
    }

    public void testNullForwardPath()
        throws Exception {
        ForwardConfig config = new ForwardConfig();

        config.setPath(null);

        try {
            command.perform(saContext, config);
            fail(
                "Didn't throw an illegal argument exception on null forward path");
View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

    // Default module (default forwardPattern)
    public void testForwardURL1() {
        request.setAttribute(Globals.MODULE_KEY, moduleConfig);
        request.setPathElements("/myapp", "/action.do", null, null);

        ForwardConfig forward = null;
        String result = null;

        // redirect=false, module=null
        forward = moduleConfig.findForwardConfig("moduleForward");
        assertNotNull("moduleForward found", forward);
View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

    // Second module (default forwardPattern)
    public void testForwardURL2() {
        request.setAttribute(Globals.MODULE_KEY, moduleConfig2);
        request.setPathElements("/myapp", "/2/action.do", null, null);

        ForwardConfig forward = null;
        String result = null;

        // redirect=false, module=null
        forward = moduleConfig2.findForwardConfig("moduleForward");
        assertNotNull("moduleForward found", forward);
View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

    // Third module (custom forwardPattern)
    public void testForwardURL3() {
        request.setAttribute(Globals.MODULE_KEY, moduleConfig3);
        request.setPathElements("/myapp", "/3/action.do", null, null);

        ForwardConfig forward = null;
        String result = null;

        // redirect=false, module=null
        forward = moduleConfig3.findForwardConfig("moduleForward");
        assertNotNull("moduleForward found", forward);
View Full Code Here

Examples of org.apache.struts.config.ForwardConfig

    // Cross module forwards
    public void testForwardURLa() {
        request.setAttribute(Globals.MODULE_KEY, moduleConfig);
        request.setPathElements("/myapp", "/action.do", null, null);

        ForwardConfig forward = null;
        String result = null;

        // redirect=false, contextRelative=false, link to module 3
        forward = moduleConfig3.findForwardConfig("moduleForward");
        assertNotNull("moduleForward found", forward);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.