Solr
  1. Solr
  2. SOLR-543

AbstractSolrTestCase should have automatic check for loggd exceptions

    Details

    • Type: Test Test
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      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.

        Activity

        Hide
        Jan Høydahl added a comment -

        This issue has been inactive for more than 4 years. Please close if it's no longer relevant/needed, or bring it up to date if you intend to work on it. SPRING_CLEANING_2013

        Show
        Jan Høydahl added a comment - This issue has been inactive for more than 4 years. Please close if it's no longer relevant/needed, or bring it up to date if you intend to work on it. SPRING_CLEANING_2013

          People

          • Assignee:
            Unassigned
            Reporter:
            Hoss Man
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development