DocumentLogger { public void addDataToList(String cle, Long x, Float y) { if (null != getPlotList(cle)) { getPlotList(cle).addValue(x, y); getPlotList(cle).addNewlineinfile(x, y); } double yval = (double) y; if ((null != mapPerfGraph) && (null != mapPerfGraph.get(cle))) { mapPerfGraph.get(cle).addDatasetValue(x, yval); } } DocumentLogger(String folderWhereResultsAreSaved); void addPlotlistObject(); void readconffile(String path); void addDataToList(String cle, Long x, Float y); long getMinValueFromList(String cle); long getMaxValueFromList(String cle); double getAveValueFromList(String cle); PlotList getPlotList(String cle); void addInfoToLog(String s, int line, String currentScript); void addWarningToLog(String s, int line, String currentScript); void addErrorToLog(String s, int line, String currentScript); List<Message> getMsgsLogged(); String getPNGpath(String cle); String getpltpath(String cle); void setMapcolor(); Map<String, PlotList> getMapint(); boolean load(String filename); void setMapint(Map<String, PlotList> mapint); Map<String, PerformanceGraph> getMapPerfGraph(); void setMapPerfGraph(Map<String, PerformanceGraph> mapPerfGraph);  }
@Test public void testAddDataToList() { dl.addDataToList("Battery", 1L, 10F); dl.addDataToList("Cpu", 1L, -10F); dl.addDataToList("Cpu", 2L, 10F); dl.addDataToList("Memory", 1L, 10000F); dl.addDataToList("Memory", 3L, -30F); dl.addDataToList("Memory", 8L, -10F); dl.addDataToList("Storage", 100L, 10F); dl.addDataToList("Storage", 10000L, 10F); dl.addDataToList("Storage", 10001L, 10F); dl.addDataToList("Storage", 11000L, 30F); assertEquals(10L, dl.getMinValueFromList("Battery")); assertEquals(-10L, dl.getMinValueFromList("Cpu")); assertEquals(-30L, dl.getMinValueFromList("Memory")); assertEquals(10L, dl.getMinValueFromList("Storage")); assertEquals(10L, dl.getMaxValueFromList("Battery")); assertEquals(10L, dl.getMaxValueFromList("Cpu")); assertEquals(10000L, dl.getMaxValueFromList("Memory")); assertEquals(30L, dl.getMaxValueFromList("Storage")); assertEquals(10L, dl.getAveValueFromList("Battery"), 0.1); assertEquals(0, dl.getAveValueFromList("Cpu"), 0.1); assertEquals(3320L, dl.getAveValueFromList("Memory"), 0.1); assertEquals(15L, dl.getAveValueFromList("Storage"), 0.1); assertEquals(1, dl.getPlotList("Battery").getSize()); assertEquals(2, dl.getPlotList("Cpu").getSize()); assertEquals(3, dl.getPlotList("Memory").getSize()); assertEquals(4, dl.getPlotList("Storage").getSize()); }