|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.springframework.webflow.test.execution.AbstractFlowExecutionTests
org.springframework.webflow.test.execution.AbstractExternalizedFlowExecutionTests
org.springframework.webflow.test.execution.AbstractXmlFlowExecutionTests
public abstract class AbstractXmlFlowExecutionTests
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);
}
}
| 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,
FlowServiceLocator flowServiceLocator)
Factory method to create the builder that will build the flow definition whose execution will be tested. |
protected void |
registerLocalMockServices(Flow flow,
org.springframework.beans.factory.config.ConfigurableBeanFactory beanFactory)
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 |
|---|
createFlow, createFlowDefinitionResource, createFlowDefinitionResource, createFlowDefinitionResource, createFlowServiceLocator, getFlowDefinition, getFlowDefinitionResource, isCacheFlowDefinition, registerMockServices, setCacheFlowDefinition, setFlowExecutionAttributes, setFlowExecutionListener, setFlowExecutionListeners |
| 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 |
|---|
public AbstractXmlFlowExecutionTests()
TestCase.setName(String)public AbstractXmlFlowExecutionTests(java.lang.String name)
name - the name of the test| Method Detail |
|---|
protected FlowBuilder createFlowBuilder(org.springframework.core.io.Resource resource,
FlowServiceLocator flowServiceLocator)
AbstractExternalizedFlowExecutionTestsA subclass may return a builder that sets up mock implementations of services needed locally by the flow definition at runtime.
createFlowBuilder in class AbstractExternalizedFlowExecutionTestsresource - the externalized flow definition resource locationflowServiceLocator - the flow service locator
protected void registerLocalMockServices(Flow flow,
org.springframework.beans.factory.config.ConfigurableBeanFactory beanFactory)
flow - the flow to register the services forbeanFactory - the local flow service registry; register mock services with it using
SingletonBeanRegistry.registerSingleton(String, Object)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||