Package org.opensearch.test
Class VersionUtils
java.lang.Object
org.opensearch.test.VersionUtils
public class VersionUtils
extends java.lang.Object
Utilities for selecting versions in tests
-
Constructor Summary
Constructors Constructor Description VersionUtils() -
Method Summary
Modifier and Type Method Description static java.util.List<org.opensearch.Version>allLegacyVersions()Returns an immutable, sorted list containing all legacy versions; released and unreleasedstatic java.util.List<org.opensearch.Version>allOpenSearchVersions()Returns an immutable, sorted list containing all opensearch versions; released and unreleasedstatic java.util.List<org.opensearch.Version>allReleasedVersions()Returns an immutable, sorted list containing all released versions.static java.util.List<org.opensearch.Version>allUnreleasedVersions()Returns an immutable, sorted list containing all unreleased versions.static java.util.List<org.opensearch.Version>allVersions()Returns an immutable, sorted list containing all versions, both released and unreleased.static org.opensearch.VersioncompatibleFutureVersion(org.opensearch.Version version)returns the first future compatible versionstatic org.opensearch.VersiongetFirstVersion()Returns the oldest releasedVersionstatic org.opensearch.VersiongetFirstVersionOfMajor(java.util.List<org.opensearch.Version> versions, int major)static org.opensearch.VersiongetPreviousMinorVersion()Returns the releasedVersionbefore theVersion.CURRENTwhere the minor version is less than the currents minor version.static org.opensearch.VersiongetPreviousVersion()Get the released version beforeVersion.CURRENT.static org.opensearch.VersiongetPreviousVersion(org.opensearch.Version version)Get the released version beforeversion.static org.opensearch.VersionincompatibleFutureVersion(org.opensearch.Version version)returns the first future incompatible versionstatic org.opensearch.VersionlastFirstReleasedMinorFromMajor(java.util.List<org.opensearch.Version> allVersions, int major)Returns the first released (e.g., patch version 0)Versionof the last minor from the requested major version e.g., for version 1.0.0 this would be legacy version (7.10.0); the first release (patch 0), of the last minor (for 7.x that is minor version 10) for the desired major version (7)static org.opensearch.VersionmaxCompatibleVersion(org.opensearch.Version version)Returns the maximumVersionthat is compatible with the given version.static org.opensearch.VersionrandomCompatibleVersion(java.util.Random random, org.opensearch.Version version)Returns a randomVersionfrom all available versions, that is compatible with the given version.static org.opensearch.VersionrandomIndexCompatibleVersion(java.util.Random random)Returns a random version index compatible with the current version.static org.opensearch.VersionrandomOpenSearchVersion(java.util.Random random)Return a randomVersionfrom all available opensearch versions.static org.opensearch.VersionrandomVersion(java.util.Random random)Returns a randomVersionfrom all available versions.static org.opensearch.VersionrandomVersionBetween(java.util.Random random, org.opensearch.Version minVersion, org.opensearch.Version maxVersion)Returns a randomVersionbetweenminVersionandmaxVersion(inclusive).
-
Constructor Details
-
VersionUtils
public VersionUtils()
-
-
Method Details
-
allReleasedVersions
public static java.util.List<org.opensearch.Version> allReleasedVersions()Returns an immutable, sorted list containing all released versions. -
allUnreleasedVersions
public static java.util.List<org.opensearch.Version> allUnreleasedVersions()Returns an immutable, sorted list containing all unreleased versions. -
allVersions
public static java.util.List<org.opensearch.Version> allVersions()Returns an immutable, sorted list containing all versions, both released and unreleased. -
allOpenSearchVersions
public static java.util.List<org.opensearch.Version> allOpenSearchVersions()Returns an immutable, sorted list containing all opensearch versions; released and unreleased -
allLegacyVersions
public static java.util.List<org.opensearch.Version> allLegacyVersions()Returns an immutable, sorted list containing all legacy versions; released and unreleased -
getPreviousVersion
public static org.opensearch.Version getPreviousVersion(org.opensearch.Version version)Get the released version beforeversion. -
getPreviousVersion
public static org.opensearch.Version getPreviousVersion()Get the released version beforeVersion.CURRENT. -
getPreviousMinorVersion
public static org.opensearch.Version getPreviousMinorVersion()Returns the releasedVersionbefore theVersion.CURRENTwhere the minor version is less than the currents minor version. -
getFirstVersion
public static org.opensearch.Version getFirstVersion()Returns the oldest releasedVersion -
getFirstVersionOfMajor
public static org.opensearch.Version getFirstVersionOfMajor(java.util.List<org.opensearch.Version> versions, int major) -
randomVersion
public static org.opensearch.Version randomVersion(java.util.Random random)Returns a randomVersionfrom all available versions. -
randomOpenSearchVersion
public static org.opensearch.Version randomOpenSearchVersion(java.util.Random random)Return a randomVersionfrom all available opensearch versions. -
lastFirstReleasedMinorFromMajor
public static org.opensearch.Version lastFirstReleasedMinorFromMajor(java.util.List<org.opensearch.Version> allVersions, int major)Returns the first released (e.g., patch version 0)Versionof the last minor from the requested major version e.g., for version 1.0.0 this would be legacy version (7.10.0); the first release (patch 0), of the last minor (for 7.x that is minor version 10) for the desired major version (7) -
randomCompatibleVersion
public static org.opensearch.Version randomCompatibleVersion(java.util.Random random, org.opensearch.Version version)Returns a randomVersionfrom all available versions, that is compatible with the given version. -
randomVersionBetween
public static org.opensearch.Version randomVersionBetween(java.util.Random random, @Nullable org.opensearch.Version minVersion, @Nullable org.opensearch.Version maxVersion)Returns a randomVersionbetweenminVersionandmaxVersion(inclusive). -
incompatibleFutureVersion
public static org.opensearch.Version incompatibleFutureVersion(org.opensearch.Version version)returns the first future incompatible version -
compatibleFutureVersion
public static org.opensearch.Version compatibleFutureVersion(org.opensearch.Version version)returns the first future compatible version -
maxCompatibleVersion
public static org.opensearch.Version maxCompatibleVersion(org.opensearch.Version version)Returns the maximumVersionthat is compatible with the given version. -
randomIndexCompatibleVersion
public static org.opensearch.Version randomIndexCompatibleVersion(java.util.Random random)Returns a random version index compatible with the current version.
-