remove @Repeat annotation from test
Original commit: elastic/x-pack-elasticsearch@d5414a32e8
This commit is contained in:
parent
d41815ca18
commit
fad95315fb
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
package org.elasticsearch.watcher;
|
||||
|
||||
import com.carrotsearch.randomizedtesting.annotations.Repeat;
|
||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -18,38 +17,39 @@ import static org.hamcrest.Matchers.is;
|
|||
public class WatcherVersionTests extends ElasticsearchTestCase {
|
||||
|
||||
@Test
|
||||
@Repeat(iterations = 100)
|
||||
public void testStrings() throws Exception {
|
||||
boolean beta = randomBoolean();
|
||||
int buildNumber = beta ? randomIntBetween(0, 49) : randomIntBetween(0, 48);
|
||||
int major = randomIntBetween(0, 20);
|
||||
int minor = randomIntBetween(0, 20);
|
||||
int revision = randomIntBetween(0, 20);
|
||||
for (int i = 0; i < 100; i++) {
|
||||
boolean beta = randomBoolean();
|
||||
int buildNumber = beta ? randomIntBetween(0, 49) : randomIntBetween(0, 48);
|
||||
int major = randomIntBetween(0, 20);
|
||||
int minor = randomIntBetween(0, 20);
|
||||
int revision = randomIntBetween(0, 20);
|
||||
|
||||
String build = buildNumber == 0 ? "" :
|
||||
beta ? "-beta" + buildNumber : "-rc" + buildNumber;
|
||||
String build = buildNumber == 0 ? "" :
|
||||
beta ? "-beta" + buildNumber : "-rc" + buildNumber;
|
||||
|
||||
|
||||
String versionName = new StringBuilder()
|
||||
.append(major)
|
||||
.append(".").append(minor)
|
||||
.append(".").append(revision)
|
||||
.append(build).toString();
|
||||
WatcherVersion version = WatcherVersion.fromString(versionName);
|
||||
String versionName = new StringBuilder()
|
||||
.append(major)
|
||||
.append(".").append(minor)
|
||||
.append(".").append(revision)
|
||||
.append(build).toString();
|
||||
WatcherVersion version = WatcherVersion.fromString(versionName);
|
||||
|
||||
logger.info("version: {}", versionName);
|
||||
logger.info("version: {}", versionName);
|
||||
|
||||
assertThat(version.major, is((byte) major));
|
||||
assertThat(version.minor, is((byte) minor));
|
||||
assertThat(version.revision, is((byte) revision));
|
||||
if (buildNumber == 0) {
|
||||
assertThat(version.build, is((byte) 99));
|
||||
} else if (beta) {
|
||||
assertThat(version.build, is((byte) buildNumber));
|
||||
} else {
|
||||
assertThat(version.build, is((byte) (buildNumber + 50)));
|
||||
assertThat(version.major, is((byte) major));
|
||||
assertThat(version.minor, is((byte) minor));
|
||||
assertThat(version.revision, is((byte) revision));
|
||||
if (buildNumber == 0) {
|
||||
assertThat(version.build, is((byte) 99));
|
||||
} else if (beta) {
|
||||
assertThat(version.build, is((byte) buildNumber));
|
||||
} else {
|
||||
assertThat(version.build, is((byte) (buildNumber + 50)));
|
||||
}
|
||||
|
||||
assertThat(version.number(), equalTo(versionName));
|
||||
}
|
||||
|
||||
assertThat(version.number(), equalTo(versionName));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue