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

Constructor Summary
AbstractXmlFlowExecutionTests()
           
 
Method Summary
protected  FlowBuilder createFlowBuilder(org.springframework.core.io.Resource resource, FlowServiceLocator flowServiceLocator)
          Factory method to create the builder that will build the flow whose execution will be tested.
 
Methods inherited from class org.springframework.webflow.test.execution.AbstractExternalizedFlowExecutionTests
createFlow, createFlowDefinitionResource, createFlowDefinitionResource, createFlowDefinitionResource, createFlowServiceLocator, getFlowDefinition, getFlowDefinitionResource, isCacheFlowDefinition, registerMockServices, setCacheFlowDefinition, setFlowExecutionAttributes, setFlowExecutionListener
 
Methods inherited from class org.springframework.webflow.test.execution.AbstractFlowExecutionTests
applicationView, assertActiveFlowEquals, assertCurrentStateEquals, assertFlowExecutionActive, assertFlowExecutionEnded, assertModelAttributeCollectionSize, assertModelAttributeEquals, assertModelAttributeNotNull, assertModelAttributeNull, assertViewNameEquals, createExternalContext, createFlowExecutionFactory, evaluateModelAttributeExpression, externalRedirect, flowDefinitionRedirect, flowExecutionRedirect, getConversationAttribute, getFlowAttribute, getFlowExecution, getFlowExecutionFactory, getRequiredConversationAttribute, getRequiredConversationAttribute, getRequiredFlowAttribute, getRequiredFlowAttribute, nullView, refresh, refresh, setExpressionParser, signalEvent, signalEvent, signalEvent, startFlow, startFlow, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractXmlFlowExecutionTests

public AbstractXmlFlowExecutionTests()
Method Detail

createFlowBuilder

protected final FlowBuilder createFlowBuilder(org.springframework.core.io.Resource resource,
                                              FlowServiceLocator flowServiceLocator)
Description copied from class: AbstractExternalizedFlowExecutionTests
Factory method to create the builder that will build the flow whose execution will be tested. Subclasses must override.

Specified by:
createFlowBuilder in class AbstractExternalizedFlowExecutionTests
Parameters:
resource - the externalized flow definition resource location
flowServiceLocator - the flow service locator
Returns:
the flow builder that will build the flow to be tested


Copyright © 2004-2006. All Rights Reserved.