Package org.elasticsearch.test
Class VersionUtils
- java.lang.Object
-
- org.elasticsearch.test.VersionUtils
-
public class VersionUtils extends java.lang.ObjectUtilities for selecting versions in tests
-
-
Constructor Summary
Constructors Constructor Description VersionUtils()
-
Method Summary
Modifier and Type Method Description static java.util.List<Version>allReleasedVersions()Returns an immutable, sorted list containing all released versions.static java.util.List<Version>allUnreleasedVersions()Returns an immutable, sorted list containing all unreleased versions.static java.util.List<Version>allVersions()Returns an immutable, sorted list containing all versions, both released and unreleased.static VersioncompatibleFutureVersion(Version version)returns the first future compatible versionstatic VersiongetFirstVersion()Returns the oldest releasedVersionstatic VersiongetPreviousMinorVersion()Returns the releasedVersionbefore theVersion.CURRENTwhere the minor version is less than the currents minor version.static VersiongetPreviousVersion()Get the released version beforeVersion.CURRENT.static VersiongetPreviousVersion(Version version)Get the released version beforeversion.static VersionincompatibleFutureVersion(Version version)returns the first future incompatible versionstatic VersionmaxCompatibleVersion(Version version)Returns the maximumVersionthat is compatible with the given version.static VersionrandomCompatibleVersion(java.util.Random random, Version version)Returns a randomVersionfrom all available versions, that is compatible with the given version.static VersionrandomVersion(java.util.Random random)Returns a randomVersionfrom all available versions.static VersionrandomVersionBetween(java.util.Random random, Version minVersion, Version maxVersion)
-
-
-
Method Detail
-
allReleasedVersions
public static java.util.List<Version> allReleasedVersions()
Returns an immutable, sorted list containing all released versions.
-
allUnreleasedVersions
public static java.util.List<Version> allUnreleasedVersions()
Returns an immutable, sorted list containing all unreleased versions.
-
allVersions
public static java.util.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 beforeversion.
-
getPreviousVersion
public static Version getPreviousVersion()
Get the released version beforeVersion.CURRENT.
-
getPreviousMinorVersion
public static Version getPreviousMinorVersion()
Returns the releasedVersionbefore theVersion.CURRENTwhere the minor version is less than the currents minor version.
-
randomVersion
public static Version randomVersion(java.util.Random random)
Returns a randomVersionfrom all available versions.
-
randomCompatibleVersion
public static Version randomCompatibleVersion(java.util.Random random, Version version)
Returns a randomVersionfrom all available versions, that is compatible with the given version.
-
randomVersionBetween
public static Version randomVersionBetween(java.util.Random random, @Nullable Version minVersion, @Nullable Version maxVersion)
-
incompatibleFutureVersion
public static Version incompatibleFutureVersion(Version version)
returns the first future incompatible version
-
compatibleFutureVersion
public static Version compatibleFutureVersion(Version version)
returns the first future compatible version
-
-