/** * Convenience constructor that creates a new mock request context with the following defaults: * <ul> * <li>A mock flow execution context with a active session of flow "mockFlow" in state "mockState". * <li>A mock external context with no request parameters set. * </ul> * To add request parameters to this request, use the {@link #putRequestParameter(String, String)} method. */ public MockRequestContext() { this(new MockFlowExecutionContext()); }
/** * Convenience constructor that creates a new mock request context with the following defaults: * <ul> * <li>A mock flow execution context with an active session for the specified flow. * <li>A mock external context with no request parameters set. * </ul> * To add request parameters to this request, use the {@link #putRequestParameter(String, String)} method. * @param flow the flow definition */ public MockRequestContext(Flow flow) { this(new MockFlowExecutionContext(flow)); }
/** * Convenience constructor that creates a new mock request context with the following defaults: * <ul> * <li>A mock flow execution context with a active session of flow "mockFlow" in state "mockState". * <li>A mock external context with the provided parameters set. * </ul> */ public MockRequestContext(ParameterMap requestParameterMap) { this.flowExecutionContext = new MockFlowExecutionContext(); this.externalContext = new MockExternalContext(requestParameterMap); this.messageContext = new DefaultMessageContext(); }
/** * Convenience constructor that creates a new mock request context with the following defaults: * <ul> * <li>A mock flow execution context with an active session for the specified flow. * <li>A mock external context with no request parameters set. * </ul> * To add request parameters to this request, use the {@link #putRequestParameter(String, String)} method. * @param flow the flow definition */ public MockRequestContext(Flow flow) { this(new MockFlowExecutionContext(flow)); }
/** * Convenience constructor that creates a new mock request context with the following defaults: * <ul> * <li>A mock flow execution context with a active session of flow "mockFlow" in state "mockState". * <li>A mock external context with no request parameters set. * </ul> * To add request parameters to this request, use the {@link #putRequestParameter(String, String)} method. */ public MockRequestContext() { this(new MockFlowExecutionContext()); }
/** * Convenience constructor that creates a new mock request context with the following defaults: * <ul> * <li>A mock flow execution context with an active session for the specified flow. * <li>A mock external context with no request parameters set. * </ul> * To add request parameters to this request, use the {@link #putRequestParameter(String, String)} method. * @param flow the flow definition */ public MockRequestContext(Flow flow) { this(new MockFlowExecutionContext(flow)); }
/** * Convenience constructor that creates a new mock request context with the following defaults: * <ul> * <li>A mock flow execution context with a active session of flow "mockFlow" in state "mockState". * <li>A mock external context with no request parameters set. * </ul> * To add request parameters to this request, use the {@link #putRequestParameter(String, String)} method. */ public MockRequestContext() { this(new MockFlowExecutionContext()); }
/** * Creates a new mock request context with the following defaults: * <ul> * <li>A flow execution context with an active session for the specified flow. * <li>A mock external context with no request parameters set. * </ul> * To add request parameters to this request, use the {@link #putRequestParameter(String, String)} method. */ public MockRequestContext(Flow flow) { flowExecutionContext = new MockFlowExecutionContext(flow); }
/** * Convenience constructor that creates a new mock request context with the following defaults: * <ul> * <li>A mock flow execution context with a active session of flow "mockFlow" in state "mockState". * <li>A mock external context with the provided parameters set. * </ul> */ public MockRequestContext(ParameterMap requestParameterMap) { this.flowExecutionContext = new MockFlowExecutionContext(); this.externalContext = new MockExternalContext(requestParameterMap); this.messageContext = new DefaultMessageContext(); }
/** * Convenience constructor that creates a new mock request context with the following defaults: * <ul> * <li>A mock flow execution context with a active session of flow "mockFlow" in state "mockState". * <li>A mock external context with the provided parameters set. * </ul> */ public MockRequestContext(ParameterMap requestParameterMap) { this.flowExecutionContext = new MockFlowExecutionContext(); this.externalContext = new MockExternalContext(requestParameterMap); this.messageContext = new DefaultMessageContext(); }
public void testEnterEndStateTerminateFlowSession() { final Flow subflow = new Flow("mySubflow"); EndState state = new EndState(subflow, "end"); MockFlowSession session = new MockFlowSession(subflow); Flow parent = new Flow("parent"); SubflowState subflowState = new SubflowState(parent, "subflow", new AbstractGetValueExpression() { public Object getValue(Object context) throws EvaluationException { return subflow; } }); subflowState.getTransitionSet().add(new Transition(on("end"), to("end"))); new EndState(parent, "end"); MockFlowSession parentSession = new MockFlowSession(parent); parentSession.setState(subflowState); session.setParent(parentSession); MockRequestControlContext context = new MockRequestControlContext(new MockFlowExecutionContext(session)); state.enter(context); assertFalse("Active", context.getFlowExecutionContext().isActive()); }