SecurityGroupManagerImpl2 extends SecurityGroupManagerImpl { @Override public void work() { s_logger.trace("Checking the work queue"); List<SecurityGroupWork> workItems; try { workItems = _workQueue.getWork(1); for (SecurityGroupWork work : workItems) { if (s_logger.isTraceEnabled()) { s_logger.trace("Processing " + work.getInstanceId()); } try { VmRulesetLogVO rulesetLog = _rulesetLogDao.findByVmId(work.getInstanceId()); if (rulesetLog == null) { s_logger.warn("Could not find ruleset log for vm " + work.getInstanceId()); continue; } work.setLogsequenceNumber(rulesetLog.getLogsequence()); sendRulesetUpdates(work); _mBean.logUpdateDetails(work.getInstanceId(), work.getLogsequenceNumber()); } catch (Exception e) { s_logger.error("Problem during SG work " + work, e); work.setStep(Step.Error); } } } catch (InterruptedException e1) { s_logger.warn("SG work: caught InterruptException", e1); } }  @Override //@DB void scheduleRulesetUpdateToHosts(List<Long> affectedVms, boolean updateSeqno, Long delayMs); @Override boolean start(); @Override void work(); void sendRulesetUpdates(SecurityGroupWork work); @Override void cleanupFinishedWork(); int getQueueSize(); SecurityGroupWorkQueue getWorkQueue(); @Override boolean configure(String name, Map<String, Object> params); void disableSchedulerForVm(Long vmId, boolean disable); Long[] getDisabledVmsForScheduler(); void enableAllVmsForScheduler(); void disableScheduler(boolean disable); boolean isSchedulerDisabled(); void clearWorkQueue();  }
@Test public void testWork() throws ConfigurationException { _schedule(1000); _sgMgr.work(); }