use of org.opennms.netmgt.provision.persist.MockForeignSourceRepository in project opennms by OpenNMS.
the class IfIndexNullIT method setUp.
@Before
public void setUp() {
MockLogAppender.setupLogging();
final MockForeignSourceRepository mfsr = new MockForeignSourceRepository();
final ForeignSource fs = new ForeignSource();
fs.setName("default");
fs.addDetector(new PluginConfig("SNMP", "org.opennms.netmgt.provision.detector.snmp.SnmpDetector"));
mfsr.putDefaultForeignSource(fs);
m_provisioner.getProvisionService().setForeignSourceRepository(mfsr);
}
use of org.opennms.netmgt.provision.persist.MockForeignSourceRepository in project opennms by OpenNMS.
the class MultipleImportIT method setUp.
@Before
public void setUp() {
MockLogAppender.setupLogging();
final MockForeignSourceRepository mfsr = new MockForeignSourceRepository();
final ForeignSource fs = new ForeignSource();
fs.setName("default");
fs.addDetector(new PluginConfig("ICMP", "org.opennms.netmgt.provision.service.MockServiceDetector"));
mfsr.putDefaultForeignSource(fs);
m_provisioner.getProvisionService().setForeignSourceRepository(mfsr);
}
use of org.opennms.netmgt.provision.persist.MockForeignSourceRepository in project opennms by OpenNMS.
the class NewSuspectScanIT method setUp.
@Before
public void setUp() throws Exception {
m_eventSubscriber.getEventAnticipator().reset();
if (m_distPollerDao.findAll().size() == 0) {
OnmsDistPoller distPoller = new OnmsDistPoller(DistPollerDao.DEFAULT_DIST_POLLER_ID);
distPoller.setLabel("localhost");
distPoller.setLocation(MonitoringLocationDao.DEFAULT_MONITORING_LOCATION_ID);
distPoller.setType(OnmsMonitoringSystem.TYPE_OPENNMS);
m_distPollerDao.save(distPoller);
}
m_foreignSource = new ForeignSource();
m_foreignSource.setName("imported:");
m_foreignSource.setScanInterval(Duration.standardDays(1));
final PluginConfig detector = new PluginConfig("SNMP", "org.opennms.netmgt.provision.detector.snmp.SnmpDetector");
detector.addParameter("timeout", "1000");
detector.addParameter("retries", "0");
m_foreignSource.addDetector(detector);
m_foreignSourceRepository = new MockForeignSourceRepository();
m_foreignSourceRepository.putDefaultForeignSource(m_foreignSource);
m_provisionService.setForeignSourceRepository(m_foreignSourceRepository);
m_provisioner.start();
}
use of org.opennms.netmgt.provision.persist.MockForeignSourceRepository in project opennms by OpenNMS.
the class HandlerTest method dwOpenConnectionURL.
@Test
@Ignore
public void dwOpenConnectionURL() throws IOException {
URL url = new URL(DNS_URL);
UrlResource resource = new UrlResource(url);
MockForeignSourceRepository fsr = new MockForeignSourceRepository();
Requisition r = fsr.importResourceRequisition(resource);
Assert.assertTrue("Number of nodes in Model Import > 1", 1 == r.getNodeCount());
Assert.assertTrue("NodeLabel isn't localhost", "localhost".equals(r.getNodes().get(0).getNodeLabel()));
Assert.assertTrue("127.0.0.1".equals(r.getNodes().get(0).getInterfaces().get(0).getIpAddr()));
}
use of org.opennms.netmgt.provision.persist.MockForeignSourceRepository 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();
}
Aggregations