use of com.adaptris.core.Channel in project interlok by adaptris.
the class WorkflowLifecycleStrategyCase method testStopNoStrategy.
@Test
public void testStopNoStrategy() throws Exception {
WorkflowList wfl = new WorkflowList();
wfl.add(createWorkflow(idGenerator.create(wfl)));
Channel c = createChannel(wfl);
c.requestStart();
c.requestStop();
}
use of com.adaptris.core.Channel in project interlok by adaptris.
the class WorkflowLifecycleStrategyCase method createChannel.
protected Channel createChannel(WorkflowList wfl) throws Exception {
Channel channel = new MockChannel();
channel.setWorkflowList(wfl);
channel.prepare();
return channel;
}
use of com.adaptris.core.Channel in project interlok by adaptris.
the class WorkflowLifecycleStrategyCase method testCloseNoStrategy.
@Test
public void testCloseNoStrategy() throws Exception {
WorkflowList wfl = new WorkflowList();
wfl.add(createWorkflow(idGenerator.create(wfl)));
Channel c = createChannel(wfl);
c.requestStart();
c.requestClose();
}
use of com.adaptris.core.Channel in project interlok by adaptris.
the class WorkflowLifecycleStrategyCase method testClose.
@Test
public void testClose() throws Exception {
WorkflowList wfl = new WorkflowList();
wfl.add(createWorkflow(idGenerator.create(wfl)));
wfl.setLifecycleStrategy(createStrategy());
Channel c = createChannel(wfl);
c.requestStart();
c.requestClose();
}
use of com.adaptris.core.Channel 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());
}
Aggregations