Search in sources :

Example 76 with JavaTask

use of org.ow2.proactive.scheduler.common.task.JavaTask in project scheduling by ow2-proactive.

the class TestProcessTreeKillerUtil method createJavaExecutableJob.

public static TaskFlowJob createJavaExecutableJob(String name, boolean forked) throws UserException {
    TaskFlowJob job = new TaskFlowJob();
    job.setName(name);
    job.setDescription("A command that spawns processes");
    JavaTask task = new JavaTask();
    if (forked) {
        task.setForkEnvironment(new ForkEnvironment());
    }
    task.addArgument("sleep", 3);
    task.addArgument("tname", name);
    task.addArgument("home", PASchedulerProperties.SCHEDULER_HOME.getValueAsString());
    task.setName(name);
    task.setExecutableClassName(JavaSpawnExecutable.class.getName());
    task.setPreciousLogs(true);
    job.addTask(task);
    return job;
}
Also used : TaskFlowJob(org.ow2.proactive.scheduler.common.job.TaskFlowJob) JavaTask(org.ow2.proactive.scheduler.common.task.JavaTask) ForkEnvironment(org.ow2.proactive.scheduler.common.task.ForkEnvironment)

Example 77 with JavaTask

use of org.ow2.proactive.scheduler.common.task.JavaTask in project scheduling by ow2-proactive.

the class SchedulingServiceTest1 method createTestJob.

private TaskFlowJob createTestJob() throws Exception {
    TaskFlowJob job = new TaskFlowJob();
    job.setName(this.getClass().getSimpleName());
    JavaTask task1 = new JavaTask();
    task1.setExecutableClassName("class");
    task1.setName("task1");
    job.addTask(task1);
    return job;
}
Also used : TaskFlowJob(org.ow2.proactive.scheduler.common.job.TaskFlowJob) JavaTask(org.ow2.proactive.scheduler.common.task.JavaTask)

Example 78 with JavaTask

use of org.ow2.proactive.scheduler.common.task.JavaTask in project scheduling by ow2-proactive.

the class SchedulingServiceTest3 method createTestJob.

private TaskFlowJob createTestJob(boolean cancelJobOnError) throws Exception {
    TaskFlowJob job = new TaskFlowJob();
    job.setName(this.getClass().getSimpleName());
    JavaTask task1 = new JavaTask();
    task1.setName("javaTask");
    task1.setExecutableClassName("class");
    task1.setOnTaskError(cancelJobOnError ? OnTaskError.CANCEL_JOB : OnTaskError.NONE);
    job.addTask(task1);
    NativeTask task2 = new NativeTask();
    task2.setName("nativeTask");
    task2.setCommandLine("command line");
    job.addTask(task2);
    return job;
}
Also used : TaskFlowJob(org.ow2.proactive.scheduler.common.job.TaskFlowJob) JavaTask(org.ow2.proactive.scheduler.common.task.JavaTask) NativeTask(org.ow2.proactive.scheduler.common.task.NativeTask)

Example 79 with JavaTask

use of org.ow2.proactive.scheduler.common.task.JavaTask in project scheduling by ow2-proactive.

the class TestOperationsWhenUnlinked method createJob.

private TaskFlowJob createJob() throws Exception {
    TaskFlowJob job = new TaskFlowJob();
    job.setName(this.getClass().getSimpleName());
    JavaTask javaTask = new JavaTask();
    javaTask.setExecutableClassName(EmptyTask.class.getName());
    javaTask.setName(TASK_NAME);
    job.addTask(javaTask);
    return job;
}
Also used : TaskFlowJob(org.ow2.proactive.scheduler.common.job.TaskFlowJob) JavaTask(org.ow2.proactive.scheduler.common.task.JavaTask) EmptyTask(org.ow2.proactive.scheduler.examples.EmptyTask)

Example 80 with JavaTask

use of org.ow2.proactive.scheduler.common.task.JavaTask in project scheduling by ow2-proactive.

the class TestOperationsWhenUnlinked method createJobWithPendingTask.

private TaskFlowJob createJobWithPendingTask(boolean addNormalTask) throws Exception {
    TaskFlowJob job = new TaskFlowJob();
    job.setName(this.getClass().getSimpleName() + "_pending");
    job.setOnTaskError(OnTaskError.CONTINUE_JOB_EXECUTION);
    if (addNormalTask) {
        JavaTask javaTask = new JavaTask();
        javaTask.setExecutableClassName(EmptyTask.class.getName());
        javaTask.setName(TASK_NAME);
        job.addTask(javaTask);
    }
    JavaTask javaTask = new JavaTask();
    javaTask.setExecutableClassName(EmptyTask.class.getName());
    javaTask.setName("TestPendingTask");
    javaTask.setSelectionScript(new SelectionScript("selected = false;", "JavaScript", false));
    job.addTask(javaTask);
    return job;
}
Also used : SelectionScript(org.ow2.proactive.scripting.SelectionScript) TaskFlowJob(org.ow2.proactive.scheduler.common.job.TaskFlowJob) JavaTask(org.ow2.proactive.scheduler.common.task.JavaTask) EmptyTask(org.ow2.proactive.scheduler.examples.EmptyTask)

Aggregations

TaskFlowJob (org.ow2.proactive.scheduler.common.job.TaskFlowJob)104 JavaTask (org.ow2.proactive.scheduler.common.task.JavaTask)104 Test (org.junit.Test)44 ForkEnvironment (org.ow2.proactive.scheduler.common.task.ForkEnvironment)24 InternalJob (org.ow2.proactive.scheduler.job.InternalJob)20 InternalTask (org.ow2.proactive.scheduler.task.internal.InternalTask)18 JobId (org.ow2.proactive.scheduler.common.job.JobId)14 NativeTask (org.ow2.proactive.scheduler.common.task.NativeTask)14 EmptyTask (org.ow2.proactive.scheduler.examples.EmptyTask)13 SelectionScript (org.ow2.proactive.scripting.SelectionScript)12 SimpleScript (org.ow2.proactive.scripting.SimpleScript)12 File (java.io.File)11 TaskResultImpl (org.ow2.proactive.scheduler.task.TaskResultImpl)11 HashMap (java.util.HashMap)10 Task (org.ow2.proactive.scheduler.common.task.Task)9 JobResult (org.ow2.proactive.scheduler.common.job.JobResult)7 ScriptTask (org.ow2.proactive.scheduler.common.task.ScriptTask)6 EmptyExecutable (functionaltests.executables.EmptyExecutable)5 JobDescriptor (org.ow2.proactive.scheduler.common.JobDescriptor)5 Scheduler (org.ow2.proactive.scheduler.common.Scheduler)5