Package org.apache.struts.config

Examples of org.apache.struts.config.ActionConfig


        assertFalse(result);
    }

    public void testAuthorizeOneOfManyRoles()
        throws Exception {
        ActionConfig config = new ActionConfig();

        config.setPath("/testAuthorizeOneOfManyRoles");
        config.setRoles("administrator,roustabout,memory");
        this.saContext.setActionConfig(config);

        boolean result = command.execute(saContext);

        assertFalse(result);
View Full Code Here


        assertFalse(result);
    }

    public void testAuthorizeNoRoles()
        throws Exception {
        ActionConfig config = new ActionConfig();

        config.setPath("/testAuthorizeNoRoles");
        this.saContext.setActionConfig(config);

        boolean result = command.execute(saContext);

        assertFalse(result);
View Full Code Here

        assertFalse(result);
    }

    public void testNotAuthorizedOneRole()
        throws Exception {
        ActionConfig config = new ActionConfig();

        config.setPath("/testNotAuthorizedOneRole");
        config.setRoles("roustabout");
        this.saContext.setActionConfig(config);

        try {
            boolean result = command.execute(saContext);
        } catch (UnauthorizedActionException ex) {
View Full Code Here

        }
    }

    public void testNotAuthorizedOneOfManyRoles()
        throws Exception {
        ActionConfig config = new ActionConfig();

        config.setPath("/testNotAuthorizedOneOfManyRoles");
        config.setRoles("roustabout,memory");
        this.saContext.setActionConfig(config);

        try {
            boolean result = command.execute(saContext);
        } catch (UnauthorizedActionException ex) {
View Full Code Here

        customSub.setPath("/sub");
        customSub.setExtends("/base");
        moduleConfig.addActionConfig(customSub);

        ActionConfig result =
            actionServlet.processActionConfigClass(customSub, moduleConfig);

        assertTrue("Incorrect class of action config",
            result instanceof CustomActionConfig);
        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.findActionConfig("/sub"));
    }
View Full Code Here

     */
    public void testProcessActionConfigClassNoExtends()
        throws Exception {
        moduleConfig.addActionConfig(baseAction);

        ActionConfig result = null;

        try {
            result =
                actionServlet.processActionConfigClass(baseAction, moduleConfig);
        } catch (UnavailableException e) {
View Full Code Here

     */
    public void testProcessActionConfigClassSubConfigCustomClass()
        throws Exception {
        moduleConfig.addActionConfig(baseAction);

        ActionConfig customSub = new ActionMapping();

        customSub.setPath("/sub");
        customSub.setExtends("/index");
        moduleConfig.addActionConfig(customSub);

        ActionConfig result =
            actionServlet.processActionConfigClass(customSub, moduleConfig);

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

     * Make sure the code throws the correct exception when it can't create an
     * instance of the base config's custom class.
     */
    public void notestProcessActionConfigClassError()
        throws Exception {
        ActionConfig customBase = new CustomActionConfigArg("/index");

        moduleConfig.addActionConfig(customBase);

        ActionConfig customSub = new ActionMapping();

        customSub.setPath("/sub");
        customSub.setExtends("/index");
        moduleConfig.addActionConfig(customSub);

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

     */
    public void testProcessActionConfigClassOverriddenSubConfigClass()
        throws Exception {
        moduleConfig.addActionConfig(baseAction);

        ActionConfig customSub = new CustomActionConfigArg("/sub");

        customSub.setExtends("/index");
        moduleConfig.addActionConfig(customSub);

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

        verifyBadSetOfSpecifiers(null, null, "foo", "foo");
    }

    public void testComputeURLCharacterEncodingAction() {
        ActionConfig actionConfig = new ActionConfig();

        actionConfig.setName("baz");
        actionConfig.setPath("/baz");

        moduleConfig.addActionConfig(actionConfig);

        request.setPathElements("/myapp", "/foo.do", null, null);
View Full Code Here

TOP

Related Classes of org.apache.struts.config.ActionConfig

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.