/** * Setup the flow expectations and start the given flow. * * @param testHarnessFlowEventListener the test harness flow listener */ public void startFlow(FlowSubject testHarnessFlowEventListener) { flowTestHarness = new FlowTestHarnessImpl(flowExpectations); testHarnessFlowEventListener.removeAllObservers(); testHarnessFlowEventListener.addObserver((FlowObserver) flowTestHarness); testHarnessFlowEventListener.setIgnoreEventCapture(true); if (this.scheduledConsumerName != null) { FlowElement<?> flowElement = flow.getFlowElement(scheduledConsumerName); ScheduledConsumerConfiguration configuration = ((ScheduledConsumer) flowElement.getFlowComponent()).getConfiguration(); configuration.setCronExpression("0/5 * * * * ? 2099"); // set to never run configuration.setEager(false); // do not callback on the provider once complete } flow.start(); Assert.assertEquals("flow should be running", "running", flow.getState()); }
/** * Setup the flow expectations, make sure that testHarness listener is attached to flow and start the given flow. * */ public void startFlow() { flowTestHarness = new FlowTestHarnessImpl(flowExpectations); testHarnessFlowEventListener.removeAllObservers(); testHarnessFlowEventListener.addObserver((FlowObserver) flowTestHarness); testHarnessFlowEventListener.setIgnoreEventCapture(true); if (this.scheduledConsumerName != null) { Object component = getComponent(scheduledConsumerName); ScheduledConsumerConfiguration configuration = ((ScheduledConsumer) component).getConfiguration(); configuration.setCronExpression("0/5 * * * * ? 2099"); // set to never run configuration.setEager(false); // do not callback on the provider once complete } flow.setFlowListener(testHarnessFlowEventListener); flow.start(); Assert.assertEquals("flow should be running", "running", flow.getState()); }
/** * Setup the flow expectations and start the given flow. * */ public void startFlow() { flowTestHarness = new FlowTestHarnessImpl(flowExpectations); testHarnessFlowEventListener.removeAllObservers(); testHarnessFlowEventListener.addObserver((FlowObserver) flowTestHarness); testHarnessFlowEventListener.setIgnoreEventCapture(true); if (this.scheduledConsumerName != null) { Object component = getComponent(scheduledConsumerName); ScheduledConsumerConfiguration configuration = ((ScheduledConsumer) component).getConfiguration(); configuration.setCronExpression("0/5 * * * * ? 2099"); // set to never run configuration.setEager(false); // do not callback on the provider once complete } flow.setFlowListener(testHarnessFlowEventListener); flow.start(); Assert.assertEquals("flow should be running", "running", flow.getState()); }