List of usage examples for org.apache.commons.collections MapUtils getDoubleValue
public static double getDoubleValue(final Map map, final Object key, double defaultValue)
From source file:net.grinder.SingleConsole.java
@Override public long getCurrentExecutionCount() { Map<?, ?> totalStatistics = (Map<?, ?>) getStatisticsData().get("totalStatistics"); Double testCount = MapUtils.getDoubleValue(totalStatistics, "Tests", 0D); Double errorCount = MapUtils.getDoubleValue(totalStatistics, "Errors", 0D); return testCount.longValue() + errorCount.longValue(); }
From source file:net.grinder.SingleConsole.java
/** * Check if the current test contains too many errors. * * @return true if error is over 20%/*from w ww.j a va2 s.c o m*/ */ public boolean hasTooManyError() { long currentTestsCount = getCurrentExecutionCount(); double errors = MapUtils.getDoubleValue((Map<?, ?>) getStatisticsData().get("totalStatistics"), "Errors", 0D); return currentTestsCount != 0 && (errors / currentTestsCount) > 0.2; }