use of org.ow2.proactive.scheduler.common.job.TaskFlowJob in project scheduling by ow2-proactive.
the class TestStaxJobFactory method testCreateJobShouldUseVariableMapParameterToReplaceVariableValue.
@Test
public void testCreateJobShouldUseVariableMapParameterToReplaceVariableValue() throws Exception {
Map<String, String> variablesMap = Maps.newHashMap();
variablesMap.put("from_create_job_parameter", "from_create_job_parameter_value");
TaskFlowJob testJob = (TaskFlowJob) factory.createJob(jobDescriptorUri, variablesMap);
assertEquals("from_create_job_parameter_value", testJob.getVariables().get("from_create_job_parameter").getValue());
}
use of org.ow2.proactive.scheduler.common.job.TaskFlowJob in project scheduling by ow2-proactive.
the class TestStaxJobFactory method testJobCreationAttributeOrderDefinitionGenericInformationXmlElement.
/**
* The next 3 tests are there to check that parsing a workflow XML description involving XML elements
* with more than 1 attribute (defined in any order) returns an object description with expected values
* in corresponding data structures.
*/
@Test
public void testJobCreationAttributeOrderDefinitionGenericInformationXmlElement() throws URISyntaxException, JobCreationException {
TaskFlowJob job = (TaskFlowJob) factory.createJob(getResource("job_attr_def_generic_information_xml_element.xml"));
Map<String, String> genericInformation = job.getTask("task").getGenericInformation();
assertExpectedKeyValueEntriesMatch(genericInformation);
}
use of org.ow2.proactive.scheduler.common.job.TaskFlowJob in project scheduling by ow2-proactive.
the class TestStaxJobFactory method testCreateJobShouldUseVariableMapToReplaceTaskGenericInfoVariables.
@Test
public void testCreateJobShouldUseVariableMapToReplaceTaskGenericInfoVariables() throws Exception {
Map<String, String> variablesMap = Maps.newHashMap();
variablesMap.put("task_generic_info", "updated_task_generic_info_value2");
TaskFlowJob testJob = (TaskFlowJob) factory.createJob(jobDescriptorUri, variablesMap);
assertEquals("updated_task_generic_info_value2", testJob.getTask("task1").getGenericInformation().get("task_generic_info"));
}
use of org.ow2.proactive.scheduler.common.job.TaskFlowJob in project scheduling by ow2-proactive.
the class TestStaxJobFactory method testTaskVariables.
@Test
public void testTaskVariables() throws URISyntaxException, JobCreationException {
TaskFlowJob job = (TaskFlowJob) factory.createJob(getResource("task_variables.xml"));
Map<String, TaskVariable> taskVariables = job.getTask("task").getVariables();
assertEquals(2, taskVariables.size());
TaskVariable taskVariable = taskVariables.get("name1");
assertNotNull(taskVariable);
assertEquals("name1", taskVariable.getName());
assertEquals("value1", taskVariable.getValue());
assertEquals("model1", taskVariable.getModel());
assertFalse(taskVariable.isJobInherited());
taskVariable = taskVariables.get("name2");
assertNotNull(taskVariable);
assertEquals("name2", taskVariable.getName());
assertEquals("value2", taskVariable.getValue());
assertEquals("model2", taskVariable.getModel());
assertTrue(taskVariable.isJobInherited());
}
use of org.ow2.proactive.scheduler.common.job.TaskFlowJob in project scheduling by ow2-proactive.
the class TestStaxJobFactory method testCreateJobShouldUseJobVariablesToReplaceTaskGenericInfoVariables.
@Test
public void testCreateJobShouldUseJobVariablesToReplaceTaskGenericInfoVariables() throws Exception {
TaskFlowJob testJob = (TaskFlowJob) factory.createJob(jobDescriptorUri);
assertEquals("updated_task_generic_info_value", testJob.getTask("task1").getGenericInformation().get("task_generic_info"));
}
Aggregations