Package org.springframework.webflow.engine

Examples of org.springframework.webflow.engine.ViewState


    assertEquals("baz", exp.getValue(context));
  }

  public void testResolveViewScope() {
    MockRequestControlContext context = new MockRequestControlContext();
    ViewState state = new ViewState(context.getRootFlow(), "view", new StubViewFactory());
    context.setCurrentState(state);
    context.getViewScope().put("foo", "bar");
    Expression exp = parser.parseExpression("foo", new FluentParserContext().evaluate(RequestContext.class));
    assertEquals("bar", exp.getValue(context));
  }
View Full Code Here


    assertEquals("bar", exp.getValue(context));
  }

  public void testSetViewScope() {
    MockRequestControlContext context = new MockRequestControlContext();
    ViewState state = new ViewState(context.getRootFlow(), "view", new StubViewFactory());
    context.setCurrentState(state);
    context.getViewScope().put("foo", "bar");
    Expression exp = parser.parseExpression("foo", new FluentParserContext().evaluate(RequestContext.class));
    exp.setValue(context, "baz");
    assertEquals("baz", exp.getValue(context));
View Full Code Here

    assertEquals("baz", exp.getValue(context));
  }

  public void testResolveViewScope() {
    MockRequestControlContext context = new MockRequestControlContext();
    ViewState state = new ViewState(context.getRootFlow(), "view", new StubViewFactory());
    context.setCurrentState(state);
    context.getViewScope().put("foo", "bar");
    Expression exp = parser.parseExpression("foo", new FluentParserContext().evaluate(RequestContext.class));
    assertEquals("bar", exp.getValue(context));
  }
View Full Code Here

    assertEquals("bar", exp.getValue(context));
  }

  public void testSetViewScope() {
    MockRequestControlContext context = new MockRequestControlContext();
    ViewState state = new ViewState(context.getRootFlow(), "view", new StubViewFactory());
    context.setCurrentState(state);
    context.getViewScope().put("foo", "bar");
    Expression exp = parser.parseExpression("foo", new FluentParserContext().evaluate(RequestContext.class));
    exp.setValue(context, "baz");
    assertEquals("baz", exp.getValue(context));
View Full Code Here

  public void testGetFlowExecutorBasicConfig() throws Exception {
    factoryBean.setFlowDefinitionLocator(new FlowDefinitionLocator() {
      public FlowDefinition getFlowDefinition(String id) throws NoSuchFlowDefinitionException,
          FlowDefinitionConstructionException {
        Flow flow = new Flow(id);
        ViewState view = new ViewState(flow, "view", new StubViewFactory());
        view.getTransitionSet().add(new Transition(new DefaultTargetStateResolver("end")));
        new EndState(flow, "end");
        return flow;
      }
    });
    factoryBean.afterPropertiesSet();
View Full Code Here

  public void testGetFlowExecutorOptionsSpecified() throws Exception {
    factoryBean.setFlowDefinitionLocator(new FlowDefinitionLocator() {
      public FlowDefinition getFlowDefinition(String id) throws NoSuchFlowDefinitionException,
          FlowDefinitionConstructionException {
        Flow flow = new Flow(id);
        ViewState view = new ViewState(flow, "view", new StubViewFactory());
        view.getTransitionSet().add(new Transition(new DefaultTargetStateResolver("end")));
        new EndState(flow, "end");
        return flow;
      }
    });
    Set<FlowElementAttribute> attributes = new HashSet<FlowElementAttribute>();
View Full Code Here

    actual = accessor.read(new StandardEvaluationContext(), requestContext, "myBean");
    assertSame(bean, actual.getValue());
  }

  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("Not implemented");
          }
        }));
View Full Code Here

   * @return the fully initialized view state instance
   */
  public State createViewState(String id, Flow flow, ViewVariable[] variables, Action[] entryActions,
      ViewFactory viewFactory, Boolean redirect, boolean popup, Action[] renderActions, Transition[] transitions,
      FlowExecutionExceptionHandler[] exceptionHandlers, Action[] exitActions, AttributeMap<?> attributes) {
    ViewState viewState = new ViewState(flow, id, viewFactory);
    viewState.addVariables(variables);
    viewState.setRedirect(redirect);
    viewState.setPopup(popup);
    viewState.getRenderActionList().addAll(renderActions);
    configureCommonProperties(viewState, entryActions, transitions, exceptionHandlers, exitActions, attributes);
    return viewState;
  }
View Full Code Here

TOP

Related Classes of org.springframework.webflow.engine.ViewState

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.