Class VersionUtils

java.lang.Object
org.elasticsearch.test.VersionUtils

public class VersionUtils extends Object
Utilities for selecting versions in tests
  • Constructor Details

    • VersionUtils

      public VersionUtils()
  • Method Details

    • allReleasedVersions

      public static List<Version> allReleasedVersions()
      Returns an immutable, sorted list containing all released versions.
    • allUnreleasedVersions

      public static List<Version> allUnreleasedVersions()
      Returns an immutable, sorted list containing all unreleased versions.
    • allVersions

      public static List<Version> allVersions()
      Returns an immutable, sorted list containing all versions, both released and unreleased.
    • getPreviousVersion

      public static Version getPreviousVersion(Version version)
      Get the released version before version.
    • getPreviousVersion

      public static Version getPreviousVersion()
      Get the released version before Version.CURRENT.
    • getPreviousMinorVersion

      public static Version getPreviousMinorVersion()
      Returns the released Version before the Version.CURRENT where the minor version is less than the currents minor version.
    • getFirstVersion

      public static Version getFirstVersion()
      Returns the oldest released Version
    • randomVersion

      public static Version randomVersion(Random random)
      Returns a random Version from all available versions.
    • randomCompatibleVersion

      public static Version randomCompatibleVersion(Random random, Version version)
      Returns a random Version from all available versions, that is compatible with the given version.
    • randomVersionBetween

      public static Version randomVersionBetween(Random random, @Nullable Version minVersion, @Nullable Version maxVersion)
      Returns a random Version between minVersion and maxVersion (inclusive).
    • compatibleFutureVersion

      public static Version compatibleFutureVersion(Version version)
      returns the first future compatible version
    • maxCompatibleVersion

      public static Version maxCompatibleVersion(Version version)
      Returns the maximum Version that is compatible with the given version.
    • randomIndexCompatibleVersion

      public static Version randomIndexCompatibleVersion(Random random)
      Returns a random version index compatible with the current version.
    • randomPreviousCompatibleVersion

      public static Version randomPreviousCompatibleVersion(Random random, Version version)
      Returns a random version index compatible with the given version, but not the given version.