Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8160564

TEST: Add a test to check the implementation of VersionProps.versionNumbers()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 9
    • core-libs
    • b128
    • Verified

      The code in VersionProps.versionNumbers() could be slightly refactored in order to provide an entry point for unit testing:

      ...
      class VersionProps {
        . . .
        static List<Integer> parseVersionNumbers(String versionNumber) {
            // parsing code goes there
        }
        static List<Integer> versionNumbers() {
            return parseVersionNumbers(VERSION_NUMBER);
        }
        . . .
      }
      ...

      This would allow writing/adding a unit test for the algorithm implemented in parseVersionNumbers (either using white-box with -Xpatch or using reflection and the proper incantations to invoke parseVersionNumbers from outside the package).

            simonis Volker Simonis
            dfuchs Daniel Fuchs
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: