}
public void testDefaultPlugins2() throws Exception {
// * tests that when there is no default plugin, it is an error
// not to have one of plugin-class or plugin-id specified
Digester digester = new Digester();
PluginRules rc = new PluginRules();
digester.setRules(rc);
PluginCreateRule pcr = new PluginCreateRule(Widget.class);
digester.addRule("root/widget", pcr);
digester.addSetNext("root/widget", "addChild");
Container root = new Container();
digester.push(root);
Exception exception = null;
Log oldLog = digester.getLogger();
try {
digester.setLogger(new NoOpLog());
digester.parse(
TestAll.getInputStream(this, "test2.xml"));
}
catch(Exception e) {
exception = e;
}
finally {
digester.setLogger(oldLog);
}
assertTrue(exception != null);
assertEquals(SAXParseException.class, exception.getClass());
assertEquals(