From 33795c1fe1e2ab564f13deaad7693df08523d399 Mon Sep 17 00:00:00 2001 From: Ben Hale Date: Tue, 12 Jun 2007 20:34:57 +0000 Subject: [PATCH] Added the ability to apply multiple listeners to a test case (SWF-334) --- spring-webflow/changelog.txt | 3 +++ .../AbstractExternalizedFlowExecutionTests.java | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/spring-webflow/changelog.txt b/spring-webflow/changelog.txt index 0570ae1f..80170f3b 100644 --- a/spring-webflow/changelog.txt +++ b/spring-webflow/changelog.txt @@ -50,6 +50,9 @@ Package org.springframework.webflow.executor Package org.springframework.webflow.support * Added native support for Hibernate's session-per-conversation pattern (SWF-92). +Package org.springframework.webflow.test +* Added the ability to apply multiple listeners to a test case (SWF-334). + Changes in version 1.0.3 (24.04.2007) ------------------------------------- diff --git a/spring-webflow/src/main/java/org/springframework/webflow/test/execution/AbstractExternalizedFlowExecutionTests.java b/spring-webflow/src/main/java/org/springframework/webflow/test/execution/AbstractExternalizedFlowExecutionTests.java index 7824135d..6e5d88ed 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/test/execution/AbstractExternalizedFlowExecutionTests.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/test/execution/AbstractExternalizedFlowExecutionTests.java @@ -112,6 +112,17 @@ public abstract class AbstractExternalizedFlowExecutionTests extends AbstractFlo getFlowExecutionImplFactory().setExecutionListenerLoader( new StaticFlowExecutionListenerLoader(executionListener)); } + + /** + * Set the listeners to be attached to the flow execution the next time one + * is {@link #startFlow() started} by this test. Useful for attaching + * listeners that do test assertions during the execution of the flow. + * @param executionListeners the listeners to attach + */ + protected void setFlowExecutionListeners(FlowExecutionListener[] executionListeners) { + getFlowExecutionImplFactory().setExecutionListenerLoader( + new StaticFlowExecutionListenerLoader(executionListeners)); + } protected final FlowDefinition getFlowDefinition() { if (isCacheFlowDefinition() && cachedFlowDefinition != null) {