use of org.ow2.proactive.scheduler.common.task.flow.FlowScript in project scheduling by ow2-proactive.
the class CheckEligibleTaskDescriptorScriptTest method testAllScriptsNull.
@Test
public void testAllScriptsNull() throws InvalidScriptException {
Script s = null;
FlowScript fs = null;
Mockito.when(it.getPreScript()).thenReturn(s);
Mockito.when(it.getPostScript()).thenReturn(s);
Mockito.when(it.getCleaningScript()).thenReturn(s);
Mockito.when(fe.getEnvScript()).thenReturn(s);
Mockito.when(sec.getScript()).thenReturn(s);
Mockito.when(it.getFlowScript()).thenReturn(fs);
assertFalse(new CheckEligibleTaskDescriptorScript().isTaskContainsAPIBinding(etd));
}
use of org.ow2.proactive.scheduler.common.task.flow.FlowScript in project scheduling by ow2-proactive.
the class CheckEligibleTaskDescriptorScriptTest method testOnlyPostScriptContainsAPIBinding.
@Test
public void testOnlyPostScriptContainsAPIBinding() throws InvalidScriptException {
Script s = scriptWithApiBindingClient();
Script s2 = scriptWithoutApiBinding();
FlowScript fs = flowScriptWithoutApiBinding();
Mockito.when(it.getPreScript()).thenReturn(s2);
Mockito.when(it.getPostScript()).thenReturn(s);
Mockito.when(it.getCleaningScript()).thenReturn(s2);
Mockito.when(sec.getScript()).thenReturn(s2);
Mockito.when(fe.getEnvScript()).thenReturn(s2);
Mockito.when(it.getFlowScript()).thenReturn(fs);
assertTrue(new CheckEligibleTaskDescriptorScript().isTaskContainsAPIBinding(etd));
}
use of org.ow2.proactive.scheduler.common.task.flow.FlowScript in project scheduling by ow2-proactive.
the class CheckEligibleTaskDescriptorScriptTest method testOnlyPreScriptContainsAPIBinding.
@Test
public void testOnlyPreScriptContainsAPIBinding() throws InvalidScriptException {
Script s = scriptWithApiBindingUser();
Script s2 = scriptWithoutApiBinding();
FlowScript fs = flowScriptWithoutApiBinding();
Mockito.when(it.getPreScript()).thenReturn(s);
Mockito.when(it.getPostScript()).thenReturn(s2);
Mockito.when(it.getCleaningScript()).thenReturn(s2);
Mockito.when(sec.getScript()).thenReturn(s2);
Mockito.when(fe.getEnvScript()).thenReturn(s2);
Mockito.when(it.getFlowScript()).thenReturn(fs);
assertTrue(new CheckEligibleTaskDescriptorScript().isTaskContainsAPIBinding(etd));
}
use of org.ow2.proactive.scheduler.common.task.flow.FlowScript 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.common.task.flow.FlowScript in project scheduling by ow2-proactive.
the class TagTest method execute.
private void execute(InternalTask task) {
task.setExecuterInformation(executerInformationMock);
job.startTask(task);
FlowScript script = task.getFlowScript();
FlowAction action = null;
if (script != null) {
action = task.getFlowScript().execute().getResult();
}
job.terminateTask(false, task.getId(), schedulerStateUpdateMock, action, resultMock);
System.out.println("executed " + task.getName() + " -> " + getTaskNameList(true));
}
Aggregations