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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b128
    • Verification:
      Verified

      Description

      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).

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: