Package org.springframework.webflow.execution

Examples of org.springframework.webflow.execution.FlowExecution


        context.removeAllFlowExecutionSnapshots();
      }
    };
    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


      e.printStackTrace();
    }
  }

  public void testPutFlowExecution() {
    FlowExecution execution = executionFactory.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);
    assertSame(execution.getDefinition(), execution2.getDefinition());
    assertEquals(execution.getActiveSession().getState().getId(), execution2.getActiveSession().getState().getId());
  }
View Full Code Here

    assertSame(execution.getDefinition(), execution2.getDefinition());
    assertEquals(execution.getActiveSession().getState().getId(), execution2.getActiveSession().getState().getId());
  }

  public void testPutFlowExecutionNextSnapshotId() {
    FlowExecution execution = executionFactory.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);
    assertSame(execution.getDefinition(), execution2.getDefinition());
    assertEquals(execution.getActiveSession().getState().getId(), execution2.getActiveSession().getState().getId());
    MockExternalContext context = new MockExternalContext();
    context.setEventId("foo");
    execution2.resume(context);
    repository.putFlowExecution(execution2);
    assertNotSame(execution.getKey(), execution2.getKey());
  }
View Full Code Here

    repository.putFlowExecution(execution2);
    assertNotSame(execution.getKey(), execution2.getKey());
  }

  public void testPutFlowExecutionNoKeyAssigned() {
    FlowExecution execution = executionFactory.createFlowExecution(flow);
    try {
      repository.putFlowExecution(execution);
      fail("Should have failed");
    } catch (IllegalStateException e) {
View Full Code Here

    }
  }

  public void testRemoveFlowExecution() {
    FlowExecution execution = executionFactory.createFlowExecution(flow);
    execution.start(null, new MockExternalContext());
    assertNotNull(execution.getKey());
    repository.putFlowExecution(execution);
    repository.removeFlowExecution(execution);
    try {
      repository.getFlowExecution(execution.getKey());
      fail("Should have failed");
    } catch (NoSuchFlowExecutionException e) {

    }
  }
View Full Code Here

    }
  }

  public void testRemoveKeyNotSet() {
    FlowExecution execution = executionFactory.createFlowExecution(flow);
    try {
      repository.removeFlowExecution(execution);
      fail("Should have failed");
    } catch (IllegalStateException e) {
View Full Code Here

    }
  }

  public void testRemoveNoSuchFlowExecution() {
    FlowExecution execution = executionFactory.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

    }
  }

  public void testGetKey() {
    FlowExecution execution = executionFactory.createFlowExecution(flow);
    assertEquals("e12345s1", repository.getKey(execution).toString());
    assertEquals("e12345s2", repository.getKey(execution).toString());
    assertEquals("e12345s3", repository.getKey(execution).toString());
  }
View Full Code Here

    assertEquals("e12345s2", repository.getKey(execution).toString());
    assertEquals("e12345s3", repository.getKey(execution).toString());
  }

  public void testUpdate() {
    FlowExecution execution = executionFactory.createFlowExecution(flow);
    execution.start(null, new MockExternalContext());
    repository.putFlowExecution(execution);
    execution.getActiveSession().getScope().put("foo", "bar");
    repository.updateFlowExecutionSnapshot(execution);
    FlowExecution execution2 = repository.getFlowExecution(execution.getKey());
    assertEquals("bar", execution2.getActiveSession().getScope().get("foo"));
  }
View Full Code Here

    FlowExecution execution2 = repository.getFlowExecution(execution.getKey());
    assertEquals("bar", execution2.getActiveSession().getScope().get("foo"));
  }

  public void testRemove() {
    FlowExecution execution = executionFactory.createFlowExecution(flow);
    execution.start(null, new MockExternalContext());
    repository.putFlowExecution(execution);
    repository.removeFlowExecutionSnapshot(execution);
    try {
      repository.getFlowExecution(execution.getKey());
      fail("Should have failed");
    } catch (FlowExecutionRestorationFailureException e) {

    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.webflow.execution.FlowExecution

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.