Search in sources :

Example 1 with PassiveServiceMonitor

use of org.opennms.netmgt.poller.monitors.PassiveServiceMonitor in project opennms by OpenNMS.

the class PassiveStatusKeeperIT method testDownPassiveStatus.

@Test
public void testDownPassiveStatus() throws InterruptedException, UnknownHostException {
    Event e = createPassiveStatusEvent("Router", "192.168.1.1", "ICMP", "Down");
    m_eventMgr.sendNow(e);
    PollStatus ps = m_psk.getStatus("Router", "192.168.1.1", "ICMP");
    assertTrue(ps.isDown());
    MockMonitoredService svc = new MockMonitoredService(1, "Router", InetAddressUtils.addr("192.168.1.1"), "ICMP");
    ServiceMonitor m = new PassiveServiceMonitor();
    PollStatus ps2 = m.poll(svc, null);
    assertEquals(ps, ps2);
}
Also used : PollStatus(org.opennms.netmgt.poller.PollStatus) ServiceMonitor(org.opennms.netmgt.poller.ServiceMonitor) PassiveServiceMonitor(org.opennms.netmgt.poller.monitors.PassiveServiceMonitor) MockMonitoredService(org.opennms.netmgt.poller.mock.MockMonitoredService) Event(org.opennms.netmgt.xml.event.Event) PassiveServiceMonitor(org.opennms.netmgt.poller.monitors.PassiveServiceMonitor) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 PollStatus (org.opennms.netmgt.poller.PollStatus)1 ServiceMonitor (org.opennms.netmgt.poller.ServiceMonitor)1 MockMonitoredService (org.opennms.netmgt.poller.mock.MockMonitoredService)1 PassiveServiceMonitor (org.opennms.netmgt.poller.monitors.PassiveServiceMonitor)1 Event (org.opennms.netmgt.xml.event.Event)1