Search in sources :

Example 1 with VersionUtils.randomVersion

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));
    }
}
Also used : VersionUtils.randomVersion(org.elasticsearch.test.VersionUtils.randomVersion)

Example 2 with VersionUtils.randomVersion

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));
    }
}
Also used : VersionUtils.randomVersion(org.elasticsearch.test.VersionUtils.randomVersion)

Aggregations

VersionUtils.randomVersion (org.elasticsearch.test.VersionUtils.randomVersion)2