Package org.springframework.webflow.engine

Examples of org.springframework.webflow.engine.Flow


    AttributeModel attribute2 = new AttributeModel("number", "1");
    attribute2.setType("integer");
    model.setAttributes(doubleList(attribute1, attribute2));

    model.setStates(singleList(new EndStateModel("end")));
    Flow flow = getFlow(model);
    assertEquals("bar", flow.getAttributes().get("foo"));
    assertEquals(new Integer(1), flow.getAttributes().get("number"));
  }
View Full Code Here


  }

  public void testPersistenceContextFlow() {
    model.setPersistenceContext(new PersistenceContextModel());
    model.setStates(singleList(new EndStateModel("end")));
    Flow flow = getFlow(model);
    assertNotNull(flow.getAttributes().get("persistenceContext"));
    assertTrue(((Boolean) flow.getAttributes().get("persistenceContext")).booleanValue());
  }
View Full Code Here

    EndStateModel notReached = new EndStateModel("notReached");
    notReached.setOutputs(singleList(new OutputModel("notReached", "flowScope.foo")));

    model.setStates(doubleList(end, notReached));

    Flow flow = getFlow(model);
    FlowExecutionImplFactory factory = new FlowExecutionImplFactory();
    FlowExecution execution = factory.createFlowExecution(flow);
    MockExternalContext context = new MockExternalContext();
    MutableAttributeMap map = new LocalAttributeMap();
    map.put("foo", "bar");
View Full Code Here

  }

  public void testFlowSecured() {
    model.setSecured(new SecuredModel("ROLE_USER"));
    model.setStates(singleList(new EndStateModel("end")));
    Flow flow = getFlow(model);
    SecurityRule rule = (SecurityRule) flow.getAttributes().get(SecurityRule.SECURITY_ATTRIBUTE_NAME);
    assertNotNull(rule);
    assertEquals(SecurityRule.COMPARISON_ANY, rule.getComparisonType());
    assertEquals(1, rule.getAttributes().size());
    assertTrue(rule.getAttributes().contains("ROLE_USER"));
  }
View Full Code Here

  public void testFlowSecuredState() {
    EndStateModel end = new EndStateModel("end");
    end.setSecured(new SecuredModel("ROLE_USER"));
    model.setStates(singleList(end));
    Flow flow = getFlow(model);
    SecurityRule rule = (SecurityRule) flow.getState("end").getAttributes().get(
        SecurityRule.SECURITY_ATTRIBUTE_NAME);
    assertNotNull(rule);
    assertEquals(SecurityRule.COMPARISON_ANY, rule.getComparisonType());
    assertEquals(1, rule.getAttributes().size());
    assertTrue(rule.getAttributes().contains("ROLE_USER"));
View Full Code Here

    model.setStates(singleList(new EndStateModel("end")));
    TransitionModel transition = new TransitionModel();
    transition.setTo("end");
    transition.setSecured(new SecuredModel("ROLE_USER"));
    model.setGlobalTransitions(singleList(transition));
    Flow flow = getFlow(model);
    SecurityRule rule = (SecurityRule) flow.getGlobalTransitionSet().toArray()[0].getAttributes().get(
        SecurityRule.SECURITY_ATTRIBUTE_NAME);
    assertNotNull(rule);
    assertEquals(SecurityRule.COMPARISON_ANY, rule.getComparisonType());
    assertEquals(1, rule.getAttributes().size());
    assertTrue(rule.getAttributes().contains("ROLE_USER"));
View Full Code Here

  }

  public void testFlowVariable() {
    model.setVars(singleList(new VarModel("flow-foo", "org.springframework.webflow.TestBean")));
    model.setStates(singleList(new EndStateModel("end")));
    Flow flow = getFlow(model);
    assertEquals("flow-foo", flow.getVariable("flow-foo").getName());
  }
View Full Code Here

  public void testViewStateVariable() {
    ViewStateModel view = new ViewStateModel("view");
    view.setVars(singleList(new VarModel("foo", "org.springframework.webflow.TestBean")));
    model.setStates(singleList(view));
    Flow flow = getFlow(model);
    assertNotNull(((ViewState) flow.getStateInstance("view")).getVariable("foo"));
  }
View Full Code Here

  public void testViewStateRedirect() {
    ViewStateModel view = new ViewStateModel("view");
    view.setRedirect("true");
    model.setStates(singleList(view));
    Flow flow = getFlow(model);
    assertTrue(((ViewState) flow.getStateInstance("view")).getRedirect());
  }
View Full Code Here

  Flow flow;

  TransitionableState state;

  protected void setUp() {
    flow = new Flow("myFlow");
    state = new TransitionableState(flow, "state1") {
      protected void doEnter(RequestControlContext context) {
        throw new FlowExecutionException(getFlow().getId(), getId(), "Oops!", new TestException());
      }
    };
View Full Code Here

TOP

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

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.