Package com.opensymphony.xwork2.mock

Examples of com.opensymphony.xwork2.mock.MockActionProxy


    public void testInvalidAliasExpression() throws Exception {
        Action action = new SimpleFooAction();
        MockActionInvocation mai = new MockActionInvocation();

        MockActionProxy map = new MockActionProxy();

        ActionConfig cfg = new ActionConfig.Builder("", "", "")
                .addParam("aliases", "invalid alias expression")
                .build();
        map.setConfig(cfg);

        mai.setProxy(map);
        mai.setAction(action);
        mai.setInvocationContext(ActionContext.getContext());
View Full Code Here


    public void testSetAliasKeys() throws Exception {
        Action action = new SimpleFooAction();
        MockActionInvocation mai = new MockActionInvocation();

        MockActionProxy map = new MockActionProxy();

        ActionConfig cfg = new ActionConfig.Builder("", "", "")
                .addParam("hello", "invalid alias expression")
                .build();
        map.setConfig(cfg);

        mai.setProxy(map);
        mai.setAction(action);
        mai.setInvocationContext(ActionContext.getContext());
View Full Code Here

    public void testSetInvalidAliasKeys() throws Exception {
        Action action = new SimpleFooAction();
        MockActionInvocation mai = new MockActionInvocation();

        MockActionProxy map = new MockActionProxy();

        ActionConfig cfg = new ActionConfig.Builder("", "", "")
                .addParam("hello", "invalid alias expression")
                .build();
        map.setConfig(cfg);

        mai.setProxy(map);
        mai.setAction(action);
        mai.setInvocationContext(ActionContext.getContext());
View Full Code Here

        super.setUp();
        interceptor = new MyTimerInterceptor();
        interceptor.init();

        mai = new MockActionInvocation();
        ap = new MockActionProxy();
        ap.setActionName("myAction");
        ap.setNamespace("myApp");
        ap.setMethod("execute");
        mai.setAction(new SimpleFooAction());
        mai.setProxy(ap);
View Full Code Here

    public void testScopedModelDrivenAction() throws Exception {
        inter.setScope("request");

        ScopedModelDriven action = new MyUserScopedModelDrivenAction();
        MockActionInvocation mai = new MockActionInvocation();
        MockActionProxy map = new MockActionProxy();
        ActionConfig ac = new ActionConfig.Builder("", "", "").build();
        map.setConfig(ac);
        mai.setAction(action);
        mai.setProxy(map);

        inter.intercept(mai);
        inter.destroy();
View Full Code Here

        inter.setClassName("com.opensymphony.xwork2.test.Equidae");
        inter.setName("queen");

        ScopedModelDriven action = new MyEquidaeScopedModelDrivenAction();
        MockActionInvocation mai = new MockActionInvocation();
        MockActionProxy map = new MockActionProxy();
        ActionConfig ac = new ActionConfig.Builder("", "", "").build();
        map.setConfig(ac);
        mai.setAction(action);
        mai.setProxy(map);

        inter.intercept(mai);
        inter.destroy();
View Full Code Here

        ActionContext.getContext().setSession(session);
        ActionContext.getContext().getSession().put("king", user);

        ScopedModelDriven action = new MyUserScopedModelDrivenAction();
        MockActionInvocation mai = new MockActionInvocation();
        MockActionProxy map = new MockActionProxy();
        ActionConfig ac = new ActionConfig.Builder("", "", "").build();
        map.setConfig(ac);
        mai.setAction(action);
        mai.setProxy(map);

        inter.intercept(mai);
        inter.destroy();
View Full Code Here

            MockInterceptor mockInterceptor = new MockInterceptor();
            mockInterceptor.setFoo("interceptor");
            mockInterceptor.setExpectedFoo("interceptor");
            interceptorMappings.add(new InterceptorMapping("interceptor", mockInterceptor));
            interceptors = interceptorMappings.iterator();
            MockActionProxy actionProxy = new MockActionProxy();
            ActionConfig actionConfig = new ActionConfig.Builder("org.apache.rest",
            "RestAction", "org.apache.rest.RestAction").build();
            actionProxy.setConfig(actionConfig);
            proxy = actionProxy;
            action = new RestAction();
            setMimeTypeHandlerSelector(new DefaultContentTypeHandlerManager());
            unknownHandlerManager = new DefaultUnknownHandlerManager();
      try {
View Full Code Here

            MockInterceptor mockInterceptor = new MockInterceptor();
            mockInterceptor.setFoo("interceptor");
            mockInterceptor.setExpectedFoo("interceptor");
            interceptorMappings.add(new InterceptorMapping("interceptor", mockInterceptor));
            interceptors = interceptorMappings.iterator();
            MockActionProxy actionProxy = new MockActionProxy();
            ActionConfig actionConfig = new ActionConfig.Builder("org.apache.rest",
            "RestAction", "org.apache.rest.RestAction").build();
            actionProxy.setConfig(actionConfig);
            proxy = actionProxy;
            action = new RestAction();
            setMimeTypeHandlerSelector(new DefaultContentTypeHandlerManager());
            unknownHandlerManager = new DefaultUnknownHandlerManager();
      try {
View Full Code Here

        servletContext.setAttribute(FreemarkerManager.CONFIG_SERVLET_CONTEXT_KEY, null);

        invocation = new MockActionInvocation();
        invocation.setStack(stack);
        invocation.setInvocationContext(context);
        invocation.setProxy(new MockActionProxy());
        servletContext.setRealPath(new File(FreeMarkerResultTest.class.getResource(
                "someFreeMarkerFile.ftl").toURI()).toURL().getFile());
    }
View Full Code Here

TOP

Related Classes of com.opensymphony.xwork2.mock.MockActionProxy

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.