Examples of EndStateModel


Examples of org.springframework.webflow.engine.model.EndStateModel

    state.setOnExitActions(parseOnExitActions(element));
    return state;
  }

  private EndStateModel parseEndState(Element element) {
    EndStateModel state = new EndStateModel(element.getAttribute("id"));
    state.setParent(element.getAttribute("parent"));
    state.setView(element.getAttribute("view"));
    state.setCommit(element.getAttribute("commit"));
    state.setOutputs(parseOutputs(element));
    state.setAttributes(parseAttributes(element));
    state.setSecured(parseSecured(element));
    state.setOnEntryActions(parseOnEntryActions(element));
    state.setExceptionHandlers(parseExceptionHandlers(element));
    return state;
  }
View Full Code Here

Examples of org.springframework.webflow.engine.model.EndStateModel

  public class SimpleFlowBuilder implements FlowModelBuilder {

    public FlowModel getFlowModel() throws FlowModelBuilderException {
      FlowModel flow = new FlowModel();
      flow.setStates(new LinkedList(Collections.singletonList(new EndStateModel("end"))));
      return flow;
    }
View Full Code Here

Examples of org.springframework.webflow.engine.model.EndStateModel

    list.add(model4);
    return list;
  }

  public void testBuildFlowWithEndState() {
    model.setStates(singleList(new EndStateModel("end")));
    Flow flow = getFlow(model);
    assertEquals("flow", flow.getId());
    assertEquals("end", flow.getStartState().getId());
  }
View Full Code Here

Examples of org.springframework.webflow.engine.model.EndStateModel

    assertEquals("flow", flow.getId());
    assertEquals("end", flow.getStartState().getId());
  }

  public void testBuildFlowWithDefaultStartState() {
    model.setStates(singleList(new EndStateModel("end")));
    Flow flow = getFlow(model);
    assertEquals("flow", flow.getId());
    assertEquals("end", flow.getStartState().getId());
  }
View Full Code Here

Examples of org.springframework.webflow.engine.model.EndStateModel

    assertEquals("end", flow.getStartState().getId());
  }

  public void testBuildFlowWithStartStateAttribute() {
    model.setStartStateId("end");
    model.setStates(doubleList(new EndStateModel("foo"), new EndStateModel("end")));
    Flow flow = getFlow(model);
    assertEquals("flow", flow.getId());
    assertEquals("end", flow.getStartState().getId());
  }
View Full Code Here

Examples of org.springframework.webflow.engine.model.EndStateModel

    AttributeModel attribute1 = new AttributeModel("foo", "bar");
    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

Examples of org.springframework.webflow.engine.model.EndStateModel

    assertEquals(new Integer(1), flow.getAttributes().get("number"));
  }

  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

Examples of org.springframework.webflow.engine.model.EndStateModel

    output3.setType("integer");
    output3.setRequired("true");
    OutputModel output4 = new OutputModel("literal", "'a literal'");
    model.setOutputs(quadList(output1, output2, output3, output4));

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

    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();
View Full Code Here

Examples of org.springframework.webflow.engine.model.EndStateModel

    assertNull(outcome.getOutput().get("notReached"));
  }

  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());
View Full Code Here

Examples of org.springframework.webflow.engine.model.EndStateModel

    assertEquals(1, rule.getAttributes().size());
    assertTrue(rule.getAttributes().contains("ROLE_USER"));
  }

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