use of com.adaptris.core.WorkflowList in project interlok by adaptris.
the class WorkflowRetryAndContinueTest method testFailedStart_Retries_Infinite.
@Test
public void testFailedStart_Retries_Infinite() throws Exception {
WorkflowList wfl = new WorkflowList();
WorkflowRetryAndContinue strategy = createStrategy();
strategy.setMaxRetries(-1);
strategy.setWaitBetweenRetries(new TimeInterval(10L, TimeUnit.MILLISECONDS.name()));
FailStart workflow = new FailStart(3);
wfl.add(workflow);
wfl.setLifecycleStrategy(strategy);
Channel c = createChannel(wfl);
c.requestStart();
assertEquals(4, workflow.getAttempts());
assertEquals(StartedState.getInstance(), workflow.retrieveComponentState());
}
use of com.adaptris.core.WorkflowList in project interlok by adaptris.
the class WorkflowRetryAndContinueTest method testFailedInitialise_ExceedsMax.
@Test
public void testFailedInitialise_ExceedsMax() throws Exception {
WorkflowList wfl = new WorkflowList();
WorkflowRetryAndContinue strategy = createStrategy();
strategy.setMaxRetries(2);
strategy.setWaitBetweenRetries(new TimeInterval(10L, TimeUnit.MILLISECONDS.name()));
FailInit workflow = new FailInit(3);
wfl.add(workflow);
wfl.setLifecycleStrategy(strategy);
Channel c = createChannel(wfl);
c.requestInit();
assertEquals(ClosedState.getInstance(), workflow.retrieveComponentState());
}
use of com.adaptris.core.WorkflowList in project interlok by adaptris.
the class WorkflowRetryAndContinueTest method testFailedInitialise_Retries_Infinite.
@Test
public void testFailedInitialise_Retries_Infinite() throws Exception {
WorkflowList wfl = new WorkflowList();
WorkflowRetryAndContinue strategy = createStrategy();
strategy.setMaxRetries(-1);
strategy.setWaitBetweenRetries(new TimeInterval(10L, TimeUnit.MILLISECONDS.name()));
FailInit workflow = new FailInit(3);
wfl.add(workflow);
wfl.setLifecycleStrategy(strategy);
Channel c = createChannel(wfl);
c.requestInit();
assertEquals(4, workflow.getAttempts());
assertEquals(InitialisedState.getInstance(), workflow.retrieveComponentState());
}
use of com.adaptris.core.WorkflowList in project interlok by adaptris.
the class WorkflowRetryAndContinueTest method testFailedStart_ExceedsMax.
@Test
public void testFailedStart_ExceedsMax() throws Exception {
WorkflowList wfl = new WorkflowList();
WorkflowRetryAndContinue strategy = createStrategy();
strategy.setMaxRetries(2);
strategy.setWaitBetweenRetries(new TimeInterval(10L, TimeUnit.MILLISECONDS.name()));
FailStart workflow = new FailStart(3);
wfl.add(workflow);
wfl.setLifecycleStrategy(strategy);
Channel c = createChannel(wfl);
c.requestStart();
assertEquals(InitialisedState.getInstance(), workflow.retrieveComponentState());
}
use of com.adaptris.core.WorkflowList in project interlok by adaptris.
the class WorkflowRetryAndContinueTest method testFailedStart_Retries.
@Test
public void testFailedStart_Retries() throws Exception {
WorkflowList wfl = new WorkflowList();
WorkflowRetryAndContinue strategy = createStrategy();
strategy.setMaxRetries(10);
strategy.setWaitBetweenRetries(new TimeInterval(10L, TimeUnit.MILLISECONDS.name()));
FailStart workflow = new FailStart(3);
wfl.add(workflow);
wfl.setLifecycleStrategy(strategy);
Channel c = createChannel(wfl);
c.requestStart();
assertEquals(4, workflow.getAttempts());
assertEquals(StartedState.getInstance(), workflow.retrieveComponentState());
}
Aggregations