@Test(dataProvider = "testGenerateTestCaseInformationDP") public void testGenerateTestCaseInformation(TestCase[] testCases, String expectedTestCaseInformation) throws Exception { SortedSet<TestCase> input = new TreeSet<>(); input.addAll(Arrays.asList(testCases)); assertEquals(AbstractOutputBuilder.generateCaseInformation(input), expectedTestCaseInformation); }
static String generateCaseInformation(SortedSet<TestCase> cases) { StringBuilder sb = new StringBuilder(); cases.stream().filter(c -> c.getState().isWarning() || c.getState().isCritical() || c.getState().isError()) .forEach(c -> { sb.append(", case \"").append(c.getName()).append("\" "); if (c.getState().isError()) { sb.append("EXCEPTION: ").append(c.getExceptionMessages(true)); } else { sb.append("over runtime (").append(TimeFormatter.formatToSec(c.getDuration())); if (c.getState().isCritical()) { sb.append("/crit at ").append(TimeFormatter.formatToSec(c.getCriticalTime())); } else { sb.append("/warn at ").append(TimeFormatter.formatToSec(c.getWarningTime())); } sb.append(")"); } }); return sb.toString(); }
AbstractOutputBuilder { static String generateCaseInformation(SortedSet<TestCase> cases) { StringBuilder sb = new StringBuilder(); cases.stream().filter(c -> c.getState().isWarning() || c.getState().isCritical() || c.getState().isError()) .forEach(c -> { sb.append(", case \"").append(c.getName()).append("\" "); if (c.getState().isError()) { sb.append("EXCEPTION: ").append(c.getExceptionMessages(true)); } else { sb.append("over runtime (").append(TimeFormatter.formatToSec(c.getDuration())); if (c.getState().isCritical()) { sb.append("/crit at ").append(TimeFormatter.formatToSec(c.getCriticalTime())); } else { sb.append("/warn at ").append(TimeFormatter.formatToSec(c.getWarningTime())); } sb.append(")"); } }); return sb.toString(); } }
AbstractOutputBuilder { static String generateCaseInformation(SortedSet<TestCase> cases) { StringBuilder sb = new StringBuilder(); cases.stream().filter(c -> c.getState().isWarning() || c.getState().isCritical() || c.getState().isError()) .forEach(c -> { sb.append(", case \"").append(c.getName()).append("\" "); if (c.getState().isError()) { sb.append("EXCEPTION: ").append(c.getExceptionMessages(true)); } else { sb.append("over runtime (").append(TimeFormatter.formatToSec(c.getDuration())); if (c.getState().isCritical()) { sb.append("/crit at ").append(TimeFormatter.formatToSec(c.getCriticalTime())); } else { sb.append("/warn at ").append(TimeFormatter.formatToSec(c.getWarningTime())); } sb.append(")"); } }); return sb.toString(); }  }
AbstractOutputBuilder { static String generateCaseInformation(SortedSet<TestCase> cases) { StringBuilder sb = new StringBuilder(); cases.stream().filter(c -> c.getState().isWarning() || c.getState().isCritical() || c.getState().isError()) .forEach(c -> { sb.append(", case \"").append(c.getName()).append("\" "); if (c.getState().isError()) { sb.append("EXCEPTION: ").append(c.getExceptionMessages(true)); } else { sb.append("over runtime (").append(TimeFormatter.formatToSec(c.getDuration())); if (c.getState().isCritical()) { sb.append("/crit at ").append(TimeFormatter.formatToSec(c.getCriticalTime())); } else { sb.append("/warn at ").append(TimeFormatter.formatToSec(c.getWarningTime())); } sb.append(")"); } }); return sb.toString(); }  static String replacePlaceHolder(String message, PlaceholderMap placeholderStringMap); }
AbstractOutputBuilder { static String generateCaseInformation(SortedSet<TestCase> cases) { StringBuilder sb = new StringBuilder(); cases.stream().filter(c -> c.getState().isWarning() || c.getState().isCritical() || c.getState().isError()) .forEach(c -> { sb.append(", case \"").append(c.getName()).append("\" "); if (c.getState().isError()) { sb.append("EXCEPTION: ").append(c.getExceptionMessages(true)); } else { sb.append("over runtime (").append(TimeFormatter.formatToSec(c.getDuration())); if (c.getState().isCritical()) { sb.append("/crit at ").append(TimeFormatter.formatToSec(c.getCriticalTime())); } else { sb.append("/warn at ").append(TimeFormatter.formatToSec(c.getWarningTime())); } sb.append(")"); } }); return sb.toString(); }  static String replacePlaceHolder(String message, PlaceholderMap placeholderStringMap); final static SimpleDateFormat dateFormat; }