@Test public void testAutoAcknowledge2() throws Exception { MockInterface iface = m_network.getInterface(1, "192.168.1.1"); Date downDate = new Date(); anticipateNotificationsForGroup("interface 192.168.1.1 down.", "All services are down on interface 192.168.1.1, dot1 interface alias.", "InitialGroup", downDate, 0); //bring node down now Event event = iface.createDownEvent(downDate); m_eventMgr.sendEventToListeners(event); sleep(1000); Date date = new Date(); Event upEvent = iface.createUpEvent(date); anticipateNotificationsForGroup("RESOLVED: interface 192.168.1.1 down.", "RESOLVED: All services are down on interface 192.168.1.1, dot1 interface alias.", "InitialGroup", date, 0); long endTime = anticipateNotificationsForGroup("interface 192.168.1.1 up.", "The interface which was previously down is now up.", "UpGroup", date, 0); m_eventMgr.sendEventToListeners(upEvent); verifyAnticipated(endTime, 1000, 5000); }
/** * see http://bugzilla.opennms.org/cgi-bin/bugzilla/show_bug.cgi?id=731 * @throws Exception */ @Test public void testBug731() throws Exception { MockInterface iface = m_network.getInterface(1, "192.168.1.1"); Date downDate = new Date(); anticipateNotificationsForGroup("interface 192.168.1.1 down.", "All services are down on interface 192.168.1.1, dot1 interface alias.", "InitialGroup", downDate, 0); //bring node down now Event event = iface.createDownEvent(downDate); m_eventMgr.sendEventToListeners(event); sleep(1000); Date date = new Date(); Event upEvent = iface.createUpEvent(date); anticipateNotificationsForGroup("RESOLVED: interface 192.168.1.1 down.", "RESOLVED: All services are down on interface 192.168.1.1, dot1 interface alias.", "InitialGroup", date, 0); long endTime = anticipateNotificationsForGroup("interface 192.168.1.1 up.", "The interface which was previously down is now up.", "UpGroup", date, 0); m_eventMgr.sendEventToListeners(upEvent); verifyAnticipated(endTime, 1000, 5000); }