@Test public void testGetFuzzyValueP() throws ComponentLookupException { Assert.assertEquals("extreme-below-normal", this.mocker.getComponentUnderTest() .getFuzzyValue(Integer.MIN_VALUE)); Assert.assertEquals("extreme-below-normal", this.mocker.getComponentUnderTest().getFuzzyValue(-1)); Assert.assertEquals("extreme-below-normal", this.mocker.getComponentUnderTest().getFuzzyValue(0)); Assert.assertEquals("extreme-below-normal", this.mocker.getComponentUnderTest().getFuzzyValue(1)); Assert.assertEquals("below-normal", this.mocker.getComponentUnderTest().getFuzzyValue(2)); Assert.assertEquals("below-normal", this.mocker.getComponentUnderTest().getFuzzyValue(3)); Assert.assertEquals("normal", this.mocker.getComponentUnderTest().getFuzzyValue(4)); Assert.assertEquals("normal", this.mocker.getComponentUnderTest().getFuzzyValue(50)); Assert.assertEquals("normal", this.mocker.getComponentUnderTest().getFuzzyValue(96)); Assert.assertEquals("above-normal", this.mocker.getComponentUnderTest().getFuzzyValue(97)); Assert.assertEquals("above-normal", this.mocker.getComponentUnderTest().getFuzzyValue(98)); Assert.assertEquals("extreme-above-normal", this.mocker.getComponentUnderTest().getFuzzyValue(99)); Assert.assertEquals("extreme-above-normal", this.mocker.getComponentUnderTest().getFuzzyValue(100)); Assert.assertEquals("extreme-above-normal", this.mocker.getComponentUnderTest().getFuzzyValue(101)); Assert.assertEquals("extreme-above-normal", this.mocker.getComponentUnderTest() .getFuzzyValue(Integer.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);  }