use of org.jboss.tools.openshift.internal.common.core.job.JobChainBuilder.ISchedulingCondition in project jbosstools-openshift by jbosstools.
the class JobChainBuilderTest method should_schedule_2_jobs_given_condition_that_stops_after_2.
@Test
public void should_schedule_2_jobs_given_condition_that_stops_after_2() {
// given
JobCounter counter = new JobCounter(4);
JobChainBuilder builder = new JobChainBuilder(createJob("Job 1", counter));
counter.setBuilder(builder);
createJobs(3, new ISchedulingCondition[] { new JobChainBuilder.NullCondition(), new JobChainBuilder.ISchedulingCondition() {
@Override
public boolean isFullfilled(Job preceedingJob) {
return false;
}
}, new JobChainBuilder.NullCondition() }, builder, counter);
// when
builder.schedule();
// then
assertThat(counter.getDone()).isEqualTo(2);
}
Aggregations