assertTrue(nextTime < toLate);
}
@Test
public void testGetExecutionCount() throws Exception {
final JobSchedulerViewMBean view = getJobSchedulerMBean();
assertNotNull(view);
assertTrue(view.getAllJobs().isEmpty());
scheduleMessage(10000, 1000, 10);
assertFalse(view.getAllJobs().isEmpty());
TabularData jobs = view.getAllJobs();
assertEquals(1, jobs.size());
String jobId = null;
for (Object key : jobs.keySet()) {
jobId = ((List<?>)key).get(0).toString();
}
final String fixedJobId = jobId;
LOG.info("Attempting to get execution count for Job: {}", jobId);
assertEquals(0, view.getExecutionCount(jobId));
assertTrue("Should execute again", Wait.waitFor(new Wait.Condition() {
@Override
public boolean isSatisified() throws Exception {
return view.getExecutionCount(fixedJobId) > 0;
}
}));
}