use of org.ow2.proactive_grid_cloud_portal.studio.Script in project scheduling by ow2-proactive.
the class SchedulerClientTest method testSchedulerNodeClientCleanScript.
@Test(timeout = MAX_WAIT_TIME)
public void testSchedulerNodeClientCleanScript() throws Throwable {
ISchedulerClient client = clientInstance();
client.putThirdPartyCredential("TEST_CREDS", "mypassword_${PA_JOB_ID}");
Job job = nodeClientJob("/functionaltests/descriptors/scheduler_client_node.groovy", "/functionaltests/descriptors/scheduler_client_node_fork.groovy");
JobId jobId = submitJob(job, client);
JobResult jres = client.waitForJob(jobId, TimeUnit.MINUTES.toMillis(5));
Assert.assertNotNull(jres);
// wait 10 seconds because it is possible clean script executes after job
Thread.sleep(10000);
String jobLog = client.getJobServerLogs("" + jobId);
// assert schedulerapi.connect() worked
Assert.assertThat(jobLog, CoreMatchers.containsString("SCHEDULERAPI_URI_LIST_NOT_NULL=true"));
// assert userspaceapi.connect() worked
Assert.assertThat(jobLog, CoreMatchers.containsString("USERSPACE_FILE_LIST_NOT_NULL=true"));
// assert globalspaceapi.connect() worked
Assert.assertThat(jobLog, CoreMatchers.containsString("GLOBALSPACE_FILE_LIST_NOT_NULL=true"));
// assert globalspaceapi.connect() worked
Assert.assertThat(jobLog, CoreMatchers.containsString("TEST_CREDS=mypassword_" + jobId.toString()));
}
use of org.ow2.proactive_grid_cloud_portal.studio.Script in project scheduling by ow2-proactive.
the class CheckEligibleTaskDescriptorScriptTest method testOnlyCleanScriptContainsAPIBinding.
@Test
public void testOnlyCleanScriptContainsAPIBinding() throws InvalidScriptException {
Script s = scriptWithApiBindingClient();
Script s2 = scriptWithoutApiBinding();
FlowScript fs = flowScriptWithoutApiBinding();
Mockito.when(it.getPreScript()).thenReturn(s2);
Mockito.when(it.getPostScript()).thenReturn(s2);
Mockito.when(it.getCleaningScript()).thenReturn(s);
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_grid_cloud_portal.studio.Script in project scheduling by ow2-proactive.
the class CheckEligibleTaskDescriptorScriptTest method testOnlyFlowScriptContainsAPIBinding.
@Test
public void testOnlyFlowScriptContainsAPIBinding() throws InvalidScriptException {
Script s = scriptWithoutApiBinding();
FlowScript fs = flowScriptWithApiBindingUser();
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);
assertTrue(new CheckEligibleTaskDescriptorScript().isTaskContainsAPIBinding(etd));
}
use of org.ow2.proactive_grid_cloud_portal.studio.Script in project scheduling by ow2-proactive.
the class CheckEligibleTaskDescriptorScriptTest method testAllScriptsContainAPIBinding.
@Test
public void testAllScriptsContainAPIBinding() throws InvalidScriptException {
Script s = scriptWithApiBindingClient();
Script s1 = scriptWithApiBindingUser();
Script s2 = scriptWithApiBindingGlobal();
FlowScript fs = flowScriptWithApiBindingClient();
Mockito.when(it.getPreScript()).thenReturn(s1);
Mockito.when(it.getPostScript()).thenReturn(s2);
Mockito.when(it.getCleaningScript()).thenReturn(s2);
Mockito.when(sec.getScript()).thenReturn(s);
Mockito.when(fe.getEnvScript()).thenReturn(s);
Mockito.when(it.getFlowScript()).thenReturn(fs);
assertTrue(new CheckEligibleTaskDescriptorScript().isTaskContainsAPIBinding(etd));
}
use of org.ow2.proactive_grid_cloud_portal.studio.Script in project scheduling by ow2-proactive.
the class CheckEligibleTaskDescriptorScriptTest method testAllScriptsNotContainAPIBinding.
@Test
public void testAllScriptsNotContainAPIBinding() throws InvalidScriptException {
Script s = scriptWithoutApiBinding();
FlowScript fs = flowScriptWithoutApiBinding();
Mockito.when(it.getPreScript()).thenReturn(s);
Mockito.when(it.getPostScript()).thenReturn(s);
Mockito.when(it.getCleaningScript()).thenReturn(s);
Mockito.when(sec.getScript()).thenReturn(s);
Mockito.when(fe.getEnvScript()).thenReturn(s);
Mockito.when(it.getFlowScript()).thenReturn(fs);
assertFalse(new CheckEligibleTaskDescriptorScript().isTaskContainsAPIBinding(etd));
}
Aggregations