use of org.ow2.proactive.scheduler.core.db.JobContent in project scheduling by ow2-proactive.
the class TestWorkflowReSubmission method testEmptyVarsEmptyInfo.
@Test
public void testEmptyVarsEmptyInfo() throws Throwable {
JobId jobId = schedulerHelper.submitJob(new File(jobDescriptor.toURI()).getAbsolutePath());
JobId jobId1 = schedulerHelper.getSchedulerInterface().reSubmit(jobId, Collections.emptyMap(), Collections.emptyMap(), null);
schedulerHelper.waitForEventJobFinished(jobId);
schedulerHelper.waitForEventJobFinished(jobId1);
String jobContent = schedulerHelper.getSchedulerInterface().getJobContent(jobId);
String jobContent1 = schedulerHelper.getSchedulerInterface().getJobContent(jobId1);
assertEquals(jobContent, jobContent1);
assertFalse(jobContent.contains("<variables>"));
assertFalse(jobContent.contains("<genericInformation>"));
}
use of org.ow2.proactive.scheduler.core.db.JobContent in project scheduling by ow2-proactive.
the class TestWorkflowReSubmission method testAddVarsAddInfo.
@Test
public void testAddVarsAddInfo() throws Throwable {
JobId jobId = schedulerHelper.submitJob(new File(jobDescriptor.toURI()).getAbsolutePath());
Map<String, String> vars = new HashMap<>();
vars.put("x", "50");
JobId jobId1 = schedulerHelper.getSchedulerInterface().reSubmit(jobId, vars, vars, null);
schedulerHelper.waitForEventJobFinished(jobId);
schedulerHelper.waitForEventJobFinished(jobId1);
String jobContent = schedulerHelper.getSchedulerInterface().getJobContent(jobId);
String jobContent1 = schedulerHelper.getSchedulerInterface().getJobContent(jobId1);
assertFalse(jobContent.contains("<variables>"));
assertFalse(jobContent.contains("<genericInformation>"));
assertTrue(jobContent1.contains("<variables>"));
assertTrue(jobContent1.contains("<genericInformation>"));
}
use of org.ow2.proactive.scheduler.core.db.JobContent in project scheduling by ow2-proactive.
the class TestWorkflowReSubmission method testNullVarsNullInfo.
@Test
public void testNullVarsNullInfo() throws Throwable {
JobId jobId = schedulerHelper.submitJob(new File(jobDescriptor.toURI()).getAbsolutePath());
JobId jobId1 = schedulerHelper.getSchedulerInterface().reSubmit(jobId, null, null, null);
schedulerHelper.waitForEventJobFinished(jobId);
schedulerHelper.waitForEventJobFinished(jobId1);
String jobContent = schedulerHelper.getSchedulerInterface().getJobContent(jobId);
String jobContent1 = schedulerHelper.getSchedulerInterface().getJobContent(jobId1);
assertEquals(jobContent, jobContent1);
assertFalse(jobContent.contains("<variables>"));
assertFalse(jobContent.contains("<genericInformation>"));
}
use of org.ow2.proactive.scheduler.core.db.JobContent in project scheduling by ow2-proactive.
the class TestWorkflowReSubmission method testAddInfo.
@Test
public void testAddInfo() throws Throwable {
JobId jobId = schedulerHelper.submitJob(new File(jobDescriptor.toURI()).getAbsolutePath());
Map<String, String> info = new HashMap<>();
info.put("x", "50");
JobId jobId1 = schedulerHelper.getSchedulerInterface().reSubmit(jobId, null, info, null);
schedulerHelper.waitForEventJobFinished(jobId);
schedulerHelper.waitForEventJobFinished(jobId1);
String jobContent = schedulerHelper.getSchedulerInterface().getJobContent(jobId);
String jobContent1 = schedulerHelper.getSchedulerInterface().getJobContent(jobId1);
assertFalse(jobContent.contains("<variables>"));
assertFalse(jobContent.contains("<genericInformation>"));
assertFalse(jobContent1.contains("<variables>"));
assertTrue(jobContent1.contains("<genericInformation>"));
}
use of org.ow2.proactive.scheduler.core.db.JobContent in project scheduling by ow2-proactive.
the class GetJobContentGeneratorTest method testReplaceVars.
@Test
public void testReplaceVars() throws IOException {
URL url = Resources.getResource("org/ow2/proactive/scheduler/common/job/factories/job_with_vars_and_info.xml");
String jobContent = Resources.toString(url, Charsets.UTF_8);
Map<String, JobVariable> vars = new HashMap<>();
vars.put("var", new JobVariable("var", "myvalue"));
final String newJobContent = generator.replaceVarsAndGenericInfo(jobContent, vars, Collections.emptyMap());
assertTrue(newJobContent.contains("<variables>"));
assertTrue(newJobContent.contains("myvalue"));
assertFalse(newJobContent.contains("<genericInformation>"));
assertNotEquals(jobContent, newJobContent);
}
Aggregations