jpaService.execute(new CoordJobUpdateJPAExecutor(coordJob1));
coordJob2.setPauseTime(pauseTime);
coordJob2.setBundleId(job.getId());
jpaService.execute(new CoordJobUpdateJPAExecutor(coordJob2));
BundleJobGetJPAExecutor bundleJobGetExecutor = new BundleJobGetJPAExecutor(job.getId());
job = jpaService.execute(bundleJobGetExecutor);
assertEquals(Job.Status.RUNNING, job.getStatus());
Runnable pauseStartRunnable = new PauseTransitRunnable();
pauseStartRunnable.run();
final String jobId = job.getId();
waitFor(10 * 1000, new Predicate() {
public boolean evaluate() throws Exception {
BundleJobBean bJob1 = jpaService.execute(new BundleJobGetJPAExecutor(jobId));
return bJob1.getStatus() == Job.Status.PAUSED;
}
});
final String coordJobId1 = coordJob1.getId();
final String coordJobId2 = coordJob2.getId();
waitFor(10 * 1000, new Predicate() {
public boolean evaluate() throws Exception {
CoordinatorJobBean cJob1 = jpaService.execute(new CoordJobGetJPAExecutor(coordJobId1));
return cJob1.getStatus() == Job.Status.PAUSED;
}
});
job = jpaService.execute(new BundleJobGetJPAExecutor(jobId));
assertEquals(Job.Status.PAUSED, job.getStatus());
coordJob1 = jpaService.execute(new CoordJobGetJPAExecutor(coordJobId1));
assertEquals(Job.Status.PAUSED, coordJob1.getStatus());