Improve some test method comments.
This commit is contained in:
parent
1a697a1ae6
commit
7a1b06ce0b
|
@ -80,9 +80,9 @@ public class PercolatorQueryBuilderTests extends AbstractQueryTestCase<Percolato
|
|||
}
|
||||
|
||||
/**
|
||||
* prevent fields in the "document" field from being shuffled randomly, because it later is parsed to
|
||||
* a {@link BytesReference} and even though the documents are the same, equals will fail when comparing
|
||||
* BytesReference
|
||||
* we don't want to shuffle the "document" field internally in {@link #testFromXContent()} because even though the
|
||||
* documents would be functionally the same, their {@link BytesReference} representation isn't and thats what we
|
||||
* compare when check for equality of the original and the shuffled builder
|
||||
*/
|
||||
@Override
|
||||
protected Set<String> shuffleProtectedFields() {
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
*/
|
||||
package org.elasticsearch.search;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.elasticsearch.common.inject.ModuleTestCase;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
|
@ -31,9 +29,10 @@ import org.elasticsearch.search.highlight.CustomHighlighter;
|
|||
import org.elasticsearch.search.highlight.Highlighter;
|
||||
import org.elasticsearch.search.highlight.PlainHighlighter;
|
||||
import org.elasticsearch.search.suggest.CustomSuggester;
|
||||
import org.elasticsearch.search.suggest.Suggester;
|
||||
import org.elasticsearch.search.suggest.phrase.PhraseSuggester;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
/**
|
||||
*/
|
||||
|
|
|
@ -622,7 +622,7 @@ public abstract class ESTestCase extends LuceneTestCase {
|
|||
private static Map<String, Object> shuffleMap(Map<String, Object> map, Set<String> exceptFieldNames) {
|
||||
List<String> keys = new ArrayList<>(map.keySet());
|
||||
// even though we shuffle later, we need this to make tests reproduce on different jvms
|
||||
//Collections.sort(keys);
|
||||
Collections.sort(keys);
|
||||
Map<String, Object> targetMap = new TreeMap<>();
|
||||
Collections.shuffle(keys, random());
|
||||
for (String key : keys) {
|
||||
|
|
Loading…
Reference in New Issue