use of com.sequenceiq.flow.component.sleep.event.SleepChainTriggerEvent in project cloudbreak by hortonworks.
the class FlowComponentTest method startFlowChainThenWaitForComplete.
@Test
public void startFlowChainThenWaitForComplete() throws InterruptedException {
long resourceId = RESOURCE_ID_SEC.incrementAndGet();
SleepChainTriggerEvent sleepChainTriggerEvent = new SleepChainTriggerEvent(resourceId, Lists.newArrayList(new SleepConfig(SLEEP_TIME, SleepStartEvent.NEVER_FAIL), new SleepConfig(SLEEP_TIME, SleepStartEvent.NEVER_FAIL)));
FlowAcceptResult acceptResult = startSleepFlowChain(sleepChainTriggerEvent);
assertRunningInFlowChain(acceptResult);
waitFlowChainToComplete(SLEEP_TIME.multipliedBy(WAIT_FACTOR), acceptResult);
}
use of com.sequenceiq.flow.component.sleep.event.SleepChainTriggerEvent in project cloudbreak by hortonworks.
the class FlowComponentTest method startFlowChainThenWaitForFail.
@Test
public void startFlowChainThenWaitForFail() throws InterruptedException {
long resourceId = RESOURCE_ID_SEC.incrementAndGet();
SleepChainTriggerEvent sleepChainTriggerEvent = new SleepChainTriggerEvent(resourceId, Lists.newArrayList(new SleepConfig(SLEEP_TIME, SleepStartEvent.NEVER_FAIL), new SleepConfig(SLEEP_TIME, SleepStartEvent.ALWAYS_FAIL)));
FlowAcceptResult acceptResult = startSleepFlowChain(sleepChainTriggerEvent);
assertRunningInFlowChain(acceptResult);
waitFlowChainToFail(SLEEP_TIME.multipliedBy(WAIT_FACTOR), acceptResult);
}
Aggregations