Search in sources :

Example 21 with ScriptTask

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

the class TestForkedTaskWorkingDir method scriptTask.

private void scriptTask() throws Exception {
    File input = createTempDirectory("test", ".input_script", null);
    File output = createTempDirectory("test", ".output_script", null);
    FileUtils.touch(new File(input, "inputFile_script.txt"));
    TaskFlowJob job = (TaskFlowJob) StaxJobFactory.getFactory().createJob(new File(TestForkedTaskWorkingDir.class.getResource("/functionaltests/descriptors/Job_forked_script_task_working_dir.xml").toURI()).getAbsolutePath());
    job.setInputSpace(input.toURI().toString());
    job.setOutputSpace(output.toURI().toString());
    schedulerHelper.testJobSubmission(job);
    assertTrue(new File(output, "outputFile_script.txt").exists());
}
Also used : TaskFlowJob(org.ow2.proactive.scheduler.common.job.TaskFlowJob) File(java.io.File)

Example 22 with ScriptTask

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

the class RunningTaskRecoveryWithDownNodeTest method submitJob.

private JobId submitJob() throws Exception {
    TaskFlowJob job = new TaskFlowJob();
    job.setName("JOB-" + RunningTaskRecoveryWithDownNodeTest.class.getSimpleName());
    for (int i = 0; i < NUMBER_OF_TASKS; i++) {
        ScriptTask st1 = new ScriptTask();
        st1.setName(TASK_BASE_NAME + i);
        st1.setScript(new TaskScript(new SimpleScript("Thread.sleep(60000)", "groovy")));
        job.addTask(st1);
    }
    JobId jobid = schedulerHelper.submitJob(job);
    schedulerHelper.waitForEventJobRunning(jobid);
    return jobid;
}
Also used : ScriptTask(org.ow2.proactive.scheduler.common.task.ScriptTask) TaskScript(org.ow2.proactive.scripting.TaskScript) TaskFlowJob(org.ow2.proactive.scheduler.common.job.TaskFlowJob) SimpleScript(org.ow2.proactive.scripting.SimpleScript) JobId(org.ow2.proactive.scheduler.common.job.JobId)

Aggregations

ScriptTask (org.ow2.proactive.scheduler.common.task.ScriptTask)16 TaskScript (org.ow2.proactive.scripting.TaskScript)15 TaskFlowJob (org.ow2.proactive.scheduler.common.job.TaskFlowJob)14 SimpleScript (org.ow2.proactive.scripting.SimpleScript)13 Task (org.ow2.proactive.scheduler.common.task.Task)5 JobCreationException (org.ow2.proactive.scheduler.common.exception.JobCreationException)4 ForkEnvironment (org.ow2.proactive.scheduler.common.task.ForkEnvironment)4 JavaTask (org.ow2.proactive.scheduler.common.task.JavaTask)4 NativeTask (org.ow2.proactive.scheduler.common.task.NativeTask)4 File (java.io.File)3 JobId (org.ow2.proactive.scheduler.common.job.JobId)3 SelectionScript (org.ow2.proactive.scripting.SelectionScript)3 FileNotFoundException (java.io.FileNotFoundException)2 XMLStreamException (javax.xml.stream.XMLStreamException)2 VerifierConfigurationException (org.iso_relax.verifier.VerifierConfigurationException)2 InternalException (org.ow2.proactive.scheduler.common.exception.InternalException)2 JobValidationException (org.ow2.proactive.scheduler.common.exception.JobValidationException)2 TaskResult (org.ow2.proactive.scheduler.common.task.TaskResult)2 ScriptExecutableContainer (org.ow2.proactive.scheduler.task.containers.ScriptExecutableContainer)2 InternalForkedScriptTask (org.ow2.proactive.scheduler.task.internal.InternalForkedScriptTask)2