@Test public void testBuildCritical() throws Exception { TestSuite testSuite = new TestSuiteExampleBuilder() .withState(TestSuiteState.CRITICAL_IN_SUITE) .withCriticalTime(100) .withId("TEST-SUITE-ID") .withTestCases(Collections.singletonList(new TestCaseExampleBuilder() .withId("TEST-CASE-ID") .withState(TestCaseState.OK) .buildExample())) .buildExample(); ReflectionTestUtils.setField(testling, "testSuite", testSuite); Assert.assertEquals(testling.build(), "[CRIT] Sakuli suite \"TEST-SUITE-ID\" critical (120.00s/crit at 100s). (Last suite run: 17.08.14 14:02:00)\n" + "[OK] case \"TEST-CASE-ID\" ran in 3.00s - ok"); }
@Override public String build() { StringBuilder sb = new StringBuilder(); sb.append(formatTestSuiteSummaryStateMessage(testSuite, properties.getTemplateSuiteSummary())) .append(ICINGA_SEPARATOR); for (TestCase tc : testSuite.getTestCasesAsSortedSet()) { String template = properties.lookUpTemplate(tc.getState()); String result = replacePlaceHolder(template, getTextPlaceholder(tc)); LOGGER.debug("{{xxx}} patterns in template '{}' replaced with message '{}'", template, result); sb.append(result); } return sb.toString(); }
Icinga2OutputBuilder extends AbstractOutputBuilder implements Builder<String> { @Override public String build() { StringBuilder sb = new StringBuilder(); sb.append(formatTestSuiteSummaryStateMessage(testSuite, properties.getTemplateSuiteSummary())) .append(ICINGA_SEPARATOR); for (TestCase tc : testSuite.getTestCasesAsSortedSet()) { String template = properties.lookUpTemplate(tc.getState()); String result = replacePlaceHolder(template, getTextPlaceholder(tc)); LOGGER.debug("{{xxx}} patterns in template '{}' replaced with message '{}'", template, result); sb.append(result); } return sb.toString(); } }
Icinga2OutputBuilder extends AbstractOutputBuilder implements Builder<String> { @Override public String build() { StringBuilder sb = new StringBuilder(); sb.append(formatTestSuiteSummaryStateMessage(testSuite, properties.getTemplateSuiteSummary())) .append(ICINGA_SEPARATOR); for (TestCase tc : testSuite.getTestCasesAsSortedSet()) { String template = properties.lookUpTemplate(tc.getState()); String result = replacePlaceHolder(template, getTextPlaceholder(tc)); LOGGER.debug("{{xxx}} patterns in template '{}' replaced with message '{}'", template, result); sb.append(result); } return sb.toString(); }  }
Icinga2OutputBuilder extends AbstractOutputBuilder implements Builder<String> { @Override public String build() { StringBuilder sb = new StringBuilder(); sb.append(formatTestSuiteSummaryStateMessage(testSuite, properties.getTemplateSuiteSummary())) .append(ICINGA_SEPARATOR); for (TestCase tc : testSuite.getTestCasesAsSortedSet()) { String template = properties.lookUpTemplate(tc.getState()); String result = replacePlaceHolder(template, getTextPlaceholder(tc)); LOGGER.debug("{{xxx}} patterns in template '{}' replaced with message '{}'", template, result); sb.append(result); } return sb.toString(); }  @Override String build(); }
Icinga2OutputBuilder extends AbstractOutputBuilder implements Builder<String> { @Override public String build() { StringBuilder sb = new StringBuilder(); sb.append(formatTestSuiteSummaryStateMessage(testSuite, properties.getTemplateSuiteSummary())) .append(ICINGA_SEPARATOR); for (TestCase tc : testSuite.getTestCasesAsSortedSet()) { String template = properties.lookUpTemplate(tc.getState()); String result = replacePlaceHolder(template, getTextPlaceholder(tc)); LOGGER.debug("{{xxx}} patterns in template '{}' replaced with message '{}'", template, result); sb.append(result); } return sb.toString(); }  @Override String build(); static final String ICINGA_SEPARATOR; }