RESOLVED - issue BATCH-945: Add support for step and job name in late binding
Also added some null checks in SimpleJobExplorer
This commit is contained in:
@@ -72,6 +72,14 @@ public class SimpleJobExplorerTests extends TestCase {
|
||||
verify(jobExecutionDao, jobInstanceDao, stepExecutionDao);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMissingGetJobExecution() throws Exception {
|
||||
expect(jobExecutionDao.getJobExecution(123L)).andReturn(null);
|
||||
replay(jobExecutionDao);
|
||||
assertNull(jobExplorer.getJobExecution(123L));
|
||||
verify(jobExecutionDao);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetStepExecution() throws Exception {
|
||||
expect(jobExecutionDao.getJobExecution(123L)).andReturn(jobExecution);
|
||||
|
||||
@@ -41,7 +41,7 @@ public class StepContextTests {
|
||||
|
||||
private List<String> list = new ArrayList<String>();
|
||||
|
||||
private StepExecution stepExecution = new StepExecution("step", new JobExecution(0L), 1L);
|
||||
private StepExecution stepExecution = new StepExecution("step", new JobExecution(new JobInstance(2L, null, "job"), 0L), 1L);
|
||||
|
||||
private StepContext context = new StepContext(stepExecution);
|
||||
|
||||
@@ -133,6 +133,16 @@ public class StepContextTests {
|
||||
assertTrue(list.contains("spam"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStepName() throws Exception {
|
||||
assertEquals("step", context.getStepName());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testJobName() throws Exception {
|
||||
assertEquals("job", context.getJobName());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStepExecutionContext() throws Exception {
|
||||
ExecutionContext executionContext = stepExecution.getExecutionContext();
|
||||
@@ -140,6 +150,12 @@ public class StepContextTests {
|
||||
assertEquals("bar", context.getStepExecutionContext().get("foo"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSystemProperties() throws Exception {
|
||||
System.setProperty("foo", "bar");
|
||||
assertEquals("bar", context.getSystemProperties().getProperty("foo"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testJobExecutionContext() throws Exception {
|
||||
ExecutionContext executionContext = stepExecution.getJobExecution().getExecutionContext();
|
||||
|
||||
Reference in New Issue
Block a user