use of org.opennms.netmgt.threshd.ThresholdEvaluatorState.Status in project opennms by OpenNMS.
the class ThresholdEvaluatorHighLowTest method testEvaluateHighNoTriggerTwice.
@Test
public void testEvaluateHighNoTriggerTwice() {
Threshold threshold = new Threshold();
threshold.setType(ThresholdType.HIGH);
threshold.setDsName("ds-name");
threshold.setDsType("node");
threshold.setValue(99.0);
threshold.setRearm(0.5);
threshold.setTrigger(2);
ThresholdConfigWrapper wrapper = new ThresholdConfigWrapper(threshold);
ThresholdEvaluatorState item = new ThresholdEvaluatorStateHighLow(wrapper);
Status status = item.evaluate(100.0);
assertEquals("threshold evaluation status", Status.NO_CHANGE, status);
}
use of org.opennms.netmgt.threshd.ThresholdEvaluatorState.Status in project opennms by OpenNMS.
the class ThresholdEvaluatorHighLowTest method testEvaluateHighTriggerRearm.
@Test
public void testEvaluateHighTriggerRearm() {
Threshold threshold = new Threshold();
threshold.setType(ThresholdType.HIGH);
threshold.setDsName("ds-name");
threshold.setDsType("node");
threshold.setValue(99.0);
threshold.setRearm(0.5);
threshold.setTrigger(1);
ThresholdConfigWrapper wrapper = new ThresholdConfigWrapper(threshold);
ThresholdEvaluatorState item = new ThresholdEvaluatorStateHighLow(wrapper);
Status status = item.evaluate(100.0);
assertEquals("first threshold evaluation status", Status.TRIGGERED, status);
status = item.evaluate(0.0);
assertEquals("second threshold evaluation status", Status.RE_ARMED, status);
}
Aggregations