use of org.opennms.netmgt.config.threshd.Parameter in project opennms by OpenNMS.
the class ThresholdingVisitorIT method testBug3390.
/*
* This test uses this files from src/test/resources:
* - threshd-configuration-bug3390.xml
* - test-thresholds-bug3390.xml
*
* The idea is to define many threshold-group parameters on a service inside a package
*/
@Test
public void testBug3390() throws Exception {
initFactories("/threshd-configuration-bug3390.xml", "/test-thresholds-bug3390.xml");
// Validating threshd-configuration.xml
ThreshdConfigManager configManager = ThreshdConfigFactory.getInstance();
final List<Package> packages = configManager.getConfiguration().getPackages();
assertEquals(1, packages.size());
org.opennms.netmgt.config.threshd.Package pkg = packages.get(0);
final List<Service> services = pkg.getServices();
assertEquals(1, services.size());
org.opennms.netmgt.config.threshd.Service svc = services.get(0);
final List<Parameter> parameters = svc.getParameters();
assertEquals(5, parameters.size());
int count = 0;
for (org.opennms.netmgt.config.threshd.Parameter parameter : parameters) {
if (parameter.getKey().equals("thresholding-group"))
count++;
}
assertEquals(5, count);
// Validating Thresholding Set
ThresholdingVisitor visitor = createVisitor();
assertEquals(5, visitor.getThresholdGroups().size());
}
Aggregations