use of org.ow2.proactive.scheduler.rest.ISchedulerClient in project scheduling by ow2-proactive.
the class SchedulerClientTest method testReSubmitJob.
@Test
public void testReSubmitJob() throws Exception {
ISchedulerClient client = clientInstance();
Job job = nodeClientJob("/functionaltests/descriptors/dataspace_client_node_push_delete.groovy", "/functionaltests/descriptors/dataspace_client_node_fork.groovy", null);
JobId jobId = submitJob(job, client);
JobId jobId1 = client.reSubmit(jobId, Collections.emptyMap(), Collections.emptyMap(), null);
String jobContent = client.getJobContent(jobId).replaceAll("\\s+", "");
String jobContent1 = client.getJobContent(jobId1).replaceAll("\\s+", "");
assertEquals(jobContent, jobContent1);
}
use of org.ow2.proactive.scheduler.rest.ISchedulerClient in project scheduling by ow2-proactive.
the class SchedulerClientTest method testReSubmitJobMergeVar.
@Test
public void testReSubmitJobMergeVar() throws Exception {
ISchedulerClient client = clientInstance();
Job job = nodeClientJob("/functionaltests/descriptors/dataspace_client_node_push_delete.groovy", "/functionaltests/descriptors/dataspace_client_node_fork.groovy", null);
job.getVariables().put("originalVar", new JobVariable("originalVar", "originalValue"));
JobId jobId = submitJob(job, client);
Map<String, String> vars = new HashMap<>();
vars.put("newVar", "newValue");
JobId jobId1 = client.reSubmit(jobId, vars, Collections.emptyMap(), null);
String jobContent1 = client.getJobContent(jobId1);
assertTrue(jobContent1.contains("<variables>"));
assertTrue(jobContent1.contains("originalVar"));
assertTrue(jobContent1.contains("originalValue"));
assertTrue(jobContent1.contains("newVar"));
assertTrue(jobContent1.contains("newValue"));
assertFalse(jobContent1.contains("<genericInformation>"));
}
use of org.ow2.proactive.scheduler.rest.ISchedulerClient in project scheduling by ow2-proactive.
the class SchedulerClientTest method testSchedulerNodeClientParentId.
@Test(timeout = MAX_WAIT_TIME)
public void testSchedulerNodeClientParentId() throws Throwable {
ISchedulerClient client = clientInstance();
// Submit a job with the generic informations map
JobId jobId = client.submit(jobDescriptorParentId);
TaskResult tres = client.waitForTask(jobId.toString(), "NodeClientTask", TimeUnit.MINUTES.toMillis(5));
Assert.assertNotNull(tres);
System.out.println(tres.getOutput().getAllLogs(false));
Assert.assertFalse(tres.hadException());
Assert.assertEquals(jobId.value(), tres.value());
}
use of org.ow2.proactive.scheduler.rest.ISchedulerClient in project scheduling by ow2-proactive.
the class SchedulerClientTest method testDataspaceNodeClientDisconnect.
@Test(timeout = MAX_WAIT_TIME)
public void testDataspaceNodeClientDisconnect() throws Throwable {
ISchedulerClient client = clientInstance();
Job job = nodeClientJob("/functionaltests/descriptors/scheduler_client_node_space_disconnect.groovy", null, null);
JobId jobId = submitJob(job, client);
TaskResult tres = client.waitForTask(jobId.toString(), "NodeClientTask", TimeUnit.MINUTES.toMillis(5));
System.out.println(tres.getOutput().getAllLogs(false));
Assert.assertFalse(tres.hadException());
}
use of org.ow2.proactive.scheduler.rest.ISchedulerClient in project scheduling by ow2-proactive.
the class SchedulerClientTest method testDisconnect.
@Test(timeout = MAX_WAIT_TIME)
public void testDisconnect() throws Exception {
ISchedulerClient client = clientInstance();
client.disconnect();
assertFalse(client.isConnected());
client = clientInstance();
Assert.assertTrue(client.isConnected());
}
Aggregations