use of org.ow2.proactive.scheduler.task.internal.InternalTask in project scheduling by ow2-proactive.
the class TerminateLoopHandlerTest method generateInternalTask.
private InternalTask generateInternalTask() {
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", 555L));
return internalTask;
}
use of org.ow2.proactive.scheduler.task.internal.InternalTask in project scheduling by ow2-proactive.
the class TerminateLoopHandlerTest method genearteTaks.
private Map<TaskId, InternalTask> genearteTaks() {
Map<TaskId, InternalTask> tempTasks = Maps.newHashMap();
InternalTask internalTask = generateInternalTask();
tempTasks.put(internalTask.getId(), internalTask);
return tempTasks;
}
use of org.ow2.proactive.scheduler.task.internal.InternalTask in project scheduling by ow2-proactive.
the class TerminateReplicateTaskHandlerTest method generateTasksWithBlock.
private Map<TaskId, InternalTask> generateTasksWithBlock() {
Map<TaskId, InternalTask> tempTasks = Maps.newHashMap();
InternalTask startTask = generateInternalTask(555L);
startTask.setFlowBlock(FlowBlock.START);
tempTasks.put(startTask.getId(), startTask);
InternalTask internalTask2 = generateInternalTask(666L);
tempTasks.put(internalTask2.getId(), internalTask2);
internalTask2.addDependence(startTask);
InternalTask internalTask3 = generateInternalTask(888L);
tempTasks.put(internalTask3.getId(), internalTask3);
internalTask3.addDependence(startTask);
when(jobDescriptorImpl.getTaskChildren(startTask)).thenReturn(Lists.newArrayList(internalTask2, internalTask3));
InternalTask endTask = generateInternalTask(999L);
tempTasks.put(endTask.getId(), endTask);
endTask.setFlowBlock(FlowBlock.END);
when(jobDescriptorImpl.getTaskChildren(internalTask2)).thenReturn(Lists.newArrayList(endTask));
when(jobDescriptorImpl.getTaskChildren(internalTask3)).thenReturn(Lists.newArrayList(endTask));
endTask.addDependence(internalTask2);
endTask.addDependence(internalTask3);
InternalTask mergeTask = generateInternalTask(MERGE_TASK_ID);
tempTasks.put(mergeTask.getId(), mergeTask);
mergeTask.addDependence(endTask);
InternalTask initiatorTask = generateInitiatorTask();
startTask.addDependence(initiatorTask);
tempTasks.put(initiatorTask.getId(), initiatorTask);
return tempTasks;
}
use of org.ow2.proactive.scheduler.task.internal.InternalTask in project scheduling by ow2-proactive.
the class TerminateReplicateTaskHandlerTest method generateInitiatorTask.
private InternalTask generateInitiatorTask() {
InternalJob job = new InternalTaskFlowJob("initiator", JobPriority.NORMAL, OnTaskError.CANCEL_JOB, "description");
InternalTask initiatorTask = new InternalScriptTask(job);
initiatorTask.setId(TaskIdImpl.createTaskId(new JobIdImpl(666L, "JobName"), "readableName", 111L));
initiatorTask.setReplicationIndex(1);
return initiatorTask;
}
use of org.ow2.proactive.scheduler.task.internal.InternalTask in project scheduling by ow2-proactive.
the class TerminateReplicateTaskHandlerTest method generateTasks.
private Map<TaskId, InternalTask> generateTasks() {
Map<TaskId, InternalTask> tempTasks = Maps.newHashMap();
InternalTask internalTask = generateInternalTask(555L);
tempTasks.put(internalTask.getId(), internalTask);
InternalTask mergeTask = generateInternalTask(MERGE_TASK_ID);
tempTasks.put(mergeTask.getId(), mergeTask);
InternalTask initiatorTask = generateInitiatorTask();
internalTask.addDependence(initiatorTask);
mergeTask.addDependence(internalTask);
tempTasks.put(initiatorTask.getId(), initiatorTask);
return tempTasks;
}
Aggregations