Use RandomPicks to select a random array element

This commit is contained in:
Simon Willnauer 2013-12-27 12:35:57 +01:00
parent 11ceaccc20
commit 1c2cb99751
1 changed files with 2 additions and 1 deletions

View File

@ -19,6 +19,7 @@
package org.elasticsearch.test;
import com.carrotsearch.randomizedtesting.SeedUtils;
import com.carrotsearch.randomizedtesting.generators.RandomPicks;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import com.google.common.collect.Collections2;
@ -202,7 +203,7 @@ public final class TestCluster implements Iterable<Client> {
} else {
builder.put(Transport.TransportSettings.TRANSPORT_TCP_COMPRESS, random.nextInt(10) == 0);
}
builder.put("type", CacheRecycler.Type.values()[random.nextInt(CacheRecycler.Type.values().length)]);
builder.put("type", RandomPicks.randomFrom(random, CacheRecycler.Type.values()));
return builder.build();
}