Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-rc1
    • None
    • Core

    Description

      Every test that duplicates the following code (or some variant):

      System.setProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY, "config-file.xml");
      

      Along with retrieving the updated LoggerContext, resetting StatusLogger, etc., can all be cleaned up by using the Log4jConfig rule. There is one catch, however, that I've noticed in several tests. Where a log file is created and deleted for a test, many tests call file.delete() at the beginning of the test. This is done because the logger context is retrieved after the call, but the rule sets up the logger context before the test is executed. Thus, these calls should be eliminated while leaving the file.delete() at the end of the test method.

      Attachments

        Activity

          People

            mattsicker Matt Sicker
            mattsicker Matt Sicker
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: