@Test
public void testHostAddedToPriorityList() throws Exception {

  Job testJob = serviceRegistryJpaImpl.createJob(TEST_HOST, TEST_SERVICE, TEST_OPERATION, null, null, true, null);
  JobBarrier barrier = new JobBarrier(null, serviceRegistryJpaImpl, testJob);
  launchDispatcherOnce(false);
  try {
    barrier.waitForJobs(JOB_BARRIER_TIMEOUT);
    Assert.fail("Did not receive a timeout exception");
  } catch (Exception e) {
    Assert.assertEquals(1, serviceRegistryJpaImpl.dispatchPriorityList.size());
  }
}