@Test(dataProvider = "placeholder") public void testReplacePlaceHolder(String testMessage, String expectedMesaage) throws Exception { PlaceholderMap map = new PlaceholderMap(); map.put(STATE, "OK"); map.put(ID, "sakuli-123"); assertEquals(AbstractOutputBuilder.replacePlaceHolder(testMessage, map), expectedMesaage); map.put(STATE, STATE_DESC.getPattern()); map.put(STATE_DESC, "OK"); assertEquals(AbstractOutputBuilder.replacePlaceHolder(testMessage, map), expectedMesaage); }
public static String replacePlaceHolder(String message, PlaceholderMap placeholderStringMap) { if (StringUtils.isBlank(message)) { throw new SakuliRuntimeException("Template for resolving test suite output is EMPTY!"); } String modifiedString = message; for (TextPlaceholder key : placeholderStringMap.keySet()) { modifiedString = StringUtils.replace(modifiedString, key.getPattern(), placeholderStringMap.get(key)); } for (TextPlaceholder placeholder : placeholderStringMap.keySet()) { if (StringUtils.contains(modifiedString, placeholder.getPattern())) { return replacePlaceHolder(modifiedString, placeholderStringMap); } } return modifiedString; }
AbstractOutputBuilder { public static String replacePlaceHolder(String message, PlaceholderMap placeholderStringMap) { if (StringUtils.isBlank(message)) { throw new SakuliRuntimeException("Template for resolving test suite output is EMPTY!"); } String modifiedString = message; for (TextPlaceholder key : placeholderStringMap.keySet()) { modifiedString = StringUtils.replace(modifiedString, key.getPattern(), placeholderStringMap.get(key)); } for (TextPlaceholder placeholder : placeholderStringMap.keySet()) { if (StringUtils.contains(modifiedString, placeholder.getPattern())) { return replacePlaceHolder(modifiedString, placeholderStringMap); } } return modifiedString; } }
AbstractOutputBuilder { public static String replacePlaceHolder(String message, PlaceholderMap placeholderStringMap) { if (StringUtils.isBlank(message)) { throw new SakuliRuntimeException("Template for resolving test suite output is EMPTY!"); } String modifiedString = message; for (TextPlaceholder key : placeholderStringMap.keySet()) { modifiedString = StringUtils.replace(modifiedString, key.getPattern(), placeholderStringMap.get(key)); } for (TextPlaceholder placeholder : placeholderStringMap.keySet()) { if (StringUtils.contains(modifiedString, placeholder.getPattern())) { return replacePlaceHolder(modifiedString, placeholderStringMap); } } return modifiedString; }  }
AbstractOutputBuilder { public static String replacePlaceHolder(String message, PlaceholderMap placeholderStringMap) { if (StringUtils.isBlank(message)) { throw new SakuliRuntimeException("Template for resolving test suite output is EMPTY!"); } String modifiedString = message; for (TextPlaceholder key : placeholderStringMap.keySet()) { modifiedString = StringUtils.replace(modifiedString, key.getPattern(), placeholderStringMap.get(key)); } for (TextPlaceholder placeholder : placeholderStringMap.keySet()) { if (StringUtils.contains(modifiedString, placeholder.getPattern())) { return replacePlaceHolder(modifiedString, placeholderStringMap); } } return modifiedString; }  static String replacePlaceHolder(String message, PlaceholderMap placeholderStringMap); }
AbstractOutputBuilder { public static String replacePlaceHolder(String message, PlaceholderMap placeholderStringMap) { if (StringUtils.isBlank(message)) { throw new SakuliRuntimeException("Template for resolving test suite output is EMPTY!"); } String modifiedString = message; for (TextPlaceholder key : placeholderStringMap.keySet()) { modifiedString = StringUtils.replace(modifiedString, key.getPattern(), placeholderStringMap.get(key)); } for (TextPlaceholder placeholder : placeholderStringMap.keySet()) { if (StringUtils.contains(modifiedString, placeholder.getPattern())) { return replacePlaceHolder(modifiedString, placeholderStringMap); } } return modifiedString; }  static String replacePlaceHolder(String message, PlaceholderMap placeholderStringMap); final static SimpleDateFormat dateFormat; }