use of org.ow2.proactive.scheduler.task.internal.InternalScriptTask in project scheduling by ow2-proactive.
the class TagTest method testReplicationLoopSelfCronTag.
@Test
public void testReplicationLoopSelfCronTag() throws Exception {
InternalScriptTask task1 = createLoopTask("T1", "loop = '* * * * *'", null, "T1", false);
execute(new String[] { "T1", "T1#1" });
assertTagsStartsWith("LOOP-T1-", new String[] { "T1#1", "T1#2" });
}
use of org.ow2.proactive.scheduler.task.internal.InternalScriptTask in project scheduling by ow2-proactive.
the class TagTest method createReplicateTask.
private InternalScriptTask createReplicateTask(String name, InternalTask[] dependences, FlowBlock block, String matchingBlock, int nbRuns) throws InvalidScriptException {
InternalScriptTask result = createTask(name, dependences, block, matchingBlock);
FlowScript replicate = FlowScript.createReplicateFlowScript("runs = " + nbRuns + ";");
result.setFlowScript(replicate);
return result;
}
use of org.ow2.proactive.scheduler.task.internal.InternalScriptTask in project scheduling by ow2-proactive.
the class TagTest method testTaskLoggerWithTag.
@Test
public void testTaskLoggerWithTag() throws InvalidScriptException, UnknownTaskException {
InternalScriptTask task1 = createLoopTask("T1", "loop = true;", null, "T1", false);
task1.setTag("aTag");
TaskLogger.getInstance().info(job.getTask("T1").getId(), "a message");
}
use of org.ow2.proactive.scheduler.task.internal.InternalScriptTask in project scheduling by ow2-proactive.
the class TagTest method testTaskLogger.
/*
* @Test
* public void testReplicationLoopDoubleTag() throws Exception {
* InternalTask T1 = createTask("T1", null, FlowBlock.START, "T5");
* InternalTask T2 = createTask("T2", new InternalTask[]{T1}, FlowBlock.START, "T4");
* InternalTask T3 = createTask("T3", new InternalTask[]{T2}, null, null);
* InternalTask T4 = createLoopTask("T4", "loop = true;", new InternalTask[]{T3}, "T2", true);
* InternalTask T5 = createLoopTask("T5", "loop = true;", new InternalTask[]{T4}, "T1", true);
*
* job.getJobDescriptor().getEligibleTasks();
*
*
* execute(new String[]{"T5"});
*
* assertTags("REPLICATE-T1-1", new String[]{"T2*1", "T3*1", "T4*1", "T5*1", "T6*1"});
* assertTags("REPLICATE-T1-2", new String[]{"T2*2", "T3*2", "T4*2", "T5*2", "T6*2"});
* assertTags("REPLICATE-T2*1-3", new String[]{"T3*3", "T4*3", "T5*3"});
* assertTags("REPLICATE-T2*1-4", new String[]{"T3*4", "T4*4", "T5*4"});
* assertTags("REPLICATE-T2*2-5", new String[]{"T3*5", "T4*5", "T5*5"});
* assertTags("REPLICATE-T2*2-6", new String[]{"T3*6", "T4*6", "T5*6"});
* }
*/
@Test
public void testTaskLogger() throws InvalidScriptException, UnknownTaskException {
InternalScriptTask task1 = createLoopTask("T1", "loop = true;", null, "T1", false);
TaskLogger.getInstance().info(job.getTask("T1").getId(), "a message");
}
use of org.ow2.proactive.scheduler.task.internal.InternalScriptTask in project scheduling by ow2-proactive.
the class SchedulerStateRestJobLogsTest method job_full_logs_not_finished.
@Test
public void job_full_logs_not_finished() throws Exception {
InternalTaskFlowJob jobState = new InternalTaskFlowJob();
jobState.addTask(new InternalScriptTask(jobState));
when(mockScheduler.getJobState("123")).thenReturn(jobState);
InputStream fullLogs = restScheduler.jobFullLogs(validSessionId, "123", validSessionId);
assertNull(fullLogs);
}
Aggregations