@Test public void missingValueRaisesException() { try { new Template("${foo}").evaluate(); fail("evaluate() should throw an exception if " + "a placeholder was left without a value!"); } catch (MissingValueException expected) { assertEquals("No value for ${foo}", expected.getMessage()); } }
public String evaluate() { TemplateParse p = new TemplateParse(); List<Segment> segments = p.parseSegments(templateText); return concatenate(segments); }
Template { public String evaluate() { TemplateParse p = new TemplateParse(); List<Segment> segments = p.parseSegments(templateText); return concatenate(segments); } }
Template { public String evaluate() { TemplateParse p = new TemplateParse(); List<Segment> segments = p.parseSegments(templateText); return concatenate(segments); } Template(String templateText); }
Template { public String evaluate() { TemplateParse p = new TemplateParse(); List<Segment> segments = p.parseSegments(templateText); return concatenate(segments); } Template(String templateText); void set(String name, String value); String evaluate(); }
Template { public String evaluate() { TemplateParse p = new TemplateParse(); List<Segment> segments = p.parseSegments(templateText); return concatenate(segments); } Template(String templateText); void set(String name, String value); String evaluate();  }