JobManager jobMgr = (JobManager) TestHelper.getApplicationContext().getBean("jobManager"); jobMgr.finishProcessingJobs();
JobQueue jobMgr = (JobQueue) TestHelper.getApplicationContext().getBean("jobQueue"); jobMgr.yieldTillEmpty();
    public void testRunJob() throws Exception {        TestHelper.cleanInsert("ClearDb.xml");        MockControl phoneControl = MockClassControl.createStrictControl(Phone.class);        Phone phone = (Phone) phoneControl.getMock();        phoneControl.expectAndReturn(phone.getSerialNumber(), "000000000000");        phone.restart();        phoneControl.setVoidCallable(1);        phoneControl.replay();                List phones = new ArrayList();        phones.add(phone);                m_phoneContext.restart(phones);        JobManager jobMgr = (JobManager) TestHelper.getApplicationContext().getBean("jobManager");        jobMgr.finishProcessingJobs();                phoneControl.verify();    }