Search in sources :

Example 1 with IcmpDetector

use of org.opennms.netmgt.provision.detector.icmp.IcmpDetector in project opennms by OpenNMS.

the class ProvisionerRescanExistingFalseIT method setUp.

@Before
public void setUp() throws Exception {
    MockLogAppender.setupLogging(true, "ERROR");
    SnmpPeerFactory.setInstance(m_snmpPeerFactory);
    assertTrue(m_snmpPeerFactory instanceof ProxySnmpAgentConfigFactory);
    m_eventAnticipator = m_mockEventIpcManager.getEventAnticipator();
    //((TransactionAwareEventForwarder)m_provisioner.getEventForwarder()).setEventForwarder(m_mockEventIpcManager);
    m_provisioner.start();
    m_foreignSource = new ForeignSource();
    m_foreignSource.setName("noRescanOnImport");
    m_foreignSource.setScanInterval(Duration.standardDays(1));
    final PluginConfig icmpDetector = new PluginConfig("ICMP", IcmpDetector.class.getName());
    icmpDetector.addParameter("timeout", "500");
    icmpDetector.addParameter("retries", "0");
    m_foreignSource.addDetector(icmpDetector);
    final PluginConfig snmpDetector = new PluginConfig("SNMP", SnmpDetector.class.getName());
    snmpDetector.addParameter("timeout", "500");
    snmpDetector.addParameter("retries", "0");
    m_foreignSource.addDetector(snmpDetector);
    m_foreignSourceRepository = new MockForeignSourceRepository();
    m_foreignSourceRepository.save(m_foreignSource);
    m_foreignSourceRepository.flush();
    m_provisionService.setForeignSourceRepository(m_foreignSourceRepository);
    m_scheduledExecutor.pause();
}
Also used : PluginConfig(org.opennms.netmgt.provision.persist.foreignsource.PluginConfig) ForeignSource(org.opennms.netmgt.provision.persist.foreignsource.ForeignSource) IcmpDetector(org.opennms.netmgt.provision.detector.icmp.IcmpDetector) SnmpDetector(org.opennms.netmgt.provision.detector.snmp.SnmpDetector) ProxySnmpAgentConfigFactory(org.opennms.core.test.snmp.ProxySnmpAgentConfigFactory) MockForeignSourceRepository(org.opennms.netmgt.provision.persist.MockForeignSourceRepository) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 ProxySnmpAgentConfigFactory (org.opennms.core.test.snmp.ProxySnmpAgentConfigFactory)1 IcmpDetector (org.opennms.netmgt.provision.detector.icmp.IcmpDetector)1 SnmpDetector (org.opennms.netmgt.provision.detector.snmp.SnmpDetector)1 MockForeignSourceRepository (org.opennms.netmgt.provision.persist.MockForeignSourceRepository)1 ForeignSource (org.opennms.netmgt.provision.persist.foreignsource.ForeignSource)1 PluginConfig (org.opennms.netmgt.provision.persist.foreignsource.PluginConfig)1