|
Spring Web Flow | ||||||||
| 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()
Creates a new mock request control context. |
|
MockRequestControlContext(Flow flow)
Creates a new mock request control context for controlling a mock execution of the provided flow definition. |
|
MockRequestControlContext(FlowExecutionContext flowExecutionContext)
Creates a new mock request control context for controlling a flow execution. |
|
| Method Summary | |
|---|---|
FlowExecutionKey |
assignFlowExecutionKey()
Assign the ongoing flow execution its flow execution key. |
void |
endActiveFlowSession(java.lang.String outcome,
MutableAttributeMap<java.lang.Object> output)
End the active flow session of the current flow execution. |
boolean |
execute(Transition transition)
Execute this transition out of the current source state. |
boolean |
getEmbeddedMode()
Returns true if the flow current flow execution was launched in embedded page mode. |
boolean |
getRedirectInSameState()
Returns the value of the 'redirect in same state' flow execution attribute if set or otherwise it falls back on the value returned by RequestControlContext.getRedirectOnPause(). |
boolean |
getRedirectOnPause()
Returns true if the 'redirect on pause' flow execution attribute is set to true, false otherwise. |
boolean |
handleEvent(Event event)
Signals the occurrence of an event in the current state of this flow execution request context. |
void |
removeAllFlowExecutionSnapshots()
Remove all flow execution snapshots associated with the ongoing conversation. |
void |
removeCurrentFlowExecutionSnapshot()
Remove the current flow execution snapshot to invalidate the current state. |
void |
setAlwaysRedirectOnPause(boolean alwaysRedirectOnPause)
|
void |
setCurrentState(State state)
Record the current state that has entered in the executing flow. |
void |
setEmbeddedMode()
|
void |
setRedirectInSameState(boolean redirectInSameState)
|
void |
start(Flow flow,
MutableAttributeMap<?> input)
Spawn a new flow session and activate it in the currently executing flow. |
void |
updateCurrentFlowExecutionSnapshot()
Update the current flow execution snapshot to save the current state. |
void |
viewRendered(View view)
Called when the current view has completed rendering in the current view state. |
void |
viewRendering(View view)
Called when the current view is about to be rendered in the current view state. |
| 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 |
|---|
setCurrentTransition, setCurrentView |
| Methods inherited from interface org.springframework.webflow.execution.RequestContext |
|---|
getActiveFlow, getAttributes, getConversationScope, getCurrentEvent, getCurrentState, getCurrentTransition, getCurrentView, getExternalContext, getFlashScope, getFlowExecutionContext, getFlowExecutionUrl, getFlowScope, getMatchingTransition, getMessageContext, getRequestParameters, getRequestScope, getViewScope, inViewState |
| Constructor Detail |
|---|
public MockRequestControlContext()
public MockRequestControlContext(Flow flow)
flow - the flow definitionpublic MockRequestControlContext(FlowExecutionContext flowExecutionContext)
flowExecutionContext - the flow execution context| Method Detail |
|---|
public void setCurrentState(State state)
RequestControlContext
setCurrentState in interface RequestControlContextstate - the current stateState.enter(RequestControlContext)public FlowExecutionKey assignFlowExecutionKey()
RequestControlContext
assignFlowExecutionKey in interface RequestControlContextpublic void viewRendering(View view)
RequestControlContext
viewRendering in interface RequestControlContextview - the view to be renderedpublic void viewRendered(View view)
RequestControlContext
viewRendered in interface RequestControlContextview - the view that renderedpublic boolean handleEvent(Event event)
RequestControlContextonEvent() method of the flow involved in the flow execution will be called.
handleEvent in interface RequestControlContextevent - the event that occurred
Flow.handleEvent(RequestControlContext)public boolean execute(Transition transition)
RequestControlContext
execute in interface RequestControlContexttransition - the transitionTransition.execute(State, RequestControlContext)public void removeAllFlowExecutionSnapshots()
RequestControlContext
removeAllFlowExecutionSnapshots in interface RequestControlContextpublic void removeCurrentFlowExecutionSnapshot()
RequestControlContext
removeCurrentFlowExecutionSnapshot in interface RequestControlContextpublic void updateCurrentFlowExecutionSnapshot()
RequestControlContext
updateCurrentFlowExecutionSnapshot in interface RequestControlContext
public void 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 void endActiveFlowSession(java.lang.String outcome,
MutableAttributeMap<java.lang.Object> output)
throws java.lang.IllegalStateException
RequestControlContextend() method of the flow involved in the flow execution will be
called.
endActiveFlowSession in interface RequestControlContextoutcome - the logical outcome the ending session should returnoutput - output the ending session should return
java.lang.IllegalStateException - when the flow execution is not activeFlow.end(RequestControlContext, String, MutableAttributeMap)public boolean getRedirectOnPause()
RequestControlContext
getRedirectOnPause in interface RequestControlContextpublic boolean getRedirectInSameState()
RequestControlContextRequestControlContext.getRedirectOnPause().
getRedirectInSameState in interface RequestControlContextpublic boolean getEmbeddedMode()
RequestControlContext
getEmbeddedMode in interface RequestControlContextpublic void setAlwaysRedirectOnPause(boolean alwaysRedirectOnPause)
public void setRedirectInSameState(boolean redirectInSameState)
public void setEmbeddedMode()
|
Spring Web Flow | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||