### Question:
LocationMonitorDaoHibernate extends AbstractDaoHibernate<OnmsLocationMonitor, Integer> implements
        LocationMonitorDao { public void setMonitoringLocationConfigResource(final Resource monitoringLocationResource) { m_monitoringLocationConfigResource = monitoringLocationResource; initializeMonitoringLocationDefinition(); } LocationMonitorDaoHibernate(); List<OnmsMonitoringLocationDefinition> findAllMonitoringLocationDefinitions(); void saveMonitoringLocationDefinitions(final Collection<OnmsMonitoringLocationDefinition> onmsDefs); void saveMonitoringLocationDefinition(final OnmsMonitoringLocationDefinition onmsDef); Collection<OnmsMonitoringLocationDefinition> findAllLocationDefinitions(); Resource getMonitoringLocationConfigResource(); void setMonitoringLocationConfigResource(final Resource monitoringLocationResource); OnmsMonitoringLocationDefinition findMonitoringLocationDefinition(final String monitoringLocationDefinitionName); OnmsLocationSpecificStatus getMostRecentStatusChange(final OnmsLocationMonitor locationMonitor, final OnmsMonitoredService monSvc); void saveStatusChange(final OnmsLocationSpecificStatus statusChange); Collection<OnmsLocationMonitor> findByApplication(final OnmsApplication application); Collection<OnmsLocationMonitor> findByLocationDefinition(final OnmsMonitoringLocationDefinition locationDefinition); Collection<OnmsLocationSpecificStatus> getAllMostRecentStatusChanges(); Collection<OnmsLocationSpecificStatus> getAllStatusChangesAt(final Date timestamp); Collection<OnmsLocationSpecificStatus> getStatusChangesBetween(final Date startDate, final Date endDate); Collection<OnmsLocationSpecificStatus> getStatusChangesForLocationBetween(final Date startDate, final Date endDate, final String locationName); Collection<OnmsLocationSpecificStatus> getStatusChangesForApplicationBetween(final Date startDate, final Date endDate, final String applicationName); Collection<OnmsLocationSpecificStatus> getStatusChangesBetweenForApplications(final Date startDate, final Date endDate, final Collection<String> applicationNames); Collection<OnmsLocationSpecificStatus> getMostRecentStatusChangesForLocation(final String locationName); Collection<LocationMonitorIpInterface> findStatusChangesForNodeForUniqueMonitorAndInterface(final int nodeId); void pauseAll(); void resumeAll();  }### Answer:
@Test @Transactional public void testSetConfigResourceProduction() throws FileNotFoundException { ((LocationMonitorDaoHibernate)m_locationMonitorDao).setMonitoringLocationConfigResource(new InputStreamResource(ConfigurationTestUtils.getInputStreamForConfigFile("monitoring-locations.xml"))); }
@Test @Transactional public void testSetConfigResourceExample() throws FileNotFoundException { ((LocationMonitorDaoHibernate)m_locationMonitorDao).setMonitoringLocationConfigResource(new InputStreamResource(ConfigurationTestUtils.getInputStreamForConfigFile("examples/monitoring-locations.xml"))); }
@Test @Transactional public void testSetConfigResourceNoLocations() throws FileNotFoundException { ((LocationMonitorDaoHibernate)m_locationMonitorDao).setMonitoringLocationConfigResource(new FileSystemResource("src/test/resources/monitoring-locations-no-locations.xml")); }
@Test @Transactional public void testBogusConfig() { ThrowableAnticipator ta = new ThrowableAnticipator(); ta.anticipate(new MarshallingResourceFailureException(ThrowableAnticipator.IGNORE_MESSAGE)); try { ((LocationMonitorDaoHibernate)m_locationMonitorDao).setMonitoringLocationConfigResource(new FileSystemResource("some bogus filename")); } catch (Throwable t) { ta.throwableReceived(t); } ta.verifyAnticipated(); }