AbstractSolrTestCase should have automatic check for loggd exceptions

Details

Description

SOLR-509 and SOLR-541 got me thinking: it would be really nice if AbstractSolrTestCase had some code such that:

setUp() registered a LogHandler that kept a record of any LogRecord that was:

SEVERE

WARNING

contained a Throwable

assertLog(Level, Class<Throwable>) could be called in the body of test methods to ensure that at a certain point a LogRecord with a particular level and/or type of Throwable had in fact been logged and note that it was expected.

tearDown() would inspect the LogHandler to assert no LogRecords exist that have not already been noted as expected.

Something like this would allow us to make sure that nothing "bad" was getting logged even if the API being tested presented a happy shiny face to the world – and to check that in situations where something bad should be logged, that it is.