Search in sources :

Example 1 with DroolsNorthbounder

use of org.opennms.netmgt.alarmd.northbounder.drools.DroolsNorthbounder in project opennms by OpenNMS.

the class VacuumdIT method setUp.

/**
 * Sets up the test.
 *
 * @throws Exception the exception
 */
@Before
public void setUp() throws Exception {
    MockLogAppender.setupLogging();
    m_ancitipator = ((MockEventIpcManager) m_eventProxy).getEventAnticipator();
    m_location = new OnmsMonitoringLocation("Default", "Default");
    m_distPoller = new OnmsDistPoller("00000000-0000-0000-0000-000000000000");
    m_distPoller.setLabel("localhost");
    m_distPoller.setLocation("Default");
    m_distPoller.setType(OnmsMonitoringSystem.TYPE_OPENNMS);
    OnmsNode node = createNode();
    m_down = new NorthboundAlarm(createDownAlarm(node, new Date()));
    System.err.println(JaxbUtils.marshal(m_down));
    m_up = new NorthboundAlarm(createUpAlarm(node, new Date(m_down.getLastOccurrence().getTime() + DELAY)));
    System.err.println(JaxbUtils.marshal(m_up));
    // Setup the Drools northbounder configuration DAO
    DroolsNorthbounderConfigDao configDao = new DroolsNorthbounderConfigDao();
    configDao.setConfigResource(new FileSystemResource(new File("src/test/resources/etc/vacuumd/drools-northbounder-configuration.xml")));
    configDao.afterPropertiesSet();
    Assert.assertNotNull(configDao.getConfig().getEngine("Vacuumd"));
    // Setup the northbounder
    nbi = new DroolsNorthbounder(m_appContext, configDao, m_eventProxy, "Vacuumd");
    nbi.afterPropertiesSet();
}
Also used : OnmsNode(org.opennms.netmgt.model.OnmsNode) DroolsNorthbounderConfigDao(org.opennms.netmgt.alarmd.northbounder.drools.DroolsNorthbounderConfigDao) DroolsNorthbounder(org.opennms.netmgt.alarmd.northbounder.drools.DroolsNorthbounder) NorthboundAlarm(org.opennms.netmgt.alarmd.api.NorthboundAlarm) OnmsDistPoller(org.opennms.netmgt.model.OnmsDistPoller) FileSystemResource(org.springframework.core.io.FileSystemResource) File(java.io.File) Date(java.util.Date) OnmsMonitoringLocation(org.opennms.netmgt.model.monitoringLocations.OnmsMonitoringLocation) Before(org.junit.Before)

Aggregations

File (java.io.File)1 Date (java.util.Date)1 Before (org.junit.Before)1 NorthboundAlarm (org.opennms.netmgt.alarmd.api.NorthboundAlarm)1 DroolsNorthbounder (org.opennms.netmgt.alarmd.northbounder.drools.DroolsNorthbounder)1 DroolsNorthbounderConfigDao (org.opennms.netmgt.alarmd.northbounder.drools.DroolsNorthbounderConfigDao)1 OnmsDistPoller (org.opennms.netmgt.model.OnmsDistPoller)1 OnmsNode (org.opennms.netmgt.model.OnmsNode)1 OnmsMonitoringLocation (org.opennms.netmgt.model.monitoringLocations.OnmsMonitoringLocation)1 FileSystemResource (org.springframework.core.io.FileSystemResource)1