use of org.opennms.netmgt.provision.persist.foreignsource.ForeignSource in project opennms by OpenNMS.
the class CachingForeignSourceRepositoryTest method createForeignSource.
private ForeignSource createForeignSource(String foreignSource) throws Exception {
ForeignSource fs = new ForeignSource(foreignSource);
fs.addDetector(new PluginConfig("HTTP", "org.opennms.netmgt.provision.detector.simple.HttpDetector"));
fs.addPolicy(new PluginConfig("all-ipinterfaces", "org.opennms.netmgt.provision.persist.policies.InclusiveInterfacePolicy"));
m_foreignSourceRepository.save(fs);
m_foreignSourceRepository.flush();
return fs;
}
use of org.opennms.netmgt.provision.persist.foreignsource.ForeignSource in project opennms by OpenNMS.
the class FilesystemForeignSourceRepositoryTest method testGetRequisition.
@Test
public void testGetRequisition() throws Exception {
Requisition requisition = createRequisition();
ForeignSource foreignSource = createForeignSource(m_defaultForeignSourceName);
assertRequisitionsMatch("requisitions must match", m_foreignSourceRepository.getRequisition(m_defaultForeignSourceName), m_foreignSourceRepository.getRequisition(foreignSource));
assertRequisitionsMatch("foreign source is the expected one", requisition, m_foreignSourceRepository.getRequisition(foreignSource));
}
use of org.opennms.netmgt.provision.persist.foreignsource.ForeignSource in project opennms by OpenNMS.
the class FusedForeignSourceRepositoryTest method tearDown.
@After
public final void tearDown() {
/*
* since we share the filesystem with other tests, best
* to make sure it's totally clean here.
*/
for (ForeignSource fs : m_pending.getForeignSources()) {
m_pending.delete(fs);
}
for (ForeignSource fs : m_active.getForeignSources()) {
m_active.delete(fs);
}
for (Requisition r : m_pending.getRequisitions()) {
m_pending.delete(r);
}
for (Requisition r : m_active.getRequisitions()) {
m_active.delete(r);
}
m_pending.flush();
m_active.flush();
}
use of org.opennms.netmgt.provision.persist.foreignsource.ForeignSource in project opennms by OpenNMS.
the class MockForeignSourceRepository method getForeignSource.
@Override
public ForeignSource getForeignSource(final String foreignSourceName) {
Assert.notNull(foreignSourceName);
final ForeignSource foreignSource = m_foreignSources.get(foreignSourceName);
if (foreignSource == null) {
if (foreignSourceName == "default") {
return super.getDefaultForeignSource();
} else {
return getDefaultForeignSource();
}
}
return foreignSource;
}
use of org.opennms.netmgt.provision.persist.foreignsource.ForeignSource in project opennms by OpenNMS.
the class QueueingForeignSourceRepositoryTest method createForeignSource.
private ForeignSource createForeignSource(String foreignSource) throws Exception {
ForeignSource fs = new ForeignSource(foreignSource);
fs.addDetector(new PluginConfig("HTTP", "org.opennms.netmgt.provision.detector.simple.HttpDetector"));
fs.addPolicy(new PluginConfig("all-ipinterfaces", "org.opennms.netmgt.provision.persist.policies.InclusiveInterfacePolicy"));
m_foreignSourceRepository.save(fs);
m_foreignSourceRepository.flush();
return fs;
}
Aggregations