use of org.opennms.netmgt.provision.persist.ForeignSourceRepository in project opennms by OpenNMS.
the class RequisitionImplementationTest method runTest.
protected <T> void runTest(final RepositoryTest<ForeignSourceRepository> rt, final Class<? extends Throwable> expected) {
m_repositories.entrySet().stream().forEach(entry -> {
final String bundleName = entry.getKey();
final ForeignSourceRepository fsr = entry.getValue();
LOG.info("=== " + bundleName + " ===");
fsr.resetDefaultForeignSource();
fsr.flush();
try {
rt.test(fsr);
} catch (final Throwable t) {
if (expected == null) {
throw t;
} else {
LOG.debug("expected: {}, got: {}", expected, t);
if (t.getClass().getCanonicalName().equals(expected.getCanonicalName())) {
} else {
throw new RuntimeException("Expected throwable " + expected.getName() + " when running test against " + bundleName + ", but got " + t.getClass() + " instead!", t);
}
}
}
});
}
use of org.opennms.netmgt.provision.persist.ForeignSourceRepository in project opennms by OpenNMS.
the class RequisitionImplementationTest method cleanUp.
@Before
@After
public void cleanUp() throws Exception {
if (m_repositories != null) {
resetDirectories();
for (final ForeignSourceRepository fsr : m_repositories.values()) {
fsr.flush();
fsr.clear();
}
}
LOG.info("Test context prepared.");
}
Aggregations