use of org.opennms.netmgt.config.VacuumdConfigFactory in project opennms by OpenNMS.
the class VacuumdIT method setUp.
@Before
public void setUp() throws Exception {
m_network.createStandardNetwork();
InputStream is = ConfigurationTestUtils.getInputStreamForResource(this, "/org/opennms/netmgt/vacuumd/vacuumd-configuration.xml");
try {
VacuumdConfigFactory.setInstance(new VacuumdConfigFactory(is));
} finally {
IOUtils.closeQuietly(is);
}
m_eventdIpcMgr.setEventWriter(m_database);
EventExpander expander = new EventExpander(new MetricRegistry());
expander.setEventConfDao(new EmptyEventConfDao());
m_eventdIpcMgr.setEventExpander(expander);
Vacuumd.destroySingleton();
m_vacuumd = Vacuumd.getSingleton();
m_vacuumd.setEventManager(m_eventdIpcMgr);
m_vacuumd.init();
// Insert some empty nodes to avoid foreign-key violations on subsequent events/alarms
OnmsNode node = new OnmsNode(m_locationDao.getDefaultLocation(), "default-1");
node.setId(1);
m_nodeDao.save(node);
node = new OnmsNode(m_locationDao.getDefaultLocation(), "default-2");
node.setId(2);
m_nodeDao.save(node);
m_nodeDao.flush();
MockUtil.println("------------ Finished setup for: " + this.getClass().getName() + " --------------------------");
}
Aggregations