Package org.elasticsearch.test
Class VersionUtils
java.lang.Object
org.elasticsearch.test.VersionUtils
Utilities for selecting versions in tests
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<org.elasticsearch.Version>
Returns an immutable, sorted list containing all released versions.static List<org.elasticsearch.Version>
Returns an immutable, sorted list containing all unreleased versions.static List<org.elasticsearch.Version>
Returns an immutable, sorted list containing all versions, both released and unreleased.static org.elasticsearch.Version
compatibleFutureVersion
(org.elasticsearch.Version version) returns the first future compatible versionstatic org.elasticsearch.Version
Returns the oldest releasedVersion
static org.elasticsearch.Version
Returns the releasedVersion
before theVersion.CURRENT
where the minor version is less than the currents minor version.static org.elasticsearch.Version
Get the released version beforeVersion.CURRENT
.static org.elasticsearch.Version
getPreviousVersion
(org.elasticsearch.Version version) Get the released version beforeversion
.static org.elasticsearch.Version
maxCompatibleVersion
(org.elasticsearch.Version version) Returns the maximumVersion
that is compatible with the given version.static org.elasticsearch.Version
randomCompatibleVersion
(Random random, org.elasticsearch.Version version) Returns a randomVersion
from all available versions, that is compatible with the given version.static org.elasticsearch.Version
randomIndexCompatibleVersion
(Random random) Returns a random version index compatible with the current version.static org.elasticsearch.Version
randomPreviousCompatibleVersion
(Random random, org.elasticsearch.Version version) Returns a random version index compatible with the given version, but not the given version.static org.elasticsearch.Version
randomVersion
(Random random) Returns a randomVersion
from all available versions.static org.elasticsearch.Version
randomVersionBetween
(Random random, org.elasticsearch.Version minVersion, org.elasticsearch.Version maxVersion) Returns a randomVersion
betweenminVersion
andmaxVersion
(inclusive).
-
Constructor Details
-
VersionUtils
public VersionUtils()
-
-
Method Details
-
allReleasedVersions
Returns an immutable, sorted list containing all released versions. -
allUnreleasedVersions
Returns an immutable, sorted list containing all unreleased versions. -
allVersions
Returns an immutable, sorted list containing all versions, both released and unreleased. -
getPreviousVersion
public static org.elasticsearch.Version getPreviousVersion(org.elasticsearch.Version version) Get the released version beforeversion
. -
getPreviousVersion
public static org.elasticsearch.Version getPreviousVersion()Get the released version beforeVersion.CURRENT
. -
getPreviousMinorVersion
public static org.elasticsearch.Version getPreviousMinorVersion()Returns the releasedVersion
before theVersion.CURRENT
where the minor version is less than the currents minor version. -
getFirstVersion
public static org.elasticsearch.Version getFirstVersion()Returns the oldest releasedVersion
-
randomVersion
Returns a randomVersion
from all available versions. -
randomCompatibleVersion
public static org.elasticsearch.Version randomCompatibleVersion(Random random, org.elasticsearch.Version version) Returns a randomVersion
from all available versions, that is compatible with the given version. -
randomVersionBetween
public static org.elasticsearch.Version randomVersionBetween(Random random, @Nullable org.elasticsearch.Version minVersion, @Nullable org.elasticsearch.Version maxVersion) Returns a randomVersion
betweenminVersion
andmaxVersion
(inclusive). -
compatibleFutureVersion
public static org.elasticsearch.Version compatibleFutureVersion(org.elasticsearch.Version version) returns the first future compatible version -
maxCompatibleVersion
public static org.elasticsearch.Version maxCompatibleVersion(org.elasticsearch.Version version) Returns the maximumVersion
that is compatible with the given version. -
randomIndexCompatibleVersion
Returns a random version index compatible with the current version. -
randomPreviousCompatibleVersion
public static org.elasticsearch.Version randomPreviousCompatibleVersion(Random random, org.elasticsearch.Version version) Returns a random version index compatible with the given version, but not the given version.
-