use of org.elasticsearch.test.VersionUtils.randomVersion in project elasticsearch by elastic.
the class VersionTests method testMax.
public void testMax() {
assertEquals(Version.CURRENT, Version.max(Version.CURRENT, VersionUtils.getPreviousVersion()));
assertEquals(Version.CURRENT, Version.max(Version.fromString("1.0.1"), Version.CURRENT));
Version version = VersionUtils.randomVersion(random());
Version version1 = VersionUtils.randomVersion(random());
if (version.id >= version1.id) {
assertEquals(version, Version.max(version1, version));
} else {
assertEquals(version1, Version.max(version1, version));
}
}
use of org.elasticsearch.test.VersionUtils.randomVersion in project elasticsearch by elastic.
the class VersionTests method testMin.
public void testMin() {
assertEquals(VersionUtils.getPreviousVersion(), Version.min(Version.CURRENT, VersionUtils.getPreviousVersion()));
assertEquals(Version.fromString("1.0.1"), Version.min(Version.fromString("1.0.1"), Version.CURRENT));
Version version = VersionUtils.randomVersion(random());
Version version1 = VersionUtils.randomVersion(random());
if (version.id <= version1.id) {
assertEquals(version, Version.min(version1, version));
} else {
assertEquals(version1, Version.min(version1, version));
}
}
Aggregations