use of org.opennms.netmgt.provision.persist.OnmsIpInterfaceRequisition in project opennms by OpenNMS.
the class ProvisionerIT method testDnsVisit.
/**
* We have to ignore this test until there is a DNS service available in the test harness
*
* @throws ForeignSourceRepositoryException
* @throws MalformedURLException
*/
@Test(timeout = 300000)
@JUnitDNSServer(port = 9153, zones = { @DNSZone(name = "opennms.com.", v4address = "1.2.3.4", entries = { @DNSEntry(hostname = "www", address = "1.2.3.4") }) })
public void testDnsVisit() throws ForeignSourceRepositoryException, MalformedURLException {
final Requisition requisition = m_foreignSourceRepository.importResourceRequisition(new UrlResource("dns://localhost:9153/opennms.com"));
final CountingVisitor visitor = new CountingVisitor() {
@Override
public void visitNode(final OnmsNodeRequisition req) {
LOG.debug("visitNode: {}/{} {}", req.getForeignSource(), req.getForeignId(), req.getNodeLabel());
m_nodes.add(req);
m_nodeCount++;
}
@Override
public void visitInterface(final OnmsIpInterfaceRequisition req) {
LOG.debug("visitInterface: {}", req.getIpAddr());
m_ifaces.add(req);
m_ifaceCount++;
}
};
requisition.visit(visitor);
verifyDnsImportCounts(visitor);
}
Aggregations