Search in sources :

Example 11 with JobStatus

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);
}
Also used : InternalJob(org.ow2.proactive.scheduler.job.InternalJob) SchedulerDBManager(org.ow2.proactive.scheduler.core.db.SchedulerDBManager) SchedulerStateRecoverHelper(org.ow2.proactive.scheduler.core.db.SchedulerStateRecoverHelper) InternalTaskFlowJob(org.ow2.proactive.scheduler.job.InternalTaskFlowJob)

Example 12 with JobStatus

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;
}
Also used : InternalJob(org.ow2.proactive.scheduler.job.InternalJob) InternalTaskFlowJob(org.ow2.proactive.scheduler.job.InternalTaskFlowJob) Job(org.ow2.proactive.scheduler.common.job.Job) InternalJob(org.ow2.proactive.scheduler.job.InternalJob)

Aggregations

JobStatus (org.ow2.proactive.scheduler.common.job.JobStatus)6 JobId (org.ow2.proactive.scheduler.common.job.JobId)5 InternalJob (org.ow2.proactive.scheduler.job.InternalJob)4 Test (org.junit.Test)3 InternalTaskFlowJob (org.ow2.proactive.scheduler.job.InternalTaskFlowJob)3 SchedulerEvent (org.ow2.proactive.scheduler.common.SchedulerEvent)2 Job (org.ow2.proactive.scheduler.common.job.Job)2 JobInfo (org.ow2.proactive.scheduler.common.job.JobInfo)2 JobResult (org.ow2.proactive.scheduler.common.job.JobResult)2 JobState (org.ow2.proactive.scheduler.common.job.JobState)2 TaskFlowJob (org.ow2.proactive.scheduler.common.job.TaskFlowJob)2 TaskId (org.ow2.proactive.scheduler.common.task.TaskId)2 TaskStatus (org.ow2.proactive.scheduler.common.task.TaskStatus)2 ErrorTask (functionaltests.jobs.ErrorTask)1 LogTask (functionaltests.jobs.LogTask)1 MetadataTask (functionaltests.jobs.MetadataTask)1 NonTerminatingJob (functionaltests.jobs.NonTerminatingJob)1 RawTask (functionaltests.jobs.RawTask)1 SimpleJob (functionaltests.jobs.SimpleJob)1 VariableTask (functionaltests.jobs.VariableTask)1