|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.webflow.test.MockRequestContext
org.springframework.webflow.test.MockRequestControlContext
public class MockRequestControlContext
Mock implementation of the RequestControlContext interface to facilitate standalone Flow and State unit
tests.
RequestContext,
FlowSession,
State| Constructor Summary | |
|---|---|
MockRequestControlContext(Flow rootFlow)
Creates a new mock request control context for controlling a mock execution of the provided flow definition. |
|
| Method Summary | |
|---|---|
FlowSession |
endActiveFlowSession(MutableAttributeMap output)
End the active flow session of the current flow execution. |
ViewSelection |
execute(Transition transition)
Execute this transition out of the current source state. |
void |
setCurrentState(State state)
Record the current state that has entered in the executing flow. |
ViewSelection |
signalEvent(Event event)
Signals the occurence of an event in the current state of this flow execution request context. |
ViewSelection |
start(Flow flow,
MutableAttributeMap input)
Spawn a new flow session and activate it in the currently executing flow. |
| Methods inherited from class org.springframework.webflow.test.MockRequestContext |
|---|
getActiveFlow, getAttributeMap, getAttributes, getConversationScope, getCurrentState, getExternalContext, getFlashScope, getFlowExecutionContext, getFlowScope, getLastEvent, getLastTransition, getMockExternalContext, getMockFlowExecutionContext, getModel, getRequestParameters, getRequestScope, putRequestParameter, putRequestParameter, removeAttribute, setActiveSession, setAttribute, setAttributes, setExternalContext, setFlowExecutionContext, setLastEvent, setLastTransition |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.springframework.webflow.engine.RequestControlContext |
|---|
setLastEvent, setLastTransition |
| Methods inherited from interface org.springframework.webflow.execution.RequestContext |
|---|
getActiveFlow, getAttributes, getConversationScope, getCurrentState, getExternalContext, getFlashScope, getFlowExecutionContext, getFlowScope, getLastEvent, getLastTransition, getModel, getRequestParameters, getRequestScope, setAttributes |
| Constructor Detail |
|---|
public MockRequestControlContext(Flow rootFlow)
| Method Detail |
|---|
public void setCurrentState(State state)
RequestControlContext
setCurrentState in interface RequestControlContextstate - the current stateState.enter(RequestControlContext)
public ViewSelection start(Flow flow,
MutableAttributeMap input)
throws java.lang.IllegalStateException
RequestControlContextThis will start a new flow session in the current flow execution, which is already active.
start in interface RequestControlContextflow - the flow to start, its start() method will be calledinput - initial contents of the newly created flow session (may be null, e.g. empty)
java.lang.IllegalStateExceptionFlow.start(RequestControlContext, MutableAttributeMap)public ViewSelection signalEvent(Event event)
RequestControlContextonEvent()
method of the flow involved in the flow execution will be called.
signalEvent in interface RequestControlContextevent - the event that occured
Flow.onEvent(RequestControlContext)
public FlowSession endActiveFlowSession(MutableAttributeMap output)
throws java.lang.IllegalStateException
RequestControlContextend() method of the flow involved in the flow execution will be
called.
endActiveFlowSession in interface RequestControlContextoutput - output produced by the session that is eligible for mapping by a resuming parent flow
java.lang.IllegalStateException - when the flow execution is not activeFlow.end(RequestControlContext, MutableAttributeMap)public ViewSelection execute(Transition transition)
RequestControlContext
execute in interface RequestControlContexttransition - the transition
Transition.execute(State, RequestControlContext)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||