attr.setName("attr1");
attr.setValue("New value");
def.addAttribute(attr);
defs.put(def.getName(), def);
Definitions definitions = new DefinitionsImpl();
try {
definitions.addDefinitions(defs);
} catch (NoSuchDefinitionException e) {
fail("Test failure: " + e);
}
assertNotNull("Couldn't get parent.",
definitions.getDefinition("parent.def1"));
assertEquals("Incorrect template value." , "/test1.jsp",
definitions.getDefinition("parent.def1").getTemplate());
assertEquals("Incorrect attr1 value", "value1",
definitions.getDefinition("parent.def1").getAttribute("attr1"));
assertNotNull("Couldn't get child.",
definitions.getDefinition("child.def1"));
assertEquals("Incorrect template value." , "/test1.jsp",
definitions.getDefinition("child.def1").getTemplate());
assertEquals("Incorrect attr1 value", "New value",
definitions.getDefinition("child.def1").getAttribute("attr1"));
}