Improve some test method comments.

This commit is contained in:
Christoph Büscher 2016-03-31 21:27:42 +02:00
parent 1a697a1ae6
commit 7a1b06ce0b
3 changed files with 6 additions and 7 deletions

View File

@ -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() {

View File

@ -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;
/**
*/

View File

@ -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) {