Search in sources :

Example 16 with TaskFlowJob

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());
}
Also used : TaskFlowJob(org.ow2.proactive.scheduler.common.job.TaskFlowJob) Test(org.junit.Test)

Example 17 with TaskFlowJob

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);
}
Also used : TaskFlowJob(org.ow2.proactive.scheduler.common.job.TaskFlowJob) Test(org.junit.Test)

Example 18 with TaskFlowJob

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"));
}
Also used : TaskFlowJob(org.ow2.proactive.scheduler.common.job.TaskFlowJob) Test(org.junit.Test)

Example 19 with TaskFlowJob

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());
}
Also used : TaskFlowJob(org.ow2.proactive.scheduler.common.job.TaskFlowJob) TaskVariable(org.ow2.proactive.scheduler.common.task.TaskVariable) Test(org.junit.Test)

Example 20 with TaskFlowJob

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"));
}
Also used : TaskFlowJob(org.ow2.proactive.scheduler.common.job.TaskFlowJob) Test(org.junit.Test)

Aggregations

TaskFlowJob (org.ow2.proactive.scheduler.common.job.TaskFlowJob)184 JavaTask (org.ow2.proactive.scheduler.common.task.JavaTask)92 Test (org.junit.Test)81 InternalJob (org.ow2.proactive.scheduler.job.InternalJob)49 JobId (org.ow2.proactive.scheduler.common.job.JobId)33 File (java.io.File)31 ForkEnvironment (org.ow2.proactive.scheduler.common.task.ForkEnvironment)25 NativeTask (org.ow2.proactive.scheduler.common.task.NativeTask)22 InternalTask (org.ow2.proactive.scheduler.task.internal.InternalTask)21 SimpleScript (org.ow2.proactive.scripting.SimpleScript)20 JobResult (org.ow2.proactive.scheduler.common.job.JobResult)18 ScriptTask (org.ow2.proactive.scheduler.common.task.ScriptTask)16 Task (org.ow2.proactive.scheduler.common.task.Task)16 JobCreationException (org.ow2.proactive.scheduler.common.exception.JobCreationException)13 TaskScript (org.ow2.proactive.scripting.TaskScript)13 JobState (org.ow2.proactive.scheduler.common.job.JobState)12 TaskResult (org.ow2.proactive.scheduler.common.task.TaskResult)12 ArrayList (java.util.ArrayList)11 TaskResultImpl (org.ow2.proactive.scheduler.task.TaskResultImpl)11 HashMap (java.util.HashMap)10