Examples of MockExternalContext


Examples of org.springframework.webflow.test.MockExternalContext

  }

  public void testStateExceptionHandlingRethrow() {
    FlowExecution execution = new FlowExecutionImplFactory().createFlowExecution(flow);
    try {
      execution.start(null, new MockExternalContext());
      fail("Should have rethrown");
    } catch (FlowExecutionException e) {
      // expected
    }
  }
View Full Code Here

Examples of org.springframework.webflow.test.MockExternalContext

        return Flow.create(getContext().getFlowId(), getContext().getFlowAttributes());
      }
    };
    Flow flow = new FlowAssembler(builder, new MockFlowBuilderContext("flow")).assembleFlow();
    FlowExecution execution = new FlowExecutionImplFactory().createFlowExecution(flow);
    execution.start(null, new MockExternalContext());
    assertTrue(execution.isActive());
  }
View Full Code Here

Examples of org.springframework.webflow.test.MockExternalContext

      }
    };
    factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(listener1));
    FlowExecution execution = factory.createFlowExecution(flowDefinition);
    assertFalse(execution.isActive());
    execution.start(null, new MockExternalContext());
    assertTrue(starting);
  }
View Full Code Here

Examples of org.springframework.webflow.test.MockExternalContext

      }
    };
    flowDefinition.setStartState(state);
    factory.setExecutionKeyFactory(new MockFlowExecutionKeyFactory());
    FlowExecution execution = factory.createFlowExecution(flowDefinition);
    execution.start(null, new MockExternalContext());
    assertTrue(getKeyCalled);
    assertTrue(removeAllSnapshotsCalled);
    assertTrue(removeSnapshotCalled);
    assertTrue(updateSnapshotCalled);
    assertNull(execution.getKey());
View Full Code Here

Examples of org.springframework.webflow.test.MockExternalContext

    new EndState(flow, "end");
    MockFlowExecutionListener mockListener = new MockFlowExecutionListener();
    FlowExecutionListener[] listeners = new FlowExecutionListener[] { mockListener };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    execution.setListeners(listeners);
    MockExternalContext context = new MockExternalContext();
    assertFalse(execution.hasStarted());
    execution.start(null, context);
    assertTrue(execution.hasStarted());
    assertFalse(execution.isActive());
    assertEquals(1, mockListener.getRequestsSubmittedCount());
View Full Code Here

Examples of org.springframework.webflow.test.MockExternalContext

    };
    MockFlowExecutionListener mockListener = new MockFlowExecutionListener();
    FlowExecutionListener[] listeners = new FlowExecutionListener[] { mockListener };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    execution.setListeners(listeners);
    MockExternalContext context = new MockExternalContext();
    execution.start(null, context);
    assertTrue(execution.isActive());
    assertEquals(1, mockListener.getPausedCount());
  }
View Full Code Here

Examples of org.springframework.webflow.test.MockExternalContext

      }
    };
    FlowExecutionListener[] listeners = new FlowExecutionListener[] { mockListener };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    execution.setListeners(listeners);
    MockExternalContext context = new MockExternalContext();
    execution.start(null, context);
    assertTrue(execution.isActive());
    assertEquals(1, mockListener.getPausedCount());
  }
View Full Code Here

Examples of org.springframework.webflow.test.MockExternalContext

      }
    };
    FlowExecutionListener[] listeners = new FlowExecutionListener[] { mockListener };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    execution.setListeners(listeners);
    MockExternalContext context = new MockExternalContext();
    assertFalse(execution.hasStarted());
    try {
      execution.start(null, context);
      fail("Should have failed");
    } catch (FlowExecutionException e) {
View Full Code Here

Examples of org.springframework.webflow.test.MockExternalContext

      protected void doEnter(RequestControlContext context) throws FlowExecutionException {
        throw new IllegalStateException("Oops");
      }
    };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    MockExternalContext context = new MockExternalContext();
    assertFalse(execution.hasStarted());
    try {
      execution.start(null, context);
      fail("Should have failed");
    } catch (FlowExecutionException e) {
View Full Code Here

Examples of org.springframework.webflow.test.MockExternalContext

      protected void doEnter(RequestControlContext context) throws FlowExecutionException {
        throw e;
      }
    };
    FlowExecutionImpl execution = new FlowExecutionImpl(flow);
    MockExternalContext context = new MockExternalContext();
    assertFalse(execution.hasStarted());
    try {
      execution.start(null, context);
      fail("Should have failed");
    } catch (FlowExecutionException ex) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.