Properties props = new Properties();
props.setProperty("openjpa.MaxxFetchDepth", "1");
OpenJPAConfiguration config = new OpenJPAConfigurationImpl();
// track the messages
BufferedLogFactory log = new BufferedLogFactory();
config.setLogFactory(log);
config.fromProperties(props);
// make sure we got a warning that contains the string with the
// bad property name and a hint for the valid property name.
log.assertLogMessage("*\"openjpa.MaxxFetchDepth\"*");
log.assertLogMessage("*\"openjpa.MaxFetchDepth\"*");
log.clear();
// now make sure we do *not* try to validate sub-configurations (such
// as openjpa.jdbc.Foo).
props.clear();
props.setProperty("openjpa.jdbc.Foo", "XXX");
props.setProperty("oponjpa", "XXX");
config.fromProperties(props);
log.assertNoLogMessage("*\"openjpa.jdbc.Foo\"*");
log.assertNoLogMessage("*\"oponjpa\"*");
}