Search in sources :

Example 1 with DefaultDemandPollService

use of org.opennms.web.svclayer.support.DefaultDemandPollService in project opennms by OpenNMS.

the class DemandPollServiceTest method setUp.

@Override
protected void setUp() throws Exception {
    m_demandPollDao = createMock(DemandPollDao.class);
    m_monitoredServiceDao = createMock(MonitoredServiceDao.class);
    m_pollerService = createMock(PollerService.class);
    m_pollStore = new SingleDemandPollStore();
    m_demandPollService = new DefaultDemandPollService();
    m_demandPollService.setDemandPollDao(m_demandPollDao);
    m_demandPollService.setPollerAPI(m_pollerService);
    m_demandPollService.setMonitoredServiceDao(m_monitoredServiceDao);
}
Also used : DefaultDemandPollService(org.opennms.web.svclayer.support.DefaultDemandPollService) MonitoredServiceDao(org.opennms.netmgt.dao.api.MonitoredServiceDao) PollerService(org.opennms.web.svclayer.api.PollerService) DemandPollDao(org.opennms.netmgt.dao.api.DemandPollDao)

Example 2 with DefaultDemandPollService

use of org.opennms.web.svclayer.support.DefaultDemandPollService in project opennms by OpenNMS.

the class DefaultPollServiceIntegrationIT method testPollMonitoredService.

/**
     * this is a feature that has not been written yet
     */
@Test
@Ignore
public void testPollMonitoredService() {
    final PollerService api = createMock(PollerService.class);
    ((DefaultDemandPollService) m_demandPollService).setPollerAPI(api);
    final DemandPoll poll = m_demandPollService.pollMonitoredService(1, addr("192.168.2.100"), 1, 1);
    assertNotNull("DemandPoll should not be null", poll);
    assertTrue("Polled service addr doesn't match...", poll.getId() >= 1);
}
Also used : DemandPoll(org.opennms.netmgt.model.DemandPoll) DefaultDemandPollService(org.opennms.web.svclayer.support.DefaultDemandPollService) PollerService(org.opennms.web.svclayer.api.PollerService) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

PollerService (org.opennms.web.svclayer.api.PollerService)2 DefaultDemandPollService (org.opennms.web.svclayer.support.DefaultDemandPollService)2 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1 DemandPollDao (org.opennms.netmgt.dao.api.DemandPollDao)1 MonitoredServiceDao (org.opennms.netmgt.dao.api.MonitoredServiceDao)1 DemandPoll (org.opennms.netmgt.model.DemandPoll)1