org.springframework.webflow.test.execution
Class AbstractXmlFlowExecutionTests

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.springframework.webflow.test.execution.AbstractFlowExecutionTests
              extended by org.springframework.webflow.test.execution.AbstractExternalizedFlowExecutionTests
                  extended by org.springframework.webflow.test.execution.AbstractXmlFlowExecutionTests
All Implemented Interfaces:
junit.framework.Test

public abstract class AbstractXmlFlowExecutionTests
extends AbstractExternalizedFlowExecutionTests

Base class for flow integration tests that verify an XML flow definition executes as expected.

Example usage:

 public class SearchFlowExecutionTests extends AbstractXmlFlowExecutionTests {
 
        protected FlowDefinitionResource getFlowDefinitionResource() {
                return createFlowDefinitionResource("src/main/webapp/WEB-INF/flows/search-flow.xml");
        }
 
        public void testStartFlow() {
                startFlow();
                assertCurrentStateEquals("displaySearchCriteria");
        }
 
        public void testDisplayCriteriaSubmitSuccess() {
                startFlow();
                MockParameterMap parameters = new MockParameterMap();
                parameters.put("firstName", "Keith");
                parameters.put("lastName", "Donald");
                ViewSelection view = signalEvent("search", parameters);
                assertCurrentStateEquals("displaySearchResults");
                assertModelAttributeCollectionSize(1, "results", view);
        }
 }
 

Author:
Keith Donald, Erwin Vervaet

Constructor Summary
AbstractXmlFlowExecutionTests()
          Constructs a default XML flow execution test.
AbstractXmlFlowExecutionTests(java.lang.String name)
          Constructs an XML flow execution test with given name.
 
Method Summary
protected  FlowBuilder createFlowBuilder(org.springframework.core.io.Resource resource)
          Create the flow builder to build the flow at the specified resource location.
protected  void registerMockFlowBeans(org.springframework.beans.factory.config.ConfigurableBeanFactory flowBeanFactory)
          Template method subclasses may override to register mock implementations of services used locally by the flow being tested.
 
Methods inherited from class org.springframework.webflow.test.execution.AbstractExternalizedFlowExecutionTests
buildFlow, configure, createFlowBuilderContext, getFlowDefinition, getResource, isCacheFlowDefinition, setCacheFlowDefinition, setFlowExecutionAttributes, setFlowExecutionListener, setFlowExecutionListeners
 
Methods inherited from class org.springframework.webflow.test.execution.AbstractFlowExecutionTests
assertActiveFlowEquals, assertCurrentStateEquals, assertFlowExecutionActive, assertFlowExecutionEnded, createFlowExecutionFactory, getConversationAttribute, getFlashAttribute, getFlowAttribute, getFlowExecution, getFlowExecutionFactory, getRequiredConversationAttribute, getRequiredConversationAttribute, getRequiredFlashAttribute, getRequiredFlashAttribute, getRequiredFlowAttribute, getRequiredFlowAttribute, resumeFlow, signalEvent, signalEvent, signalEvent, startFlow, updateFlowExecution
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractXmlFlowExecutionTests

public AbstractXmlFlowExecutionTests()
Constructs a default XML flow execution test.

See Also:
TestCase.setName(String)

AbstractXmlFlowExecutionTests

public AbstractXmlFlowExecutionTests(java.lang.String name)
Constructs an XML flow execution test with given name.

Parameters:
name - the name of the test
Method Detail

createFlowBuilder

protected FlowBuilder createFlowBuilder(org.springframework.core.io.Resource resource)
Description copied from class: AbstractExternalizedFlowExecutionTests
Create the flow builder to build the flow at the specified resource location.

Specified by:
createFlowBuilder in class AbstractExternalizedFlowExecutionTests
Parameters:
resource - the location of the flow definition
Returns:
the flow builder that can build the flow definition

registerMockFlowBeans

protected void registerMockFlowBeans(org.springframework.beans.factory.config.ConfigurableBeanFactory flowBeanFactory)
Template method subclasses may override to register mock implementations of services used locally by the flow being tested.

Parameters:
flowBeanFactory - the local flow service registry; register mock services with it using SingletonBeanRegistry.registerSingleton(String, Object)


Copyright � 2004-2007. All Rights Reserved.