assertEquals("yeah yeah,\nyeah,\nyeah", DataEnumLoader.addCommasForNewLines( s ));
}
public void testLazyString() {
//in this case we are dealing with an expression which will not be resolved at load time.
DataEnumLoader loader = new DataEnumLoader("'Person.type[sex]' : 'something @{sex}'");
assertFalse(loader.hasErrors());
Map data = loader.getData();
String[] sl = (String[]) data.get("Person.type[sex]");
String s = sl[0];
assertEquals("something @{sex}", s);
Map context = new HashMap() {{ put("sex", "cool"); }};
Object r = TemplateRuntime.eval(s, context);
assertEquals("something cool", r);
loader = new DataEnumLoader("'Person.type[sex, money]' : '@{sex} @{money}'");
assertFalse(loader.hasErrors());
sl = (String[]) loader.getData().get("Person.type[sex, money]");
s = sl[0];
assertEquals("@{sex} @{money}", s);
}