public abstract class AbstractXmlFlowExecutionTests extends AbstractExternalizedFlowExecutionTests
Example usage:
public class SearchFlowExecutionTests extends AbstractXmlFlowExecutionTests {
protected FlowDefinitionResource getResource(FlowDefinitionResourceFactory resourceFactory) {
return resourceFactory.createClassPathResource("search-flow.xml", getClass());
}
public void testStartFlow() {
ExternalContext context = new MockExternalContext();
startFlow(context);
assertCurrentStateEquals("enterSearchCriteria");
}
protected void configureFlowBuilderContext(MockFlowBuilderContext builderContext) {
builderContext.registerBean("searchService", new TestSearchService());
}
}
| Constructor and Description |
|---|
AbstractXmlFlowExecutionTests()
Constructs a default XML flow execution test.
|
AbstractXmlFlowExecutionTests(java.lang.String name)
Constructs an XML flow execution test with given name.
|
| Modifier and Type | Method and Description |
|---|---|
protected FlowBuilder |
createFlowBuilder(FlowDefinitionResource resource)
Create the flow builder to build the flow at the specified resource location.
|
protected FlowDefinitionResource[] |
getModelResources(FlowDefinitionResourceFactory resourceFactory)
Template method subclasses may override to return pointers to "flow model resources" needed to build the
definition of the flow being tested.
|
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.
|
buildFlow, configureFlowBuilderContext, createResourceLoader, getFlow, getFlowDefinition, getFlowDefinitionRegistry, getResource, getResourceFactory, isCacheFlowDefinition, setCacheFlowDefinition, setFlowExecutionAttributes, setFlowExecutionListener, setFlowExecutionListenersassertActiveFlowEquals, assertCurrentStateEquals, assertFlowExecutionActive, assertFlowExecutionEnded, assertFlowExecutionOutcomeEquals, assertResponseWrittenEquals, createFlowExecutionFactory, getConversationAttribute, getConversationScope, getFlowAttribute, getFlowExecution, getFlowExecutionFactory, getFlowExecutionOutcome, getFlowScope, getRequiredConversationAttribute, getRequiredConversationAttribute, getRequiredFlowAttribute, getRequiredFlowAttribute, getRequiredViewAttribute, getRequiredViewAttribute, getViewAttribute, getViewScope, resumeFlow, setCurrentState, startFlow, startFlow, updateFlowExecutioncountTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toStringassertEquals, 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, failSamepublic AbstractXmlFlowExecutionTests()
TestCase.setName(String)public AbstractXmlFlowExecutionTests(java.lang.String name)
name - the name of the testprotected final FlowBuilder createFlowBuilder(FlowDefinitionResource resource)
AbstractExternalizedFlowExecutionTestscreateFlowBuilder in class AbstractExternalizedFlowExecutionTestsresource - the resource location of the flow definitionprotected FlowDefinitionResource[] getModelResources(FlowDefinitionResourceFactory resourceFactory)
resourceFactory - the resource factoryprotected void registerMockFlowBeans(org.springframework.beans.factory.config.ConfigurableBeanFactory flowBeanFactory)
flowBeanFactory - the local flow bean factory, you may register mock services with it using
SingletonBeanRegistry.registerSingleton(String, Object)