Skip to content

Commit

Permalink
Use RandomPicks to select a random array element
Browse files Browse the repository at this point in the history
  • Loading branch information
s1monw authored and brusic committed Jan 19, 2014
1 parent ed0ecb7 commit ff0dbef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/test/java/org/elasticsearch/test/TestCluster.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -202,7 +203,7 @@ private static Settings getRandomNodeSettings(long seed, String clusterName) {
} 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();
}

Expand Down

0 comments on commit ff0dbef

Please sign in to comment.