use of org.ow2.proactive.scheduler.common.exception.UserException in project scheduling by ow2-proactive.
the class RestSmartProxyTest method createInErrorJob.
private TaskFlowJob createInErrorJob() throws InvalidScriptException, UserException {
TaskFlowJob job = new TaskFlowJob();
job.setName("JobWithInErrorTask");
ScriptTask scriptTask = new ScriptTask();
scriptTask.setName(inerrorTaskName);
scriptTask.setScript(new TaskScript(new SimpleScript("syntax error", "python")));
scriptTask.setOnTaskError(OnTaskError.PAUSE_TASK);
scriptTask.setMaxNumberOfExecution(2);
job.addTask(scriptTask);
job.setInputSpace(userspace);
job.setOutputSpace(userspace);
return job;
}
use of org.ow2.proactive.scheduler.common.exception.UserException in project scheduling by ow2-proactive.
the class TestDataspaceConcurrentKilling method createJobWithFileTransfers.
public Job createJobWithFileTransfers() throws UserException, InvalidScriptException {
TaskFlowJob job = new TaskFlowJob();
job.setName(JOB_NAME);
job.setOnTaskError(OnTaskError.CONTINUE_JOB_EXECUTION);
for (int i = 0; i < NB_TASKS; i++) {
ScriptTask st = new ScriptTask();
st.setName(TASK_NAME + i);
st.setScript(new TaskScript(new SimpleScript("new File(localspace, \"" + FILE_NAME + i + "\").createNewFile(); java.lang.Thread.sleep(1000)", "groovy")));
st.addOutputFiles(FILE_NAME + i, OutputAccessMode.TransferToUserSpace);
job.addTask(st);
}
return job;
}
use of org.ow2.proactive.scheduler.common.exception.UserException in project scheduling by ow2-proactive.
the class TestRestoreWorkflowJobs method createJobWithAllKindOfScripts.
private TaskFlowJob createJobWithAllKindOfScripts() throws InvalidScriptException, UserException {
TaskFlowJob jobDef = new TaskFlowJob();
JavaTask t = task("T");
ForkEnvironment forkEnvironment = new ForkEnvironment();
SimpleScript aScript = new SimpleScript("", "");
forkEnvironment.setEnvScript(aScript);
t.setPreScript(aScript);
t.setPostScript(aScript);
t.setCleaningScript(aScript);
t.setSelectionScript(new SelectionScript("", ""));
t.setFlowScript(FlowScript.createContinueFlowScript());
t.setForkEnvironment(forkEnvironment);
jobDef.addTask(t);
return jobDef;
}
Aggregations