Examples of ViewState


Examples of org.springframework.webflow.engine.ViewState

    applicationContext.getBeanFactory().registerSingleton("modelValidator", validator);
    requestContext.getRootFlow().setApplicationContext(applicationContext);

    Object model = new Object();
    ValidationHelper helper = new ValidationHelper(model, requestContext, eventId, modelName, null, null);
    ViewState state1 = new ViewState(requestContext.getRootFlow(), "state2", new StubViewFactory());
    requestContext.setCurrentState(state1);
    helper.validate();
    assertFalse(validator.state1Invoked);
    assertTrue(validator.fallbackInvoked);
  }
View Full Code Here

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

Examples of org.springframework.webflow.engine.ViewState

    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

Examples of org.springframework.webflow.engine.ViewState

  private Map model;

  public void testRender() throws Exception {
    MockRequestControlContext context = new MockRequestControlContext();
    context.setCurrentState(new ViewState(context.getRootFlow(), "test", new StubViewFactory()));
    context.getRequestScope().put("foo", "bar");
    context.getFlowScope().put("bar", "baz");
    context.getFlowScope().put("bindBean", new BindBean());
    context.getConversationScope().put("baz", "boop");
    context.getFlashScope().put("boop", "bing");
View Full Code Here

Examples of org.springframework.webflow.engine.ViewState

    assertNull(model.get(BindingResult.MODEL_KEY_PREFIX + "bindBean"));
  }

  public void testRenderWithBindingModel() throws Exception {
    MockRequestControlContext context = new MockRequestControlContext();
    context.setCurrentState(new ViewState(context.getRootFlow(), "test", new StubViewFactory()));
    Object bindBean = new BindBean();
    StaticExpression modelObject = new StaticExpression(bindBean);
    modelObject.setExpressionString("bindBean");
    context.getCurrentState().getAttributes().put("model", modelObject);
    context.getFlowScope().put("bindBean", bindBean);
View Full Code Here

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

Examples of org.springframework.webflow.engine.ViewState

    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

Examples of org.springframework.webflow.engine.ViewState

  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

Examples of org.springframework.webflow.engine.ViewState

  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 attributes = new HashSet();
View Full Code Here

Examples of org.springframework.webflow.engine.ViewState

    context.getELResolver().setValue(context, null, getBaseVariable(), null);
    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
TOP
Copyright © 2018 www.massapi.com. 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.