@Test public void testFormatTestSuiteStateMessageException() throws Exception { Date startDate = new Date(); TestSuite testSuiteExample = new TestSuiteExampleBuilder() .withId("sakuli-123") .withState(TestSuiteState.ERRORS) .withStartDate(startDate) .withException(new SakuliCheckedException("TEST-ERROR")) .withStopDate(DateUtils.addSeconds(startDate, 120)) .buildExample(); String result = testling.formatTestSuiteSummaryStateMessage(testSuiteExample, properties.getTemplateSuiteSummary()); String lastRun = AbstractOutputBuilder.dateFormat.format(testSuiteExample.getStopDate()); assertEquals(result, "[CRIT] Sakuli suite \"sakuli-123\" (120.00s) EXCEPTION: 'TEST-ERROR'. (Last suite run: " + lastRun + ")"); }
protected String formatTestSuiteSummaryStateMessage(TestSuite testSuite, String templateSuiteSummary) { if (StringUtils.isBlank(templateSuiteSummary)) { throw new SakuliRuntimeException("Template for resolving test suite output is EMPTY!"); } String result = replacePlaceHolder(templateSuiteSummary, getTextPlaceholder(testSuite)); LOGGER.debug("{{xxx}} patterns in template '{}' replaced with message '{}'", templateSuiteSummary, result); return cutTo(result, getSummaryMaxLength()); }
AbstractOutputBuilder { protected String formatTestSuiteSummaryStateMessage(TestSuite testSuite, String templateSuiteSummary) { if (StringUtils.isBlank(templateSuiteSummary)) { throw new SakuliRuntimeException("Template for resolving test suite output is EMPTY!"); } String result = replacePlaceHolder(templateSuiteSummary, getTextPlaceholder(testSuite)); LOGGER.debug("{{xxx}} patterns in template '{}' replaced with message '{}'", templateSuiteSummary, result); return cutTo(result, getSummaryMaxLength()); } }
AbstractOutputBuilder { protected String formatTestSuiteSummaryStateMessage(TestSuite testSuite, String templateSuiteSummary) { if (StringUtils.isBlank(templateSuiteSummary)) { throw new SakuliRuntimeException("Template for resolving test suite output is EMPTY!"); } String result = replacePlaceHolder(templateSuiteSummary, getTextPlaceholder(testSuite)); LOGGER.debug("{{xxx}} patterns in template '{}' replaced with message '{}'", templateSuiteSummary, result); return cutTo(result, getSummaryMaxLength()); }  }
AbstractOutputBuilder { protected String formatTestSuiteSummaryStateMessage(TestSuite testSuite, String templateSuiteSummary) { if (StringUtils.isBlank(templateSuiteSummary)) { throw new SakuliRuntimeException("Template for resolving test suite output is EMPTY!"); } String result = replacePlaceHolder(templateSuiteSummary, getTextPlaceholder(testSuite)); LOGGER.debug("{{xxx}} patterns in template '{}' replaced with message '{}'", templateSuiteSummary, result); return cutTo(result, getSummaryMaxLength()); }  static String replacePlaceHolder(String message, PlaceholderMap placeholderStringMap); }
AbstractOutputBuilder { protected String formatTestSuiteSummaryStateMessage(TestSuite testSuite, String templateSuiteSummary) { if (StringUtils.isBlank(templateSuiteSummary)) { throw new SakuliRuntimeException("Template for resolving test suite output is EMPTY!"); } String result = replacePlaceHolder(templateSuiteSummary, getTextPlaceholder(testSuite)); LOGGER.debug("{{xxx}} patterns in template '{}' replaced with message '{}'", templateSuiteSummary, result); return cutTo(result, getSummaryMaxLength()); }  static String replacePlaceHolder(String message, PlaceholderMap placeholderStringMap); final static SimpleDateFormat dateFormat; }