Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-9103

Replace GenericTestUtils temp directories with `@TempDir`

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • test
    • None

    Description

      Replace temporary directory functionality of GenericTestUtils with JUnit's @TempDir. The latter is automatically cleaned up.

      • Usage of File getRandomizedTestDir(), File getTestDir(), and File getTestDir(String) can be directly replaced by @TempDir. If the temp directory is stored in a local variable, convert it to a field for it.
      • For usages of String getRandomizedTempPath() and String getTempPath(String) we still need to add a Path or File as a field, and use toString() where needed.
      • Post-test deletion of the dir can be removed.
      • If @BeforeEach and @AfterEach methods are only used to create/delete the dir, they can be deleted as well.
      • Any unused imports should be removed.

      Attachments

        Issue Links

          Activity

            People

              adoroszlai Attila Doroszlai
              adoroszlai Attila Doroszlai
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: