Package org.springframework.webflow.execution

Examples of org.springframework.webflow.execution.FlowExecutionListenerAdapter


    loader = new StaticFlowExecutionListenerLoader(listener1);
    assertEquals(listener1, loader.getListeners(new Flow("foo"))[0]);
  }

  public void testStaticListeners() {
    final FlowExecutionListener listener1 = new FlowExecutionListenerAdapter() {
    };
    final FlowExecutionListener listener2 = new FlowExecutionListenerAdapter() {
    };

    loader = new StaticFlowExecutionListenerLoader(new FlowExecutionListener[] { listener1, listener2 });
    assertEquals(listener1, loader.getListeners(new Flow("foo"))[0]);
    assertEquals(listener2, loader.getListeners(new Flow("foo"))[1]);
View Full Code Here


    loader = new ConditionalFlowExecutionListenerLoader();
    criteriaFactory = new FlowExecutionListenerCriteriaFactory();
  }

  public void testAddConditionalListener() {
    FlowExecutionListenerAdapter listener = new FlowExecutionListenerAdapter() {
    };
    loader.addListener(listener, criteriaFactory.allFlows());
    Flow flow = new Flow("foo");
    FlowExecutionListener[] listeners = loader.getListeners(flow);
    assertEquals(1, listeners.length);
View Full Code Here

    assertEquals(1, listeners.length);
    assertSame(listener, listeners[0]);
  }

  public void testAddMultipleListeners() {
    FlowExecutionListenerAdapter listener = new FlowExecutionListenerAdapter() {
    };
    FlowExecutionListenerAdapter listener2 = new FlowExecutionListenerAdapter() {
    };
    loader.addListener(listener, criteriaFactory.allFlows());
    loader.addListener(listener2, criteriaFactory.allFlows());
    Flow flow = new Flow("foo");
    FlowExecutionListener[] listeners = loader.getListeners(flow);
View Full Code Here

    assertSame(listener, listeners[0]);
    assertSame(listener2, listeners[1]);
  }

  public void testAddListenerButNoMatch() {
    FlowExecutionListenerAdapter listener = new FlowExecutionListenerAdapter() {
    };
    loader.addListener(listener, criteriaFactory.flow("bar"));
    Flow flow = new Flow("foo");
    FlowExecutionListener[] listeners = loader.getListeners(flow);
    assertEquals(0, listeners.length);
View Full Code Here

        throw new UnsupportedOperationException("Should not be called");
      }

    });
    new EndState(flow, "end");
    FlowExecutionListener mockListener = new FlowExecutionListenerAdapter() {
      public void sessionCreating(RequestContext context, FlowDefinition definition) {
        assertFalse(context.getFlowExecutionContext().isActive());
        throw new IllegalStateException("Oops");
      }
    };
View Full Code Here

      }
    });
    Set<FlowElementAttribute> attributes = new HashSet<FlowElementAttribute>();
    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

    DefaultFlowModelHolder holder = new DefaultFlowModelHolder(builder);
    FlowModelFlowBuilder flowBuilder = new FlowModelFlowBuilder(holder);
    FlowAssembler assembler = new FlowAssembler(flowBuilder, new MockFlowBuilderContext("flow"));
    Flow flow = assembler.assembleFlow();
    FlowExecutionImplFactory factory = new FlowExecutionImplFactory();
    factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(new FlowExecutionListenerAdapter() {
      public void viewRendering(RequestContext context, View view, StateDefinition viewState) {
        if (context.getCurrentEvent() != null && context.getCurrentEvent().getId().equals("submit")) {
          BindingResult result = (BindingResult) context.getFlashScope().get(
              "org.springframework.validation.BindingResult.formBean");
          assertEquals(1, result.getErrorCount());
View Full Code Here

TOP

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

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.