EasyMock.replay(applicationContext);
((TilesApplicationContextAware) definitionDao)
.setApplicationContext(applicationContext);
definitionDao.setReader(new DigesterDefinitionsReader());
Definition definition = definitionDao.getDefinition("test.defName.subLayered", Locale.ITALY);
assertEquals("The template is not correct", "/testName.jsp", definition
.getTemplateAttribute().getValue());
assertEquals("The header attribute is not correct",
"/common/headerLayered.jsp", definition.getAttribute("header")
.getValue());
definition = definitionDao.getDefinition("test.defName.subLayered", Locale.ITALIAN);
assertEquals("The template is not correct", "/testName.jsp", definition
.getTemplateAttribute().getValue());
assertEquals("The header attribute is not correct",
"/common/headerLayered.jsp", definition.getAttribute("header")
.getValue());
definition = definitionDao.getDefinition("test.defName.subLayered", null);
assertEquals("The template is not correct", "/testName.jsp", definition
.getTemplateAttribute().getValue());
assertEquals("The header attribute is not correct",
"/common/headerLayered.jsp", definition.getAttribute("header")
.getValue());
definition = definitionDao.getDefinition("test.defName.noAttribute", null);
assertEquals("/testName.jsp", definition.getTemplateAttribute().getValue());
assertEquals(null, definition.getLocalAttributeNames());
definition = definitionDao.getDefinition("test.def3", null);
assertNotNull("The simple definition is null", definition);
}