@Test public void testRunningOrPaused() { TargetInstance targetInstance = new TargetInstance(); targetInstance.setState(TargetInstance.STATE_RUNNING); assertTrue(underTest.runningOrPaused(targetInstance)); targetInstance.setState(TargetInstance.STATE_PAUSED); assertTrue(underTest.runningOrPaused(targetInstance)); targetInstance.setState(TargetInstance.STATE_SCHEDULED); assertFalse(underTest.runningOrPaused(targetInstance)); targetInstance.setState(TargetInstance.STATE_SCHEDULED); assertFalse(underTest.runningOrPaused(targetInstance)); targetInstance.setState(TargetInstance.STATE_QUEUED); assertFalse(underTest.runningOrPaused(targetInstance)); targetInstance.setState(TargetInstance.STATE_STOPPING); assertFalse(underTest.runningOrPaused(targetInstance)); targetInstance.setState(TargetInstance.STATE_ABORTED); assertFalse(underTest.runningOrPaused(targetInstance)); targetInstance.setState(TargetInstance.STATE_HARVESTED); assertFalse(underTest.runningOrPaused(targetInstance)); targetInstance.setState(TargetInstance.STATE_REJECTED); assertFalse(underTest.runningOrPaused(targetInstance)); targetInstance.setState(TargetInstance.STATE_ENDORSED); assertFalse(underTest.runningOrPaused(targetInstance)); targetInstance.setState(TargetInstance.STATE_ARCHIVED); assertFalse(underTest.runningOrPaused(targetInstance)); targetInstance.setState(TargetInstance.STATE_ARCHIVING); assertFalse(underTest.runningOrPaused(targetInstance)); }
@Override public boolean runningOrPaused(TargetInstance aTargetInstance) { String state = aTargetInstance.getState(); return state.equals(TargetInstance.STATE_RUNNING) || aTargetInstance.getState().equals(TargetInstance.STATE_PAUSED); }
HarvestAgentManagerImpl implements HarvestAgentManager { @Override public boolean runningOrPaused(TargetInstance aTargetInstance) { String state = aTargetInstance.getState(); return state.equals(TargetInstance.STATE_RUNNING) || aTargetInstance.getState().equals(TargetInstance.STATE_PAUSED); } }
HarvestAgentManagerImpl implements HarvestAgentManager { @Override public boolean runningOrPaused(TargetInstance aTargetInstance) { String state = aTargetInstance.getState(); return state.equals(TargetInstance.STATE_RUNNING) || aTargetInstance.getState().equals(TargetInstance.STATE_PAUSED); }  }
HarvestAgentManagerImpl implements HarvestAgentManager { @Override public boolean runningOrPaused(TargetInstance aTargetInstance) { String state = aTargetInstance.getState(); return state.equals(TargetInstance.STATE_RUNNING) || aTargetInstance.getState().equals(TargetInstance.STATE_PAUSED); }  @Override void heartbeat(HarvestAgentStatusDTO aStatus); @Override void updateProfileOverrides(TargetInstance aTargetInstance, String profileString); @Override void pause(TargetInstance aTargetInstance); @Override void resume(TargetInstance aTargetInstance); @Override void abort(TargetInstance aTargetInstance); @Override void stop(TargetInstance aTargetInstance); @Override void pauseAll(); @Override void resumeAll(); @Override LogReader getLogReader(TargetInstance aTargetInstance); @Override void pauseAgent(String agentName); @Override void resumeAgent(String agentName); @Override boolean runningOrPaused(TargetInstance aTargetInstance); @Override void restrictBandwidthFor(TargetInstance targetInstance); @Override List<HarvestAgentStatusDTO> getHarvestersForAgency(String agencyName); @Override void markDead(HarvestAgentStatusDTO agent); @Override void initiateHarvest(HarvestAgentStatusDTO aHarvestAgent, TargetInstance aTargetInstance, String profile,
			String seedsString); @Override void recoverHarvests(String haHost, int haPort, String haService, List<String> activeJobs); @Override boolean lock(Long tiOid); @Override void unLock(Long tiOid); @Override HashMap<String, HarvestAgentStatusDTO> getHarvestAgents(); void setTargetInstanceManager(TargetInstanceManager targetInstanceManager); void setHarvestAgentFactory(HarvestAgentFactory harvestAgentFactory); void setTargetInstanceDao(TargetInstanceDAO targetInstanceDao); @Override void purgeAbortedTargetInstances(String[] tiNames); @Override List<HarvestAgentStatusDTO> getAvailableHarvesters(String agencyName); @Override HarvestAgentStatusDTO getHarvester(String agencyName, String harvesterType); }
HarvestAgentManagerImpl implements HarvestAgentManager { @Override public boolean runningOrPaused(TargetInstance aTargetInstance) { String state = aTargetInstance.getState(); return state.equals(TargetInstance.STATE_RUNNING) || aTargetInstance.getState().equals(TargetInstance.STATE_PAUSED); }  @Override void heartbeat(HarvestAgentStatusDTO aStatus); @Override void updateProfileOverrides(TargetInstance aTargetInstance, String profileString); @Override void pause(TargetInstance aTargetInstance); @Override void resume(TargetInstance aTargetInstance); @Override void abort(TargetInstance aTargetInstance); @Override void stop(TargetInstance aTargetInstance); @Override void pauseAll(); @Override void resumeAll(); @Override LogReader getLogReader(TargetInstance aTargetInstance); @Override void pauseAgent(String agentName); @Override void resumeAgent(String agentName); @Override boolean runningOrPaused(TargetInstance aTargetInstance); @Override void restrictBandwidthFor(TargetInstance targetInstance); @Override List<HarvestAgentStatusDTO> getHarvestersForAgency(String agencyName); @Override void markDead(HarvestAgentStatusDTO agent); @Override void initiateHarvest(HarvestAgentStatusDTO aHarvestAgent, TargetInstance aTargetInstance, String profile,
			String seedsString); @Override void recoverHarvests(String haHost, int haPort, String haService, List<String> activeJobs); @Override boolean lock(Long tiOid); @Override void unLock(Long tiOid); @Override HashMap<String, HarvestAgentStatusDTO> getHarvestAgents(); void setTargetInstanceManager(TargetInstanceManager targetInstanceManager); void setHarvestAgentFactory(HarvestAgentFactory harvestAgentFactory); void setTargetInstanceDao(TargetInstanceDAO targetInstanceDao); @Override void purgeAbortedTargetInstances(String[] tiNames); @Override List<HarvestAgentStatusDTO> getAvailableHarvesters(String agencyName); @Override HarvestAgentStatusDTO getHarvester(String agencyName, String harvesterType);  }