Examples of EndStateModel


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

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

  public void testFlowSecuredTransition() {
    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);
View Full Code Here

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

    assertTrue(rule.getAttributes().contains("ROLE_USER"));
  }

  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

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

    }
  }

  public void testExceptionHandlers() {
    FlowModel model = new FlowModel();
    model.setStates(singleList(new EndStateModel("state")));
    model.setExceptionHandlers(singleList(new ExceptionHandlerModel("exceptionHandler")));
    FlowExecutionExceptionHandler handler = new FlowExecutionExceptionHandler() {
      public boolean canHandle(FlowExecutionException exception) {
        return true;
      }
View Full Code Here

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

  private <T> LinkedList<T> asList(Class<T> elementClass, T... a) {
    return new LinkedList<T>(Arrays.asList(a));
  }

  public void testBuildFlowWithEndState() {
    model.setStates(asList(AbstractStateModel.class, 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(asList(AbstractStateModel.class, 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(asList(AbstractStateModel.class, 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(asList(AttributeModel.class, attribute1, attribute2));

    model.setStates(asList(AbstractStateModel.class, 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(asList(AbstractStateModel.class, new EndStateModel("end")));
    Flow flow = getFlow(model);
    assertNotNull(flow.getAttributes().get("persistenceContext"));
    assertTrue((Boolean) flow.getAttributes().get("persistenceContext"));
  }
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(asList(OutputModel.class, output1, output2, output3, output4));

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

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

    model.setStates(asList(AbstractStateModel.class, 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(asList(AbstractStateModel.class, 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
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.