Examples of FlowExecution


Examples of org.springframework.webflow.execution.FlowExecution

  public void testCreateWithExecutionAttributes() {
    MutableAttributeMap<Object> attributes = new LocalAttributeMap<Object>();
    attributes.put("foo", "bar");
    factory.setExecutionAttributes(attributes);
    FlowExecution execution = factory.createFlowExecution(flowDefinition);
    assertEquals(attributes, execution.getAttributes());
    assertSame("Flow execution attributes are global", attributes.asMap(), execution.getAttributes().asMap());
  }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecution

      public void sessionStarting(RequestContext context, FlowSession session, MutableAttributeMap<?> input) {
        starting = true;
      }
    };
    factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(listener1));
    FlowExecution execution = factory.createFlowExecution(flowDefinition);
    assertFalse(execution.isActive());
    execution.start(null, new MockExternalContext());
    assertTrue(starting);
  }
View Full Code Here

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

Examples of org.springframework.webflow.execution.FlowExecution

      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

Examples of org.springframework.webflow.execution.FlowExecution

    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

Examples of org.springframework.webflow.execution.FlowExecution

    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

Examples of org.springframework.webflow.execution.FlowExecution

    }
  }

  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

Examples of org.springframework.webflow.execution.FlowExecution

    }
  }

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

Examples of org.springframework.webflow.execution.FlowExecution

    }
  }

  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

Examples of org.springframework.webflow.execution.FlowExecution

    }
  }

  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
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.