Package org.springframework.webflow.execution

Examples of org.springframework.webflow.execution.FlowExecutionListener


  public void testFlowStateExceptionHandlingTransition() {
    new EndState(flow, "end");
    TransitionExecutingFlowExecutionExceptionHandler handler = new TransitionExecutingFlowExecutionExceptionHandler();
    handler.add(TestException.class, "end");
    flow.getExceptionHandlerSet().add(handler);
    FlowExecutionListener listener = new FlowExecutionListenerAdapter() {
      public void sessionEnding(RequestContext context, FlowSession session, MutableAttributeMap output) {
        assertTrue(context.getFlashScope().contains("flowExecutionException"));
        assertTrue(context.getFlashScope().contains("rootCauseException"));
        assertTrue(context.getFlashScope().get("rootCauseException") instanceof TestException);
      }
View Full Code Here


    FlowExecution execution = factory.createFlowExecution(flowDefinition);
    assertEquals(attributes, execution.getAttributes());
  }

  public void testCreateWithExecutionListener() {
    FlowExecutionListener listener1 = new FlowExecutionListenerAdapter() {
      public void sessionStarting(RequestContext context, FlowSession session, MutableAttributeMap input) {
        starting = true;
      }
    };
    factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(listener1));
View Full Code Here

  public void testRestoreExecutionState() {
    FlowExecutionImpl flowExecution = (FlowExecutionImpl) factory.createFlowExecution(flowDefinition);
    LocalAttributeMap executionAttributes = new LocalAttributeMap();
    factory.setExecutionAttributes(executionAttributes);
    FlowExecutionListener listener = new FlowExecutionListenerAdapter() {
    };
    factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(listener));
    MockFlowExecutionKeyFactory keyFactory = new MockFlowExecutionKeyFactory();
    factory.setExecutionKeyFactory(keyFactory);
    FlowExecutionKey flowExecutionKey = new MockFlowExecutionKey("e1s1");
View Full Code Here

  }

  public void testStartExceptionThrownBeforeFirstSessionCreated() {
    Flow flow = new Flow("flow");
    new EndState(flow, "end");
    FlowExecutionListener mockListener = new FlowExecutionListenerAdapter() {
      public void sessionStarting(RequestContext context, FlowSession session, MutableAttributeMap input) {
        throw new IllegalStateException("Oops");
      }
    };
    FlowExecutionListener[] listeners = new FlowExecutionListener[] { mockListener };
View Full Code Here

      }
    });
    Set attributes = new HashSet();
    attributes.add(new FlowElementAttribute("foo", "bar", null));
    factoryBean.setFlowExecutionAttributes(attributes);
    FlowExecutionListener listener = new FlowExecutionListenerAdapter() {

    };
    factoryBean.setFlowExecutionListenerLoader(new StaticFlowExecutionListenerLoader(listener));
    factoryBean.setMaxFlowExecutionSnapshots(2);
    factoryBean.setMaxFlowExecutions(1);
View Full Code Here

  public void afterPropertiesSet() {
    listenerLoader = new ConditionalFlowExecutionListenerLoader();
    Iterator it = listenersWithCriteria.entrySet().iterator();
    while (it.hasNext()) {
      Map.Entry entry = (Map.Entry) it.next();
      FlowExecutionListener listener = (FlowExecutionListener) entry.getKey();
      String criteria = (String) entry.getValue();
      listenerLoader.addListener(listener, listenerCriteriaFactory.getListenerCriteria(criteria));
    }
  }
View Full Code Here

  public void testFlowStateExceptionHandlingTransition() {
    new EndState(flow, "end");
    TransitionExecutingFlowExecutionExceptionHandler handler = new TransitionExecutingFlowExecutionExceptionHandler();
    handler.add(TestException.class, "end");
    flow.getExceptionHandlerSet().add(handler);
    FlowExecutionListener listener = new FlowExecutionListenerAdapter() {
      @SuppressWarnings("unused")
      public void sessionEnding(RequestContext context, FlowSession session, MutableAttributeMap<?> output) {
        assertTrue(context.getFlashScope().contains("flowExecutionException"));
        assertTrue(context.getFlashScope().contains("rootCauseException"));
        assertTrue(context.getFlashScope().get("rootCauseException") instanceof TestException);
View Full Code Here

    assertEquals(attributes, execution.getAttributes());
    assertSame("Flow execution attributes are global", attributes.asMap(), execution.getAttributes().asMap());
  }

  public void testCreateWithExecutionListener() {
    FlowExecutionListener listener1 = new FlowExecutionListenerAdapter() {
      public void sessionStarting(RequestContext context, FlowSession session, MutableAttributeMap<?> input) {
        starting = true;
      }
    };
    factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(listener1));
View Full Code Here

  public void testRestoreExecutionState() {
    FlowExecutionImpl flowExecution = (FlowExecutionImpl) factory.createFlowExecution(flowDefinition);
    LocalAttributeMap<Object> executionAttributes = new LocalAttributeMap<Object>();
    factory.setExecutionAttributes(executionAttributes);
    FlowExecutionListener listener = new FlowExecutionListenerAdapter() {
    };
    factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(listener));
    MockFlowExecutionKeyFactory keyFactory = new MockFlowExecutionKeyFactory();
    factory.setExecutionKeyFactory(keyFactory);
    FlowExecutionKey flowExecutionKey = new MockFlowExecutionKey("e1s1");
View Full Code Here

    assertEquals(0, loader.getListeners(new Flow("foo")).length);
    assertEquals(0, loader.getListeners(null).length);
  }

  public void testStaticListener() {
    final FlowExecutionListener listener1 = new FlowExecutionListenerAdapter() {
    };
    loader = new StaticFlowExecutionListenerLoader(listener1);
    assertEquals(listener1, loader.getListeners(new Flow("foo"))[0]);
  }
View Full Code Here

TOP

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

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.