Package org.springframework.webflow.engine.model.builder

Examples of org.springframework.webflow.engine.model.builder.DefaultFlowModelHolder


  public void testStateMerge() {
    ClassPathResource resourceChild = new ClassPathResource("flow-inheritance-state-child.xml", getClass());
    ClassPathResource resourceParent = new ClassPathResource("flow-inheritance-state-parent.xml", getClass());
    registry.registerFlowModel("child",
        new DefaultFlowModelHolder(new XmlFlowModelBuilder(resourceChild, registry)));
    registry.registerFlowModel("parent", new DefaultFlowModelHolder(new XmlFlowModelBuilder(resourceParent,
        registry)));
    FlowModel flow = registry.getFlowModel("child");
    assertEquals(1, flow.getStates().size());
    assertEquals("otherview", ((ViewStateModel) flow.getStates().get(0)).getView());
  }
View Full Code Here


  public void testStateMergeInvalidParentSyntax() {
    ClassPathResource resourceChild = new ClassPathResource("flow-inheritance-state-invalid-parent-syntax.xml",
        getClass());
    ClassPathResource resourceParent = new ClassPathResource("flow-inheritance-state-parent.xml", getClass());
    registry.registerFlowModel("child",
        new DefaultFlowModelHolder(new XmlFlowModelBuilder(resourceChild, registry)));
    registry.registerFlowModel("parent", new DefaultFlowModelHolder(new XmlFlowModelBuilder(resourceParent,
        registry)));
    try {
      registry.getFlowModel("child");
      fail("A FlowModelConstructionException was expected");
    } catch (FlowModelBuilderException e) {
View Full Code Here

  public void testStateMergeParentFlowNotFound() {
    ClassPathResource resourceChild = new ClassPathResource("flow-inheritance-state-child.xml", getClass());
    ClassPathResource resourceParent = new ClassPathResource("flow-inheritance-state-parent.xml", getClass());
    registry.registerFlowModel("child",
        new DefaultFlowModelHolder(new XmlFlowModelBuilder(resourceChild, registry)));
    registry.registerFlowModel("parent-id-not-matching", new DefaultFlowModelHolder(new XmlFlowModelBuilder(
        resourceParent, registry)));
    try {
      registry.getFlowModel("child");
      fail("A FlowModelBuilderException was expected");
    } catch (FlowModelBuilderException e) {
View Full Code Here

  public void testStateMergeParentStateNotFound() {
    ClassPathResource resourceChild = new ClassPathResource("flow-inheritance-state-child.xml", getClass());
    ClassPathResource resourceParent = new ClassPathResource("flow-empty.xml", getClass());
    registry.registerFlowModel("child",
        new DefaultFlowModelHolder(new XmlFlowModelBuilder(resourceChild, registry)));
    registry.registerFlowModel("parent", new DefaultFlowModelHolder(new XmlFlowModelBuilder(resourceParent,
        registry)));
    try {
      registry.getFlowModel("child");
      fail("A FlowModelBuilderException was expected");
    } catch (FlowModelBuilderException e) {
View Full Code Here

  public void testStateMergeParentStateIncompatable() {
    ClassPathResource resourceChild = new ClassPathResource("flow-inheritance-state-child-alt.xml", getClass());
    ClassPathResource resourceParent = new ClassPathResource("flow-inheritance-state-parent.xml", getClass());
    registry.registerFlowModel("child",
        new DefaultFlowModelHolder(new XmlFlowModelBuilder(resourceChild, registry)));
    registry.registerFlowModel("parent", new DefaultFlowModelHolder(new XmlFlowModelBuilder(resourceParent,
        registry)));
    try {
      registry.getFlowModel("child");
      fail("A FlowModelBuilderException was expected");
    } catch (FlowModelBuilderException e) {
View Full Code Here

  }

  public void testParseFlowExceptionHandler() {
    ClassPathResource res = new ClassPathResource("flow-exception-handler.xml", getClass());
    XmlFlowModelBuilder builder = new XmlFlowModelBuilder(res);
    DefaultFlowModelHolder holder = new DefaultFlowModelHolder(builder);
    FlowModel model = holder.getFlowModel();
    assertEquals("foo1", model.getExceptionHandlers().get(0).getBean());
    assertEquals("foo2", model.getStateById("state1").getExceptionHandlers().get(0).getBean());
    assertEquals("foo3", model.getStateById("state2").getExceptionHandlers().get(0).getBean());
    assertEquals("foo4", model.getStateById("state3").getExceptionHandlers().get(0).getBean());
    assertEquals("foo5", model.getStateById("state4").getExceptionHandlers().get(0).getBean());
View Full Code Here

  }

  public void testFormActionValidatorMethod() {
    ClassPathResource resource = new ClassPathResource("flow-formaction-validatormethod.xml", getClass());
    XmlFlowModelBuilder builder = new XmlFlowModelBuilder(resource, registry);
    DefaultFlowModelHolder holder = new DefaultFlowModelHolder(builder);
    FlowModelFlowBuilder flowBuilder = new FlowModelFlowBuilder(holder);
    FlowAssembler assembler = new FlowAssembler(flowBuilder, new MockFlowBuilderContext("flow"));
    Flow flow = assembler.assembleFlow();
    FlowExecutionImplFactory factory = new FlowExecutionImplFactory();
    factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(new FlowExecutionListenerAdapter() {
View Full Code Here

  }

  public void testParsedFlowValidationHints() {
    ClassPathResource res = new ClassPathResource("flow-validation-hints.xml", getClass());
    XmlFlowModelBuilder builder = new XmlFlowModelBuilder(res);
    DefaultFlowModelHolder holder = new DefaultFlowModelHolder(builder);
    FlowModel model = holder.getFlowModel();

    ViewStateModel state = (ViewStateModel) model.getStateById("state1");
    assertEquals("foo,bar", state.getValidationHints());

    TransitionModel transition = state.getTransitions().get(0);
View Full Code Here

  private DefaultFlowModelHolder holder;
  private FlowModelBuilder builder;

  protected void setUp() {
    builder = new SimpleFlowBuilder();
    holder = new DefaultFlowModelHolder(builder);
  }
View Full Code Here

      flowModelBuilder = new XmlFlowModelBuilder(resource.getPath(), flowRegistry.getFlowModelRegistry());
    } else {
      throw new IllegalArgumentException(resource
          + " is not a supported resource type; supported types are [.xml]");
    }
    FlowModelHolder flowModelHolder = new DefaultFlowModelHolder(flowModelBuilder);
    FlowBuilder flowBuilder = new FlowModelFlowBuilder(flowModelHolder);
    FlowBuilderContext builderContext = new FlowBuilderContextImpl(
        resource.getId(), resource.getAttributes(), flowRegistry, this.flowBuilderServices);
    FlowAssembler assembler = new FlowAssembler(flowBuilder, builderContext);
    DefaultFlowHolder flowHolder = new DefaultFlowHolder(assembler);
View Full Code Here

TOP

Related Classes of org.springframework.webflow.engine.model.builder.DefaultFlowModelHolder

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.