Package org.springframework.webflow.execution

Examples of org.springframework.webflow.execution.FlowExecution.start()


      }
    };
    FlowExecutionImplFactory factory = new FlowExecutionImplFactory();
    factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(listener));
    FlowExecution execution = factory.createFlowExecution(flow);
    execution.start(null, new MockExternalContext());
    assertTrue("Should have ended", !execution.isActive());
  }

  public void testStateExceptionHandlingTransitionNoSuchState() {
    TransitionExecutingFlowExecutionExceptionHandler handler = new TransitionExecutingFlowExecutionExceptionHandler();
View Full Code Here


    TransitionExecutingFlowExecutionExceptionHandler handler = new TransitionExecutingFlowExecutionExceptionHandler();
    handler.add(TestException.class, "end");
    flow.getExceptionHandlerSet().add(handler);
    FlowExecution execution = new FlowExecutionImplFactory().createFlowExecution(flow);
    try {
      execution.start(null, new MockExternalContext());
      fail("Should have failed no such state");
    } catch (IllegalArgumentException e) {
    }
  }
View Full Code Here

  }

  public void testStateExceptionHandlingRethrow() {
    FlowExecution execution = new FlowExecutionImplFactory().createFlowExecution(flow);
    try {
      execution.start(null, new MockExternalContext());
      fail("Should have rethrown");
    } catch (FlowExecutionException e) {
      // expected
    }
  }
View Full Code Here

        return Flow.create(getContext().getFlowId(), getContext().getFlowAttributes());
      }
    };
    Flow flow = new FlowAssembler(builder, new MockFlowBuilderContext("flow")).assembleFlow();
    FlowExecution execution = new FlowExecutionImplFactory().createFlowExecution(flow);
    execution.start(null, new MockExternalContext());
    assertTrue(execution.isActive());
  }

  protected TargetStateResolver toState(String stateId) {
    return new DefaultTargetStateResolver(stateId);
View Full Code Here

      }
    };
    factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(listener1));
    FlowExecution execution = factory.createFlowExecution(flowDefinition);
    assertFalse(execution.isActive());
    execution.start(null, new MockExternalContext());
    assertTrue(starting);
  }

  public void testCreateWithExecutionKeyFactory() {
    State state = new State(flowDefinition, "state") {
View Full Code Here

      }
    };
    flowDefinition.setStartState(state);
    factory.setExecutionKeyFactory(new MockFlowExecutionKeyFactory());
    FlowExecution execution = factory.createFlowExecution(flowDefinition);
    execution.start(null, new MockExternalContext());
    assertTrue(getKeyCalled);
    assertTrue(removeAllSnapshotsCalled);
    assertTrue(removeSnapshotCalled);
    assertTrue(updateSnapshotCalled);
    assertNull(execution.getKey());
View Full Code Here

    MockExternalContext context = new MockExternalContext();
    MutableAttributeMap map = new LocalAttributeMap();
    map.put("foo", "bar");
    map.put("number", "3");
    map.put("required", "9");
    execution.start(map, context);
    FlowExecutionOutcome outcome = execution.getOutcome();
    assertEquals("end", outcome.getId());
    assertEquals("bar", outcome.getOutput().get("foo"));
    assertEquals("bar", outcome.getOutput().get("differentName"));
    assertEquals(new Integer(3), outcome.getOutput().get("number"));
View Full Code Here

  public void testPutFlowExecution() {
    FlowExecutionImplFactory factory = new FlowExecutionImplFactory();
    factory.setExecutionKeyFactory(repository);
    FlowExecution execution = factory.createFlowExecution(flow);
    execution.start(null, new MockExternalContext());
    assertNotNull(execution.getKey());
    repository.putFlowExecution(execution);
    String key = execution.getKey().toString();
    FlowExecutionKey parsedKey = repository.parseFlowExecutionKey(key);
    FlowExecution execution2 = repository.getFlowExecution(parsedKey);
View Full Code Here

  public void testRemoveFlowExecution() {
    FlowExecutionImplFactory factory = new FlowExecutionImplFactory();
    factory.setExecutionKeyFactory(repository);
    FlowExecution execution = factory.createFlowExecution(flow);
    execution.start(null, new MockExternalContext());
    assertNotNull(execution.getKey());
    repository.putFlowExecution(execution);
    repository.removeFlowExecution(execution);
    try {
      repository.getFlowExecution(execution.getKey());
View Full Code Here

  public void testRemoveNoSuchFlowExecution() {
    FlowExecutionImplFactory factory = new FlowExecutionImplFactory();
    factory.setExecutionKeyFactory(repository);
    FlowExecution execution = factory.createFlowExecution(flow);
    execution.start(null, new MockExternalContext());
    try {
      repository.removeFlowExecution(execution);
      repository.removeFlowExecution(execution);
      fail("Should have failed");
    } catch (NoSuchFlowExecutionException e) {
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.