use of com.adaptris.core.WorkflowList in project interlok by adaptris.
the class WorkflowLifecycleStrategyCase method testStartNoStrategy.
@Test
public void testStartNoStrategy() throws Exception {
WorkflowList wfl = new WorkflowList();
wfl.add(createWorkflow(idGenerator.create(wfl)));
createChannel(wfl).requestStart();
}
use of com.adaptris.core.WorkflowList in project interlok by adaptris.
the class WorkflowLifecycleStrategyCase method testInit.
@Test
public void testInit() throws Exception {
WorkflowList wfl = new WorkflowList();
wfl.add(createWorkflow(idGenerator.create(wfl)));
wfl.setLifecycleStrategy(createStrategy());
createChannel(wfl).requestInit();
}
use of com.adaptris.core.WorkflowList in project interlok by adaptris.
the class WorkflowRetryAndFailTest method testFailedStart_ExceedsMax.
@Override
@Test
public void testFailedStart_ExceedsMax() throws Exception {
WorkflowList wfl = new WorkflowList();
WorkflowRetryAndFail strategy = new WorkflowRetryAndFail(2, new TimeInterval(10L, TimeUnit.MILLISECONDS.name()));
FailStart workflow = new FailStart(3);
wfl.add(workflow);
wfl.setLifecycleStrategy(strategy);
Channel c = createChannel(wfl);
c.requestInit();
try {
c.requestStart();
} catch (CoreException expected) {
}
// That's right 1 + 2 retries.
assertEquals(3, workflow.getAttempts());
assertEquals(InitialisedState.getInstance(), workflow.retrieveComponentState());
}
use of com.adaptris.core.WorkflowList in project interlok by adaptris.
the class WorkflowRetryAndFailTest method testFailedInitialise_ExceedsMax.
@Override
@Test
public void testFailedInitialise_ExceedsMax() throws Exception {
WorkflowList wfl = new WorkflowList();
WorkflowRetryAndFail strategy = new WorkflowRetryAndFail(2, new TimeInterval(10L, TimeUnit.MILLISECONDS.name()));
FailInit workflow = new FailInit(3);
wfl.add(workflow);
wfl.setLifecycleStrategy(strategy);
Channel c = createChannel(wfl);
try {
c.requestInit();
} catch (CoreException expected) {
}
// That's right 1 + 2 retries.
assertEquals(3, workflow.getAttempts());
assertEquals(ClosedState.getInstance(), workflow.retrieveComponentState());
}
use of com.adaptris.core.WorkflowList in project interlok by adaptris.
the class WorkflowRetryAndContinueTest method testFailedInitialise_Retries.
@Test
public void testFailedInitialise_Retries() throws Exception {
WorkflowList wfl = new WorkflowList();
WorkflowRetryAndContinue strategy = createStrategy();
strategy.setMaxRetries(10);
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());
}
Aggregations