use of org.ow2.proactive.scheduler.common.job.JobStatus in project scheduling by ow2-proactive.
the class SchedulerStateRecoverHelperTest method testRecoverWithIncorrectStatusForLoadedNotFinishedJobs.
public void testRecoverWithIncorrectStatusForLoadedNotFinishedJobs(JobStatus jobStatus) {
InternalJob job = new InternalTaskFlowJob();
job.setStatus(jobStatus);
SchedulerDBManager dbManager = Mockito.mock(SchedulerDBManager.class);
SchedulerStateRecoverHelper stateRecoverHelper = new SchedulerStateRecoverHelper(dbManager);
Mockito.when(dbManager.loadNotFinishedJobs(true)).thenReturn(ImmutableList.of(job));
stateRecoverHelper.recover(-1);
}
use of org.ow2.proactive.scheduler.common.job.JobStatus in project scheduling by ow2-proactive.
the class SchedulerStateRecoverHelperTest method createJob.
private InternalJob createJob(String workflowDescriptor, JobStatus jobStatus) throws JobCreationException, KeyException {
Job job = JOB_FACTORY.createJob(this.getClass().getResource("/workflow/descriptors/" + workflowDescriptor).getPath());
InternalJob internalJob = InternalJobFactory.createJob(job, null);
internalJob.setStatus(jobStatus);
internalJob.setOwner("toto");
return internalJob;
}
Aggregations