Definition definition = dao.getDefinition("rewrite.test", null);
assertNotNull("rewrite.test definition not found.", definition);
assertEquals("Incorrect initial template value", "/test.jsp", definition.getTemplateAttribute().getValue());
RefreshMonitor reloadable = dao;
dao.loadDefinitionsFromResource(resource);
assertEquals("Factory should be fresh.", false, reloadable.refreshRequired());
// Make sure the system actually updates the timestamp.
Thread.sleep(SLEEP_MILLIS);
// Set up multiple data sources.
resource.modify("<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n" + "<!DOCTYPE tiles-definitions PUBLIC "
+ "\"-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN\" "
+ "\"http://tiles.apache.org/dtds/tiles-config_3_0.dtd\">\n\n" + "<tiles-definitions>"
+ "<definition name=\"rewrite.test\" template=\"/newtest.jsp\">"
+ "<put-attribute name=\"testparm\" value=\"testval\"/>" + "</definition>" //
+ "</tiles-definitions>");
assertEquals("Factory should be stale.", true, reloadable.refreshRequired());
verify(context, dao);
}