Package org.springframework.webflow.engine

Examples of org.springframework.webflow.engine.ViewState


    requestContext.getRootFlow().setApplicationContext(applicationContext);

    Model model = new Model();
    ValidationHelper helper = new ValidationHelper(model, requestContext, eventId, modelName, null,
        this.codesResolver, 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


    requestContext.getRootFlow().setApplicationContext(applicationContext);

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

    requestContext.getRootFlow().setApplicationContext(applicationContext);

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

    requestContext.getRootFlow().setApplicationContext(applicationContext);

    Model model = new Model();
    ValidationHelper helper = new ValidationHelper(model, requestContext, eventId, modelName, null,
        this.codesResolver, 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

    requestContext.getRootFlow().setApplicationContext(applicationContext);

    Model model = new Model();
    ValidationHelper helper = new ValidationHelper(model, requestContext, eventId, modelName, null,
        this.codesResolver, 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

    assertFalse(validator.state1Invoked);
    assertTrue(validator.fallbackInvoked);
  }

  public void testSmartValidatorWithClassHint() {
    ViewState state = new ViewState(requestContext.getRootFlow(), "state2", new StubViewFactory());
    state.getAttributes().put("validationHints", new StaticExpression(new Object[] { Model.State1.class }));
    requestContext.setCurrentState(state);

    LegacyModelValidator validator = new LegacyModelValidator();
    ExtendedModel model = new ExtendedModel();
    ValidationHelper helper = new ValidationHelper(model, requestContext, eventId, modelName, null, codesResolver, null);
View Full Code Here

    assertTrue(validator.hints.length > 0);
    assertEquals(Model.State1.class, validator.hints[0]);
  }

  public void testSmartValidatorWithHintResolution() {
    ViewState state = new ViewState(requestContext.getRootFlow(), "state2", new StubViewFactory());
    state.getAttributes().put("validationHints", new StaticExpression("State1"));
    requestContext.setCurrentState(state);

    LegacyModelValidator validator = new LegacyModelValidator();
    ExtendedModel model = new ExtendedModel();
    ValidationHelper helper = new ValidationHelper(model, requestContext, eventId, modelName, null, codesResolver, null);
View Full Code Here

  public void testSmartValidatorWithHintOnTransition() {
    Transition transition = new Transition();
    transition.setMatchingCriteria(new DefaultTransitionCriteria(new StaticExpression(eventId)));
    transition.getAttributes().put("validationHints", new StaticExpression("State1"));

    ViewState state = new ViewState(requestContext.getRootFlow(), "state2", new StubViewFactory());
    state.getTransitionSet().add(transition);
    requestContext.setCurrentState(state);

    LegacyModelValidator validator = new LegacyModelValidator();
    ExtendedModel model = new ExtendedModel();
    ValidationHelper helper = new ValidationHelper(model, requestContext, eventId, modelName, null, codesResolver, null);
View Full Code Here

  private DefaultFlowExecutionRepository repository;
  FlowExecutionImplFactory executionFactory = new FlowExecutionImplFactory();

  protected void setUp() throws Exception {
    flow = new Flow("myFlow");
    ViewState s1 = new ViewState(flow, "state", new StubViewFactory());
    s1.getTransitionSet().add(new Transition(new DefaultTargetStateResolver("state2")));
    new ViewState(flow, "state2", new StubViewFactory());

    conversationManager = new StubConversationManager();
    FlowDefinitionLocator locator = new FlowDefinitionLocator() {
      public FlowDefinition getFlowDefinition(String flowId) throws NoSuchFlowDefinitionException,
          FlowDefinitionConstructionException {
View Full Code Here

    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

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.