Package org.springframework.webflow.execution

Examples of org.springframework.webflow.execution.ViewFactory


  public void testViewStateFlowRedirect() {
    ViewStateModel state = new ViewStateModel("view");
    state.setView("flowRedirect:myFlow?input=#{flowScope.foo}");
    model.setStates(singleList(state));
    Flow flow = getFlow(model);
    ViewFactory vf = ((ViewState) flow.getStateInstance("view")).getViewFactory();
    assertTrue(vf instanceof ActionExecutingViewFactory);
    ActionExecutingViewFactory avf = (ActionExecutingViewFactory) vf;
    assertTrue(avf.getAction() instanceof FlowDefinitionRedirectAction);
  }
View Full Code Here


  public void testViewStateExternalRedirect() {
    ViewStateModel state = new ViewStateModel("view");
    state.setView("externalRedirect:http://www.paypal.com?_callbackUrl=#{flowExecutionUri}");
    model.setStates(singleList(state));
    Flow flow = getFlow(model);
    ViewFactory vf = ((ViewState) flow.getStateInstance("view")).getViewFactory();
    assertTrue(vf instanceof ActionExecutingViewFactory);
    ActionExecutingViewFactory avf = (ActionExecutingViewFactory) vf;
    assertTrue(avf.getAction() instanceof ExternalRedirectAction);
  }
View Full Code Here

      mapping.setRequired(required);
    }
  }

  private void parseAndAddViewState(ViewStateModel state, Flow flow) {
    ViewFactory viewFactory = parseViewFactory(state.getView(), state.getId(), false, state.getBinder());
    Boolean redirect = null;
    if (StringUtils.hasText(state.getRedirect())) {
      redirect = (Boolean) fromStringTo(Boolean.class).execute(state.getRedirect());
    }
    boolean popup = false;
View Full Code Here

    if (StringUtils.hasText(state.getCommit())) {
      attributes.put("commit", fromStringTo(Boolean.class).execute(state.getCommit()));
    }
    parseAndPutSecured(state.getSecured(), attributes);
    Action finalResponseAction;
    ViewFactory viewFactory = parseViewFactory(state.getView(), state.getId(), true, null);
    if (viewFactory != null) {
      finalResponseAction = new ViewFactoryActionAdapter(viewFactory);
    } else {
      finalResponseAction = null;
    }
View Full Code Here

    assertFalse("setValue should be a no-op when no flow is active", context.isPropertyResolved());
  }

  protected void initView(MockRequestContext requestContext) {
    ((MockFlowSession) requestContext.getFlowExecutionContext().getActiveSession()).setState(new ViewState(
        requestContext.getRootFlow(), "view", new ViewFactory() {
          public View getView(RequestContext context) {
            throw new UnsupportedOperationException("Auto-generated method stub");
          }
        }));
  }
View Full Code Here

  }

  private class MockViewState extends ViewState {

    public MockViewState() {
      super(new Flow("mockFlow"), "mockView", new ViewFactory() {

        public View getView(RequestContext context) {
          // TODO Auto-generated method stub
          throw new UnsupportedOperationException("Auto-generated method stub");
        }
View Full Code Here

    assertFalse("setValue should be a no-op when no flow is active", context.isPropertyResolved());
  }

  protected void initView(MockRequestContext requestContext) {
    ((MockFlowSession) requestContext.getFlowExecutionContext().getActiveSession()).setState(new ViewState(
        requestContext.getRootFlow(), "view", new ViewFactory() {
          public View getView(RequestContext context) {
            throw new UnsupportedOperationException("Auto-generated method stub");
          }
        }));
  }
View Full Code Here

  }

  private class MockViewState extends ViewState {

    public MockViewState() {
      super(new Flow("mockFlow"), "mockView", new ViewFactory() {

        public View getView(RequestContext context) {
          throw new UnsupportedOperationException();
        }
      });
View Full Code Here

    this.flow = new FlowResponseStateManager(this.root);
    this.manager = new MyFacesFlowResponseStateManager(this.flow);
    this.requestContext = new MockRequestContext();
    MockFlowExecutionContext executionContext = requestContext.getMockFlowExecutionContext();
    MockFlowSession session = executionContext.getMockActiveSession();
    ViewFactory viewFactory = EasyMock.createNiceMock(ViewFactory.class);
    session.setState(new ViewState(session.getDefinitionInternal(), "view", viewFactory));
    executionContext.setKey(new MockFlowExecutionKey("x"));
    RequestContextHolder.setRequestContext(requestContext);
  }
View Full Code Here

  public void testViewStateFlowRedirect() {
    ViewStateModel state = new ViewStateModel("view");
    state.setView("flowRedirect:myFlow?input=#{flowScope.foo}");
    model.setStates(asList(AbstractStateModel.class, state));
    Flow flow = getFlow(model);
    ViewFactory vf = ((ViewState) flow.getStateInstance("view")).getViewFactory();
    assertTrue(vf instanceof ActionExecutingViewFactory);
    ActionExecutingViewFactory avf = (ActionExecutingViewFactory) vf;
    assertTrue(avf.getAction() instanceof FlowDefinitionRedirectAction);
  }
View Full Code Here

TOP

Related Classes of org.springframework.webflow.execution.ViewFactory

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.