Package org.springframework.webflow.engine

Examples of org.springframework.webflow.engine.Flow


  Hotel hotel = new Hotel();
  hotel.setId(1L);
  hotel.setName("Jameson Inn");
  getFlowScope().put("hotel", hotel);

  Flow mockBookingFlow = new Flow("booking");
  mockBookingFlow.setInputMapper(new Mapper() {
      public MappingResults map(Object source, Object target) {
    assertEquals(new Long(1), ((AttributeMap) source).get("hotelId"));
    return null;
      }
  });
View Full Code Here


    ClassPathResource res = new ClassPathResource("flow-managed-persistence.xml", getClass());
    DefaultFlowModelHolder holder = new DefaultFlowModelHolder(new XmlFlowModelBuilder(res));
    FlowModelFlowBuilder builder = new FlowModelFlowBuilder(holder);
    MockFlowBuilderContext context = new MockFlowBuilderContext("foo");
    FlowAssembler assembler = new FlowAssembler(builder, context);
    Flow flow = assembler.assembleFlow();
    context.registerSubflow(flow);
    Flow notManaged = new Flow("notmanaged");
    new EndState(notManaged, "finish");
    context.registerSubflow(notManaged);
    context.registerBean("loadTestBean", new Action() {
      public Event execute(RequestContext context) throws Exception {
        assertSessionBound();
View Full Code Here

    ClassPathResource res = new ClassPathResource("flow-managed-persistence.xml", getClass());
    DefaultFlowModelHolder holder = new DefaultFlowModelHolder(new XmlFlowModelBuilder(res));
    FlowModelFlowBuilder builder = new FlowModelFlowBuilder(holder);
    MockFlowBuilderContext context = new MockFlowBuilderContext("foo");
    FlowAssembler assembler = new FlowAssembler(builder, context);
    Flow flow = assembler.assembleFlow();
    context.registerSubflow(flow);
    Flow notManaged = new Flow("notmanaged");
    new EndState(notManaged, "finish");
    context.registerSubflow(notManaged);
    context.registerBean("loadTestBean", new Action() {
      public Event execute(RequestContext context) throws Exception {
        assertSessionBound();
View Full Code Here

public class SecurityFlowExecutionListenerTests extends TestCase {

  public void testSessionCreatingNoSecurity() {
    SecurityFlowExecutionListener listener = new SecurityFlowExecutionListener();
    RequestContext context = new MockRequestContext();
    FlowDefinition definition = new Flow("flow");
    listener.sessionCreating(context, definition);
  }
View Full Code Here

  }

  public void testSessionCreatingWithSecurity() {
    SecurityFlowExecutionListener listener = new SecurityFlowExecutionListener();
    RequestContext context = new MockRequestContext();
    Flow flow = new Flow("flow");
    SecurityRule rule = getSecurityRuleAnyAuthorized();
    ((LocalAttributeMap) flow.getAttributes()).put(SecurityRule.SECURITY_ATTRIBUTE_NAME, rule);
    configureSecurityContext();
    listener.sessionCreating(context, flow);
  }
View Full Code Here

  }

  public void testStateEnteringNoSecurity() {
    SecurityFlowExecutionListener listener = new SecurityFlowExecutionListener();
    RequestContext context = new MockRequestContext();
    Flow flow = new Flow("flow");
    ViewState state = new ViewState(flow, "view", new StubViewFactory());
    listener.stateEntering(context, state);
  }
View Full Code Here

  }

  public void testStateEnteringWithSecurity() {
    SecurityFlowExecutionListener listener = new SecurityFlowExecutionListener();
    RequestContext context = new MockRequestContext();
    Flow flow = new Flow("flow");
    ViewState state = new ViewState(flow, "view", new StubViewFactory());
    SecurityRule rule = getSecurityRuleAllAuthorized();
    ((LocalAttributeMap) state.getAttributes()).put(SecurityRule.SECURITY_ATTRIBUTE_NAME, rule);
    configureSecurityContext();
    listener.stateEntering(context, state);
View Full Code Here

    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

    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

  }

  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

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.