@Test
public void testContentSubstitution() throws Exception {
String xml
= "<Content type=\"html\">Hello, __MSG_world__ __MODULE_ID__</Content>";
Substitutions substituter = new Substitutions();
substituter.addSubstitution(Type.MESSAGE, "world", "foo __UP_planet____BIDI_START_EDGE__");
substituter.addSubstitution(Type.USER_PREF, "planet", "Earth");
substituter.addSubstitution(Type.BIDI, "START_EDGE", "right");
substituter.addSubstitution(Type.MODULE, "ID", "3");
View view = new View("test",
Arrays.asList(XmlUtil.parse(xml)), SPEC_URL).substitute(substituter);
assertEquals("Hello, foo Earthright 3", view.getContent());
}