RESOLVED - issue BATCH-1421: Add method to get all job names to JobExplorer
This commit is contained in:
@@ -80,4 +80,12 @@ public interface JobExplorer {
|
||||
*/
|
||||
Set<JobExecution> findRunningJobExecutions(String jobName);
|
||||
|
||||
/**
|
||||
* Query the repository for all unique {@link JobInstance} names (sorted
|
||||
* alphabetically).
|
||||
*
|
||||
* @return the set of job names that have been executed
|
||||
*/
|
||||
List<String> getJobNames();
|
||||
|
||||
}
|
||||
|
||||
@@ -159,6 +159,13 @@ public class SimpleJobExplorer implements JobExplorer {
|
||||
int count) {
|
||||
return jobInstanceDao.getJobInstances(jobName, start, count);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.batch.core.explore.JobExplorer#getJobNames()
|
||||
*/
|
||||
public List<String> getJobNames() {
|
||||
return jobInstanceDao.getJobNames();
|
||||
}
|
||||
|
||||
/*
|
||||
* Find all dependencies for a JobExecution, including JobInstance (which
|
||||
|
||||
@@ -174,4 +174,14 @@ public class SimpleJobExplorerTests extends TestCase {
|
||||
verify(jobExecutionDao, jobInstanceDao, stepExecutionDao);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetJobNames() throws Exception {
|
||||
jobInstanceDao.getJobNames();
|
||||
EasyMock.expectLastCall().andReturn(
|
||||
Collections.singletonList("foo"));
|
||||
replay(jobExecutionDao, jobInstanceDao, stepExecutionDao);
|
||||
jobExplorer.getJobNames();
|
||||
verify(jobExecutionDao, jobInstanceDao, stepExecutionDao);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -298,6 +298,10 @@ public class CommandLineJobRunnerTests {
|
||||
public StepExecution getStepExecution(Long jobExecutionId, Long stepExecutionId) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public List<String> getJobNames() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user