@Test public void testAddThresholdPerformanceData() throws Exception { assertEquals(AbstractPerformanceDataBuilder.addPerformanceDataRow4Threshold("", "suite", 0, 0), ""); assertEquals(AbstractPerformanceDataBuilder.addPerformanceDataRow4Threshold("", "suite", 0, -1), ""); assertEquals(AbstractPerformanceDataBuilder.addPerformanceDataRow4Threshold("", "suite", -1, -1), ""); assertEquals(AbstractPerformanceDataBuilder.addPerformanceDataRow4Threshold("", "suite", 10, -1), "suite__warning=10s;;;;"); assertEquals(AbstractPerformanceDataBuilder.addPerformanceDataRow4Threshold("", "suite", 10, 20), "suite__warning=10s;;;; suite__critical=20s;;;;"); assertEquals(AbstractPerformanceDataBuilder.addPerformanceDataRow4Threshold("", "suite", 0, 20), "suite__critical=20s;;;;"); }
static String addPerformanceDataRow4Threshold(String performanceData, String name, int warningTime, int criticalTime) { if (warningTime > 0) { performanceData = addPerformanceDataRow(performanceData, name + "__warning", TimeFormatter.formatToSec(warningTime), null, null); } if (criticalTime > 0) { performanceData = addPerformanceDataRow(performanceData, name + "__critical", TimeFormatter.formatToSec(criticalTime), null, null); } return performanceData; }
AbstractPerformanceDataBuilder { static String addPerformanceDataRow4Threshold(String performanceData, String name, int warningTime, int criticalTime) { if (warningTime > 0) { performanceData = addPerformanceDataRow(performanceData, name + "__warning", TimeFormatter.formatToSec(warningTime), null, null); } if (criticalTime > 0) { performanceData = addPerformanceDataRow(performanceData, name + "__critical", TimeFormatter.formatToSec(criticalTime), null, null); } return performanceData; } }
AbstractPerformanceDataBuilder { static String addPerformanceDataRow4Threshold(String performanceData, String name, int warningTime, int criticalTime) { if (warningTime > 0) { performanceData = addPerformanceDataRow(performanceData, name + "__warning", TimeFormatter.formatToSec(warningTime), null, null); } if (criticalTime > 0) { performanceData = addPerformanceDataRow(performanceData, name + "__critical", TimeFormatter.formatToSec(criticalTime), null, null); } return performanceData; }  }
AbstractPerformanceDataBuilder { static String addPerformanceDataRow4Threshold(String performanceData, String name, int warningTime, int criticalTime) { if (warningTime > 0) { performanceData = addPerformanceDataRow(performanceData, name + "__warning", TimeFormatter.formatToSec(warningTime), null, null); } if (criticalTime > 0) { performanceData = addPerformanceDataRow(performanceData, name + "__critical", TimeFormatter.formatToSec(criticalTime), null, null); } return performanceData; }   }
AbstractPerformanceDataBuilder { static String addPerformanceDataRow4Threshold(String performanceData, String name, int warningTime, int criticalTime) { if (warningTime > 0) { performanceData = addPerformanceDataRow(performanceData, name + "__warning", TimeFormatter.formatToSec(warningTime), null, null); } if (criticalTime > 0) { performanceData = addPerformanceDataRow(performanceData, name + "__critical", TimeFormatter.formatToSec(criticalTime), null, null); } return performanceData; }    }