/**
* Tests read with bad XML source.
*/
public void testBadXml() {
try {
DefinitionsReader reader = new DigesterDefinitionsReader();
reader.init(new HashMap<String, String>());
URL configFile = this.getClass().getClassLoader().getResource(
"org/apache/tiles/config/malformed-defs.xml");
assertNotNull("Config file not found", configFile);
InputStream source = configFile.openStream();
reader.read(source);
fail("Should've thrown an exception.");
} catch (DefinitionsFactoryException e) {
// correct.
if (LOG.isDebugEnabled()) {
LOG.debug("Exception caught, it is OK", e);