StringTemplateUtils { public static String replace(String template, Map<String, Object> paramvalues) { return replace(template, paramvalues, '%'); }  static String replace(String template, Map<String, Object> paramvalues); static String replace(String template, Map<String, Object> paramvalues,
                               char sep_char); static String replace(String template, String param, String value); static String replace(String template, String param, String value,
                               char sep_char);  }
@Test public void testProcessUnknownParam() { try { StringTemplateUtils.replace("an %unknown% param", Collections.EMPTY_MAP); Assert.fail("Unknown parameter accepted"); } catch (OntopiaRuntimeException e) { } }
@Test public void testProcessUnknownParamDirect() { try { StringTemplateUtils.replace("an %unknown% param", "name", "Niko"); Assert.fail("Unknown parameter accepted"); } catch (OntopiaRuntimeException e) { } }
@Test public void testProcessUnterminatedParam() { try { StringTemplateUtils.replace("an %unknown param", Collections.EMPTY_MAP); Assert.fail("Unterminated parameter accepted"); } catch (OntopiaRuntimeException e) { } }
@Test public void testProcessUnterminatedValue() { try { Map map = new HashMap(); map.put("unset", null); StringTemplateUtils.replace("an %unset% param", map); Assert.fail("Unterminated value accepted"); } catch (OntopiaRuntimeException e) { } }
@Test public void testProcessUnterminatedValueDirect() { try { StringTemplateUtils.replace("an %unset% param", "unset", null); Assert.fail("Unterminated value accepted"); } catch (OntopiaRuntimeException e) { } }