@Test public void testGetFuzzyValueSD() throws ComponentLookupException { Assert.assertEquals("extreme-below-normal", this.mocker.getComponentUnderTest() .getFuzzyValue(-Double.MAX_VALUE)); Assert.assertEquals("extreme-below-normal", this.mocker.getComponentUnderTest().getFuzzyValue(-3.1)); Assert.assertEquals("extreme-below-normal", this.mocker.getComponentUnderTest().getFuzzyValue(-3.0)); Assert.assertEquals("below-normal", this.mocker.getComponentUnderTest().getFuzzyValue(-2.99)); Assert.assertEquals("below-normal", this.mocker.getComponentUnderTest().getFuzzyValue(-2.0)); Assert.assertEquals("normal", this.mocker.getComponentUnderTest().getFuzzyValue(-1.99)); Assert.assertEquals("normal", this.mocker.getComponentUnderTest().getFuzzyValue(0.0)); Assert.assertEquals("normal", this.mocker.getComponentUnderTest().getFuzzyValue(1.99)); Assert.assertEquals("above-normal", this.mocker.getComponentUnderTest().getFuzzyValue(2.0)); Assert.assertEquals("above-normal", this.mocker.getComponentUnderTest().getFuzzyValue(2.99)); Assert.assertEquals("extreme-above-normal", this.mocker.getComponentUnderTest().getFuzzyValue(3.0)); Assert.assertEquals("extreme-above-normal", this.mocker.getComponentUnderTest().getFuzzyValue(3.1)); Assert .assertEquals("extreme-above-normal", this.mocker.getComponentUnderTest().getFuzzyValue(Double.MAX_VALUE)); }
public String getFuzzyValue(int percentile) { String returnValue = VALUE_NORMAL; if (percentile <= 1) { returnValue = VALUE_EXTREME_BELOW_NORMAL; } else if (percentile <= 3) { returnValue = VALUE_BELOW_NORMAL; } else if (percentile >= 99) { returnValue = VALUE_EXTREME_ABOVE_NORMAL; } else if (percentile >= 97) { returnValue = VALUE_ABOVE_NORMAL; } return returnValue; }
MeasurementsScriptService implements ScriptService { public String getFuzzyValue(int percentile) { String returnValue = VALUE_NORMAL; if (percentile <= 1) { returnValue = VALUE_EXTREME_BELOW_NORMAL; } else if (percentile <= 3) { returnValue = VALUE_BELOW_NORMAL; } else if (percentile >= 99) { returnValue = VALUE_EXTREME_ABOVE_NORMAL; } else if (percentile >= 97) { returnValue = VALUE_ABOVE_NORMAL; } return returnValue; } }
MeasurementsScriptService implements ScriptService { public String getFuzzyValue(int percentile) { String returnValue = VALUE_NORMAL; if (percentile <= 1) { returnValue = VALUE_EXTREME_BELOW_NORMAL; } else if (percentile <= 3) { returnValue = VALUE_BELOW_NORMAL; } else if (percentile >= 99) { returnValue = VALUE_EXTREME_ABOVE_NORMAL; } else if (percentile >= 97) { returnValue = VALUE_ABOVE_NORMAL; } return returnValue; }  }
MeasurementsScriptService implements ScriptService { public String getFuzzyValue(int percentile) { String returnValue = VALUE_NORMAL; if (percentile <= 1) { returnValue = VALUE_EXTREME_BELOW_NORMAL; } else if (percentile <= 3) { returnValue = VALUE_BELOW_NORMAL; } else if (percentile >= 99) { returnValue = VALUE_EXTREME_ABOVE_NORMAL; } else if (percentile >= 97) { returnValue = VALUE_ABOVE_NORMAL; } return returnValue; }  MeasurementHandler get(String measurementType); List<MeasurementHandler> getAvailableMeasurementHandlers(); Set<String> getAvailableMeasurementNames(); String getFuzzyValue(int percentile); String getFuzzyValue(double deviation); }
MeasurementsScriptService implements ScriptService { public String getFuzzyValue(int percentile) { String returnValue = VALUE_NORMAL; if (percentile <= 1) { returnValue = VALUE_EXTREME_BELOW_NORMAL; } else if (percentile <= 3) { returnValue = VALUE_BELOW_NORMAL; } else if (percentile >= 99) { returnValue = VALUE_EXTREME_ABOVE_NORMAL; } else if (percentile >= 97) { returnValue = VALUE_ABOVE_NORMAL; } return returnValue; }  MeasurementHandler get(String measurementType); List<MeasurementHandler> getAvailableMeasurementHandlers(); Set<String> getAvailableMeasurementNames(); String getFuzzyValue(int percentile); String getFuzzyValue(double deviation);  }