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();
}
Aggregations