use of org.ow2.proactive.resourcemanager.authentication.Client in project scheduling by ow2-proactive.
the class SchedulerClientTest method testRMNodeClient.
@Test(timeout = MAX_WAIT_TIME)
public void testRMNodeClient() throws Throwable {
ISchedulerClient client = clientInstance();
Job job = nodeClientJob("/functionaltests/descriptors/rm_client_node.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.assertNotNull(tRes);
Assert.assertTrue(((ArrayList) tRes.value()).get(0) instanceof RMNodeEvent);
}
use of org.ow2.proactive.resourcemanager.authentication.Client in project scheduling by ow2-proactive.
the class SchedulerClientTest method getResultMap.
@Test(timeout = MAX_WAIT_TIME)
public void getResultMap() throws Throwable {
ISchedulerClient client = clientInstance();
Job job = createJob(JobResultTask.class);
JobId jobId = client.submit(job);
final JobResult jobResult = client.waitForJob(jobId, TimeUnit.MINUTES.toMillis(2000));
assertFalse(jobResult.getResultMap().isEmpty());
Assert.assertEquals(jobResult.getResultMap().get("myvar"), "myvalue");
}
use of org.ow2.proactive.resourcemanager.authentication.Client in project scheduling by ow2-proactive.
the class SchedulerClientTest method testPushPullDeleteEmptyFile.
@Test(timeout = MAX_WAIT_TIME)
public void testPushPullDeleteEmptyFile() throws Exception {
File emptyFile = File.createTempFile("emptyFile", ".tmp");
ISchedulerClient client = clientInstance();
// Push the empty file into the userspace
client.pushFile("USERSPACE", "", emptyFile.getName(), emptyFile.getCanonicalPath());
// Delete the local file
Assert.assertTrue("Unable to delete the local file after push, maybe there are still some open streams?", emptyFile.delete());
// Pull it from the userspace to be sure that it was pushed
client.pullFile("USERSPACE", "", emptyFile.getCanonicalPath());
// Check the file was pulled
Assert.assertTrue("Unable to pull the empty file, maybe the pull mechanism is broken?", emptyFile.exists());
// Delete the local file
Assert.assertTrue("Unable to delete the local file after pull, maybe there are still some open streams?", emptyFile.delete());
// Delete the file in the user space
// TODO: TEST THIS
client.deleteFile("USERSPACE", "/" + emptyFile.getName());
// LATER
}
use of org.ow2.proactive.resourcemanager.authentication.Client in project scheduling by ow2-proactive.
the class SchedulerClientTest method testWaitForTerminatingJob.
@Test(timeout = MAX_WAIT_TIME)
public void testWaitForTerminatingJob() throws Exception {
ISchedulerClient client = clientInstance();
Job job = defaultJob();
JobId jobId = submitJob(job, client);
// should return immediately
client.waitForJob(jobId, TimeUnit.MINUTES.toMillis(3));
}
use of org.ow2.proactive.resourcemanager.authentication.Client in project scheduling by ow2-proactive.
the class SchedulerClientTest method testWaitForNonTerminatingJob.
@Test(timeout = MAX_WAIT_TIME, expected = TimeoutException.class)
public void testWaitForNonTerminatingJob() throws Exception {
ISchedulerClient client = clientInstance();
Job job = pendingJob();
JobId jobId = submitJob(job, client);
try {
client.waitForJob(jobId, TimeUnit.SECONDS.toMillis(10));
} finally {
// Once the TimeoutException has been thrown
// kill the job to free the node
client.killJob(jobId);
}
}
Aggregations