use of org.ow2.proactive.scheduler.task.internal.InternalScriptTask in project scheduling by ow2-proactive.
the class RecoveredSchedulerStateTest method createJob.
public InternalJob createJob(JobStatus jobStatus, int id) {
InternalTaskFlowJob job = new InternalTaskFlowJob("MyJob", JobPriority.HIGH, OnTaskError.CANCEL_JOB, "Description");
InternalScriptTask internalScriptTask = new InternalScriptTask(job);
job.addTasks(ImmutableList.<InternalTask>of(internalScriptTask));
job.setId(JobIdImpl.makeJobId("" + id));
JobInfoImpl jobInfo = (JobInfoImpl) job.getJobInfo();
jobInfo.setStatus(jobStatus);
return job;
}
use of org.ow2.proactive.scheduler.task.internal.InternalScriptTask in project scheduling by ow2-proactive.
the class SchedulingServiceTest method testRestartTaskOnNodeFailure.
@Test
public void testRestartTaskOnNodeFailure() {
InternalJob job = new InternalTaskFlowJob("test-name", JobPriority.NORMAL, OnTaskError.CANCEL_JOB, "description");
InternalTask task = new InternalScriptTask(job);
ExecutorService executorService = Mockito.mock(ExecutorService.class);
Mockito.when(infrastructure.getInternalOperationsThreadPool()).thenReturn(executorService);
schedulingService.restartTaskOnNodeFailure(task);
Mockito.verify(executorService, Mockito.times(1)).submit(any(Runnable.class));
}
use of org.ow2.proactive.scheduler.task.internal.InternalScriptTask in project scheduling by ow2-proactive.
the class TerminationDataTest method testHandleTerminationForTaskNodeFailureTermination.
@Test
public void testHandleTerminationForTaskNodeFailureTermination() throws IOException, ClassNotFoundException {
InternalJob job = new InternalTaskFlowJob("test-name", JobPriority.NORMAL, OnTaskError.CANCEL_JOB, "description");
JobId jobId = new JobIdImpl(666, "readableName");
InternalTask internalTask = new InternalScriptTask(job);
TaskId taskId = TaskIdImpl.createTaskId(jobId, "task-name", 777L);
internalTask.setId(taskId);
internalTask.setName("task-name");
internalTask.setStatus(TaskStatus.RUNNING);
internalTask.setExecuterInformation(Mockito.mock(ExecuterInformation.class));
RunningTaskData taskData = new RunningTaskData(internalTask, "user", null, launcher);
terminationData.addTaskData(null, taskData, TerminationData.TerminationStatus.NODEFAILED, null);
terminationData.handleTermination(service);
Mockito.verify(launcher, Mockito.times(0)).kill();
}
use of org.ow2.proactive.scheduler.task.internal.InternalScriptTask in project scheduling by ow2-proactive.
the class TerminateReplicateTaskHandlerTest method generateInternalTask.
private InternalTask generateInternalTask(long id) {
InternalJob job = new InternalTaskFlowJob("test-name", JobPriority.NORMAL, OnTaskError.CANCEL_JOB, "description");
InternalTask internalTask = new InternalScriptTask(job);
internalTask.setId(TaskIdImpl.createTaskId(new JobIdImpl(666L, "JobName"), "readableName", id));
internalTask.setStatus(TaskStatus.PENDING);
return internalTask;
}
use of org.ow2.proactive.scheduler.task.internal.InternalScriptTask in project scheduling by ow2-proactive.
the class ExtendedSchedulerPolicyTest method createTask.
private InternalScriptTask createTask(String taskStartAt) {
InternalJob job = new InternalTaskFlowJob("test-name", JobPriority.NORMAL, OnTaskError.CANCEL_JOB, "description");
InternalScriptTask task1 = new InternalScriptTask(job);
if (taskStartAt != null) {
task1.addGenericInformation("START_AT", taskStartAt);
}
return task1;
}
Aggregations