Package org.elasticsearch.test
Class VersionUtils
- java.lang.Object
-
- org.elasticsearch.test.VersionUtils
-
public class VersionUtils extends java.lang.Object
Utilities for selecting versions in tests
-
-
Constructor Summary
Constructors Constructor Description VersionUtils()
-
Method Summary
All Methods Static Methods Concrete Methods 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 Version
compatibleFutureVersion(Version version)
returns the first future compatible versionstatic Version
getFirstVersion()
Returns the oldest releasedVersion
static Version
getPreviousMinorVersion()
Returns the releasedVersion
before theVersion.CURRENT
where the minor version is less than the currents minor version.static Version
getPreviousVersion()
Get the released version beforeVersion.CURRENT
.static Version
getPreviousVersion(Version version)
Get the released version beforeversion
.static Version
incompatibleFutureVersion(Version version)
returns the first future incompatible versionstatic Version
maxCompatibleVersion(Version version)
Returns the maximumVersion
that is compatible with the given version.static Version
randomCompatibleVersion(java.util.Random random, Version version)
Returns a randomVersion
from all available versions, that is compatible with the given version.static Version
randomVersion(java.util.Random random)
Returns a randomVersion
from all available versions.static Version
randomVersionBetween(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 releasedVersion
before theVersion.CURRENT
where the minor version is less than the currents minor version.
-
randomVersion
public static Version randomVersion(java.util.Random random)
Returns a randomVersion
from all available versions.
-
randomCompatibleVersion
public static Version randomCompatibleVersion(java.util.Random random, Version version)
Returns a randomVersion
from 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
-
-