@Test public void testBug3488() throws Exception { String ipAddress = "127.0.0.1"; setupSnmpInterfaceDatabase(ipAddress, null); LatencyThresholdingSet thresholdingSet = new LatencyThresholdingSet(1, ipAddress, "HTTP", getRepository()); assertTrue(thresholdingSet.hasThresholds()); Map<String, Double> attributes = new HashMap<String, Double>(); attributes.put("http", 200.0); assertTrue(thresholdingSet.hasThresholds(attributes)); m_defaultErrorLevelToCheck = Level.ERROR; List<Event> triggerEvents = new ArrayList<Event>(); for (int i=0; i<5; i++) triggerEvents.addAll(thresholdingSet.applyThresholds("http", attributes)); LoggingEvent[] events = MockLogAppender.getEventsGreaterOrEqual(Level.WARN); assertEquals("expecting 5 events", 5, events.length); for (LoggingEvent e : events) assertEquals("Interface (nodeId/ipAddr=1/127.0.0.1) has no ifName and no ifDescr...setting to label to 'no_ifLabel'.", e.getMessage()); assertTrue(triggerEvents.size() == 1); addEvent(EventConstants.HIGH_THRESHOLD_EVENT_UEI, "127.0.0.1", "HTTP", 5, 100.0, 50.0, 200.0, "no_ifLabel", "127.0.0.1[http]", "http", "no_ifLabel", null, m_anticipator, m_anticipatedEvents); ThresholdingEventProxy proxy = new ThresholdingEventProxy(); proxy.add(triggerEvents); proxy.sendAllEvents(); verifyEvents(0); }
public boolean hasThresholds() { return m_thresholdingSet.hasThresholds(); }
ThresholdingVisitor extends AbstractCollectionSetVisitor { public boolean hasThresholds() { return m_thresholdingSet.hasThresholds(); } }
ThresholdingVisitor extends AbstractCollectionSetVisitor { public boolean hasThresholds() { return m_thresholdingSet.hasThresholds(); } protected  ThresholdingVisitor(CollectorThresholdingSet thresholdingSet); }
ThresholdingVisitor extends AbstractCollectionSetVisitor { public boolean hasThresholds() { return m_thresholdingSet.hasThresholds(); } protected  ThresholdingVisitor(CollectorThresholdingSet thresholdingSet); static ThresholdingVisitor create(int nodeId, String hostAddress, String serviceName, RrdRepository repo, ServiceParameters svcParams); boolean hasThresholds(); @Override void visitCollectionSet(CollectionSet set); void reload(); void reloadScheduledOutages(); boolean isNodeInOutage(); @Override void visitResource(CollectionResource resource); @Override void visitAttribute(CollectionAttribute attribute); @Override void completeResource(CollectionResource resource); Date getCollectionTimestamp(); @Override String toString(); }
ThresholdingVisitor extends AbstractCollectionSetVisitor { public boolean hasThresholds() { return m_thresholdingSet.hasThresholds(); } protected  ThresholdingVisitor(CollectorThresholdingSet thresholdingSet); static ThresholdingVisitor create(int nodeId, String hostAddress, String serviceName, RrdRepository repo, ServiceParameters svcParams); boolean hasThresholds(); @Override void visitCollectionSet(CollectionSet set); void reload(); void reloadScheduledOutages(); boolean isNodeInOutage(); @Override void visitResource(CollectionResource resource); @Override void visitAttribute(CollectionAttribute attribute); @Override void completeResource(CollectionResource resource); Date getCollectionTimestamp(); @Override String toString();  }