org.springframework.webflow.test
Class MockFlowSession

java.lang.Object
  extended by org.springframework.webflow.test.MockFlowSession
All Implemented Interfaces:
FlowSession

public class MockFlowSession
extends java.lang.Object
implements FlowSession

Mock implementation of the FlowSession interface.

Author:
Erwin Vervaet
See Also:
FlowSession

Constructor Summary
MockFlowSession()
          Creates a new mock flow session that sets a flow with id "mockFlow" as the 'active flow' in state "mockState".
MockFlowSession(Flow flow)
          Creates a new mock session in a created state for the specified flow definition.
MockFlowSession(Flow flow, AttributeMap input)
          Creates a new mock session in FlowSessionStatus.CREATED state for the specified flow definition.
 
Method Summary
 FlowDefinition getDefinition()
          Returns the flow definition backing this session.
 Flow getDefinitionInternal()
          Returns the flow definition of this session.
 MutableAttributeMap getFlashMap()
          Returns the local "flash map".
 FlowSession getParent()
          Returns the parent flow session in the current flow execution, or null if there is no parent flow session.
 MutableAttributeMap getScope()
          Return this session's local attributes; the basis for "flow scope" (flow session scope).
 StateDefinition getState()
          Returns the current state of this flow session.
 State getStateInternal()
          Returns the current state of this session.
 FlowSessionStatus getStatus()
          Returns the current status of this flow session.
 boolean isRoot()
          Returns whether this flow session is the root flow session in the ongoing flow execution.
 void setDefinition(Flow flow)
          Set the flow associated with this flow session.
 void setParent(FlowSession parent)
          Set the parent flow session of this flow session in the ongoing flow execution.
 void setScope(MutableAttributeMap scope)
          Set the scope data maintained by this flow session.
 void setState(State state)
          Set the currently active state.
 void setStatus(FlowSessionStatus status)
          Set the status of this flow session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockFlowSession

public MockFlowSession()
Creates a new mock flow session that sets a flow with id "mockFlow" as the 'active flow' in state "mockState". This session marks itself active.


MockFlowSession

public MockFlowSession(Flow flow)
Creates a new mock session in a created state for the specified flow definition.


MockFlowSession

public MockFlowSession(Flow flow,
                       AttributeMap input)
Creates a new mock session in FlowSessionStatus.CREATED state for the specified flow definition.

Parameters:
flow - the flow definition for the session
input - initial contents of 'flow scope'
Method Detail

getDefinition

public FlowDefinition getDefinition()
Description copied from interface: FlowSession
Returns the flow definition backing this session.

Specified by:
getDefinition in interface FlowSession

getState

public StateDefinition getState()
Description copied from interface: FlowSession
Returns the current state of this flow session. This value changes as the flow executes.

Specified by:
getState in interface FlowSession

getStatus

public FlowSessionStatus getStatus()
Description copied from interface: FlowSession
Returns the current status of this flow session. This value changes as the flow executes.

Specified by:
getStatus in interface FlowSession

getScope

public MutableAttributeMap getScope()
Description copied from interface: FlowSession
Return this session's local attributes; the basis for "flow scope" (flow session scope).

Specified by:
getScope in interface FlowSession
Returns:
the flow scope attributes

getFlashMap

public MutableAttributeMap getFlashMap()
Description copied from interface: FlowSession
Returns the local "flash map". Attributes in this map are cleared out on the next event signaled in the flow execution, so they survive a refresh.

Specified by:
getFlashMap in interface FlowSession
Returns:
the flash map

getParent

public FlowSession getParent()
Description copied from interface: FlowSession
Returns the parent flow session in the current flow execution, or null if there is no parent flow session.

Specified by:
getParent in interface FlowSession

isRoot

public boolean isRoot()
Description copied from interface: FlowSession
Returns whether this flow session is the root flow session in the ongoing flow execution. The root flow session does not have a parent flow session.

Specified by:
isRoot in interface FlowSession

setDefinition

public void setDefinition(Flow flow)
Set the flow associated with this flow session.


setState

public void setState(State state)
Set the currently active state.


setStatus

public void setStatus(FlowSessionStatus status)
Set the status of this flow session.


setScope

public void setScope(MutableAttributeMap scope)
Set the scope data maintained by this flow session. This will be the flow scope data of the ongoing flow execution.


setParent

public void setParent(FlowSession parent)
Set the parent flow session of this flow session in the ongoing flow execution.


getDefinitionInternal

public Flow getDefinitionInternal()
Returns the flow definition of this session.


getStateInternal

public State getStateInternal()
Returns the current state of this session.



Copyright © 2004-2007. All Rights Reserved.