repo = batchEnvironment.getJobRepository();
}
@Test
public void addRemoveJob() throws Exception {
final Job job = ArchiveXmlLoader.loadJobXml("exception-class-filter.xml", this.getClass().getClassLoader(), new ArrayList<Job>());
repo.removeJob(job.getId());
final Collection<Job> jobs = repo.getJobs();
final int existingJobsCount = jobs.size();
repo.addJob(job);
Assert.assertEquals(existingJobsCount + 1, repo.getJobs().size());
repo.removeJob(job.getId());
Assert.assertEquals(existingJobsCount, repo.getJobs().size());
repo.removeJob(job.getId());
Assert.assertEquals(existingJobsCount, repo.getJobs().size());
}