Package br.net.woodstock.rockframework.web.struts2

Examples of br.net.woodstock.rockframework.web.struts2.Result


      Object action = invocation.getAction();
      AroundAction a = (AroundAction) action;
      try {
        a.after();
      } catch (Exception e) {
        throw new Struts2Exception(e);
      }
    }
View Full Code Here


      Object action = invocation.getAction();
      AroundAction a = (AroundAction) action;
      try {
        a.after();
      } catch (Exception e) {
        throw new Struts2Exception(e);
      }
    }
View Full Code Here

      String clazzName = this.getInitParameter(ParameterizedResourceFilter.RESOURCE_MANAGER_PARAMETER);
      Class clazz = Class.forName(clazzName);
      ResourceManager resourceManager = (ResourceManager) clazz.newInstance();
      this.setResourceManager(resourceManager);
    } catch (Exception e) {
      throw new Struts2Exception(e);
    }
  }
View Full Code Here

      Object action = invocation.getAction();
      AroundAction a = (AroundAction) action;
      try {
        a.after();
      } catch (Exception e) {
        throw new Struts2Exception(e);
      }
    }
View Full Code Here

      Object action = invocation.getAction();
      AroundAction a = (AroundAction) action;
      try {
        a.after();
      } catch (Exception e) {
        throw new Struts2Exception(e);
      }
    }
View Full Code Here

      Object action = invocation.getAction();
      AroundAction a = (AroundAction) action;
      try {
        a.after();
      } catch (Exception e) {
        throw new Struts2Exception(e);
      }
    }
View Full Code Here

      String clazzName = this.getInitParameter(ParameterizedResourceFilter.RESOURCE_MANAGER_PARAMETER);
      Class clazz = Class.forName(clazzName);
      ResourceManager resourceManager = (ResourceManager) clazz.newInstance();
      this.setResourceManager(resourceManager);
    } catch (Exception e) {
      throw new Struts2Exception(e);
    }
  }
View Full Code Here

        DefaultActionMapper defaultActionMapper = new DefaultActionMapper();
        defaultActionMapper.setContainer(container);
        ActionMapping actionMapping = defaultActionMapper.getMapping(request, configManager);

        Result result = actionMapping.getResult();
        assertNotNull(result);
        assertTrue(result instanceof ServletRedirectResult);

        Mock invMock = new Mock(ActionInvocation.class);
        ActionInvocation inv = (ActionInvocation) invMock.proxy();
        ActionContext ctx = ActionContext.getContext();
        ctx.put(ServletActionContext.HTTP_REQUEST, request);
        StrutsMockHttpServletResponse response = new StrutsMockHttpServletResponse();
        ctx.put(ServletActionContext.HTTP_RESPONSE, response);
        invMock.expectAndReturn("getInvocationContext", ctx);
        invMock.expectAndReturn("getStack", ctx.getValueStack());
        result.execute(inv);
        assertEquals("http://www.google.com", response.getRedirectURL());
        //TODO: need to test location but there's noaccess to the property/method, unless we use reflection
    }
View Full Code Here

                request.setAttribute(ServletActionContext.STRUTS_VALUESTACK_KEY, stack);

                ActionContext savedContext = savedInvocation.getInvocationContext();
                savedContext.getContextMap().put(ServletActionContext.HTTP_REQUEST, request);
                savedContext.getContextMap().put(ServletActionContext.HTTP_RESPONSE, response);
                Result result = savedInvocation.getResult();

                if ((result != null) && (savedInvocation.getProxy().getExecuteResult())) {
                    synchronized (context) {
                        result.execute(savedInvocation);
                    }
                }

                // turn off execution of this invocations result
                invocation.getProxy().setExecuteResult(false);
View Full Code Here

        DefaultActionMapper defaultActionMapper = new DefaultActionMapper();
        defaultActionMapper.setContainer(container);
        ActionMapping actionMapping = defaultActionMapper.getMapping(request, configManager);

        Result result = actionMapping.getResult();
        assertNotNull(result);
        assertTrue(result instanceof ServletRedirectResult);

        Mock invMock = new Mock(ActionInvocation.class);
        ActionInvocation inv = (ActionInvocation) invMock.proxy();
        ActionContext ctx = ActionContext.getContext();
        ctx.put(ServletActionContext.HTTP_REQUEST, request);
        StrutsMockHttpServletResponse response = new StrutsMockHttpServletResponse();
        ctx.put(ServletActionContext.HTTP_RESPONSE, response);
        invMock.expectAndReturn("getInvocationContext", ctx);
        invMock.expectAndReturn("getStack", ctx.getValueStack());
        result.execute(inv);
        assertEquals("http://www.google.com", response.getRedirectURL());
        //TODO: need to test location but there's noaccess to the property/method, unless we use reflection
    }
View Full Code Here

TOP

Related Classes of br.net.woodstock.rockframework.web.struts2.Result

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.