use of org.opennms.features.poller.remote.gwt.client.ApplicationDetails in project opennms by OpenNMS.
the class LocationDataServiceIT method testApplicationDetailsTwoMonitorsOutageContainedInOther.
@Test
public void testApplicationDetailsTwoMonitorsOutageContainedInOther() throws Exception {
// first, everything's up
m_pollerBackEnd.reportResult(m_rduMonitor1.getId(), m_localhostHttpService.getId(), getAvailable(m_pollingStart));
m_pollerBackEnd.reportResult(m_rduMonitor2.getId(), m_localhostHttpService.getId(), getAvailable(m_pollingStart));
m_pollerBackEnd.reportResult(m_rduMonitor1.getId(), m_googleHttpService.getId(), getAvailable(m_pollingStart));
m_pollerBackEnd.reportResult(m_rduMonitor2.getId(), m_googleHttpService.getId(), getAvailable(m_pollingStart));
// bring one down for 12 hours
m_pollerBackEnd.reportResult(m_rduMonitor1.getId(), m_googleHttpService.getId(), getDown(new Date(m_pollingStart.getTime() + (1000 * 60 * 60 * 6))));
// and back up
m_pollerBackEnd.reportResult(m_rduMonitor1.getId(), m_googleHttpService.getId(), getAvailable(new Date(m_pollingStart.getTime() + (1000 * 60 * 60 * 18))));
// bring the other down for 4 hours, overlapping
m_pollerBackEnd.reportResult(m_rduMonitor2.getId(), m_googleHttpService.getId(), getDown(new Date(m_pollingStart.getTime() + (1000 * 60 * 60 * 6))));
// and back up
m_pollerBackEnd.reportResult(m_rduMonitor2.getId(), m_googleHttpService.getId(), getAvailable(new Date(m_pollingStart.getTime() + (1000 * 60 * 60 * 10))));
ApplicationDetails ad = m_locationDataService.getApplicationDetails("TestApp1");
assertEquals("TestApp1", ad.getApplicationName());
assertEquals(Double.valueOf(20D / 24D * 100), ad.getAvailability());
assertEquals("currently available", StatusDetails.up(), ad.getStatusDetails());
}
use of org.opennms.features.poller.remote.gwt.client.ApplicationDetails in project opennms by OpenNMS.
the class LocationDataServiceIT method testApplicationDetailsFullyAvailableOneMonitor.
@Test
public void testApplicationDetailsFullyAvailableOneMonitor() throws Exception {
m_pollerBackEnd.reportResult(m_rduMonitor1.getId(), m_localhostHttpService.getId(), getAvailable(m_pollingStart));
m_pollerBackEnd.reportResult(m_rduMonitor1.getId(), m_googleHttpService.getId(), getAvailable(m_pollingStart));
ApplicationDetails ad = m_locationDataService.getApplicationDetails("TestApp1");
assertEquals("TestApp1", ad.getApplicationName());
assertEquals(Double.valueOf(100), ad.getAvailability());
assertEquals(StatusDetails.up(), ad.getStatusDetails());
}
Aggregations