Search in sources :

Example 1 with AckdConfigurationDao

use of org.opennms.netmgt.dao.api.AckdConfigurationDao in project opennms by OpenNMS.

the class HypericAckProcessorIT method testStartAckd.

@Test
@JUnitHttpServer(port = 7081)
public void testStartAckd() throws Exception {
    AckdConfigurationDao realDao = createAckdConfigDao();
    AckdConfigurationDao mockDao = createMock(AckdConfigurationDao.class);
    expect(mockDao.getEnabledReaderCount()).andDelegateTo(realDao);
    expect(mockDao.isReaderEnabled("JavaMailReader")).andDelegateTo(realDao).times(2);
    expect(mockDao.isReaderEnabled("HypericReader")).andDelegateTo(realDao).times(2);
    expect(mockDao.getReaderSchedule("HypericReader")).andDelegateTo(realDao).times(2);
    replay(mockDao);
    m_daemon.setConfigDao(mockDao);
    m_daemon.start();
    try {
        Thread.sleep(5000);
    } catch (InterruptedException e) {
    }
    m_daemon.destroy();
    verify(mockDao);
}
Also used : DefaultAckdConfigurationDao(org.opennms.netmgt.dao.jaxb.DefaultAckdConfigurationDao) AckdConfigurationDao(org.opennms.netmgt.dao.api.AckdConfigurationDao) Test(org.junit.Test) JUnitHttpServer(org.opennms.core.test.http.annotations.JUnitHttpServer)

Aggregations

Test (org.junit.Test)1 JUnitHttpServer (org.opennms.core.test.http.annotations.JUnitHttpServer)1 AckdConfigurationDao (org.opennms.netmgt.dao.api.AckdConfigurationDao)1 DefaultAckdConfigurationDao (org.opennms.netmgt.dao.jaxb.DefaultAckdConfigurationDao)1