Package org.springframework.webflow.engine

Examples of org.springframework.webflow.engine.StubViewFactory


    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();
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();
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();
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

    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

TOP

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

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.