Browse Source

Remove left over references to ESTestCase

Isabel Drost-Fromm 9 years ago
parent
commit
6f15f35819

+ 6 - 7
core/src/test/java/org/elasticsearch/search/sort/GeoDistanceSortBuilderTests.java

@@ -35,7 +35,6 @@ import org.elasticsearch.index.mapper.MappedFieldType;
 import org.elasticsearch.index.mapper.geo.GeoPointFieldMapper;
 import org.elasticsearch.index.mapper.geo.GeoPointFieldMapper;
 import org.elasticsearch.index.query.QueryParseContext;
 import org.elasticsearch.index.query.QueryParseContext;
 import org.elasticsearch.indices.query.IndicesQueriesRegistry;
 import org.elasticsearch.indices.query.IndicesQueriesRegistry;
-import org.elasticsearch.test.ESTestCase;
 import org.elasticsearch.test.geo.RandomGeoGenerator;
 import org.elasticsearch.test.geo.RandomGeoGenerator;
 
 
 import java.io.IOException;
 import java.io.IOException;
@@ -93,9 +92,9 @@ public class GeoDistanceSortBuilderTests extends AbstractSortTestCase<GeoDistanc
         }
         }
         if (randomBoolean()) {
         if (randomBoolean()) {
             result.setNestedPath(
             result.setNestedPath(
-                    ESTestCase.randomValueOtherThan(
+                    randomValueOtherThan(
                             result.getNestedPath(),
                             result.getNestedPath(),
-                            () -> ESTestCase.randomAsciiOfLengthBetween(1, 10)));
+                            () -> randomAsciiOfLengthBetween(1, 10)));
         }
         }
         if (randomBoolean()) {
         if (randomBoolean()) {
             result.coerce(! result.coerce());
             result.coerce(! result.coerce());
@@ -171,20 +170,20 @@ public class GeoDistanceSortBuilderTests extends AbstractSortTestCase<GeoDistanc
             result.unit(unit(original.unit()));
             result.unit(unit(original.unit()));
             break;
             break;
         case 4:
         case 4:
-            result.order(ESTestCase.randomValueOtherThan(original.order(), () -> randomFrom(SortOrder.values())));
+            result.order(randomValueOtherThan(original.order(), () -> randomFrom(SortOrder.values())));
             break;
             break;
         case 5:
         case 5:
             result.sortMode(mode(original.sortMode()));
             result.sortMode(mode(original.sortMode()));
             break;
             break;
         case 6:
         case 6:
-            result.setNestedFilter(ESTestCase.randomValueOtherThan(
+            result.setNestedFilter(randomValueOtherThan(
                     original.getNestedFilter(),
                     original.getNestedFilter(),
                     () -> randomNestedFilter()));
                     () -> randomNestedFilter()));
             break;
             break;
         case 7:
         case 7:
-            result.setNestedPath(ESTestCase.randomValueOtherThan(
+            result.setNestedPath(randomValueOtherThan(
                     result.getNestedPath(),
                     result.getNestedPath(),
-                    () -> ESTestCase.randomAsciiOfLengthBetween(1, 10)));
+                    () -> randomAsciiOfLengthBetween(1, 10)));
             break;
             break;
         case 8:
         case 8:
             result.coerce(! original.coerce());
             result.coerce(! original.coerce());

+ 1 - 2
core/src/test/java/org/elasticsearch/search/sort/ScoreSortBuilderTests.java

@@ -26,7 +26,6 @@ import org.elasticsearch.common.ParsingException;
 import org.elasticsearch.common.xcontent.XContentFactory;
 import org.elasticsearch.common.xcontent.XContentFactory;
 import org.elasticsearch.common.xcontent.XContentParser;
 import org.elasticsearch.common.xcontent.XContentParser;
 import org.elasticsearch.index.query.QueryParseContext;
 import org.elasticsearch.index.query.QueryParseContext;
-import org.elasticsearch.test.ESTestCase;
 import org.junit.Rule;
 import org.junit.Rule;
 import org.junit.rules.ExpectedException;
 import org.junit.rules.ExpectedException;
 
 
@@ -46,7 +45,7 @@ public class ScoreSortBuilderTests extends AbstractSortTestCase<ScoreSortBuilder
     @Override
     @Override
     protected ScoreSortBuilder mutate(ScoreSortBuilder original) throws IOException {
     protected ScoreSortBuilder mutate(ScoreSortBuilder original) throws IOException {
         ScoreSortBuilder result = new ScoreSortBuilder();
         ScoreSortBuilder result = new ScoreSortBuilder();
-        result.order(ESTestCase.randomValueOtherThan(original.order(), () -> randomFrom(SortOrder.values())));
+        result.order(randomValueOtherThan(original.order(), () -> randomFrom(SortOrder.values())));
         return result;
         return result;
     }
     }
 
 

+ 5 - 6
core/src/test/java/org/elasticsearch/search/sort/ScriptSortBuilderTests.java

@@ -29,7 +29,6 @@ import org.elasticsearch.index.query.QueryParseContext;
 import org.elasticsearch.script.Script;
 import org.elasticsearch.script.Script;
 import org.elasticsearch.script.ScriptService.ScriptType;
 import org.elasticsearch.script.ScriptService.ScriptType;
 import org.elasticsearch.search.sort.ScriptSortBuilder.ScriptSortType;
 import org.elasticsearch.search.sort.ScriptSortBuilder.ScriptSortType;
-import org.elasticsearch.test.ESTestCase;
 import org.junit.Rule;
 import org.junit.Rule;
 import org.junit.rules.ExpectedException;
 import org.junit.rules.ExpectedException;
 
 
@@ -53,20 +52,20 @@ public class ScriptSortBuilderTests extends AbstractSortTestCase<ScriptSortBuild
         }
         }
         if (randomBoolean()) {
         if (randomBoolean()) {
             if (type == ScriptSortType.NUMBER) {
             if (type == ScriptSortType.NUMBER) {
-                builder.sortMode(ESTestCase.randomValueOtherThan(builder.sortMode(), () -> randomFrom(SortMode.values())));
+                builder.sortMode(randomValueOtherThan(builder.sortMode(), () -> randomFrom(SortMode.values())));
             } else {
             } else {
                 Set<SortMode> exceptThis = new HashSet<>();
                 Set<SortMode> exceptThis = new HashSet<>();
                 exceptThis.add(SortMode.SUM);
                 exceptThis.add(SortMode.SUM);
                 exceptThis.add(SortMode.AVG);
                 exceptThis.add(SortMode.AVG);
                 exceptThis.add(SortMode.MEDIAN);
                 exceptThis.add(SortMode.MEDIAN);
-                builder.sortMode(ESTestCase.randomValueOtherThanMany(exceptThis::contains, () -> randomFrom(SortMode.values())));
+                builder.sortMode(randomValueOtherThanMany(exceptThis::contains, () -> randomFrom(SortMode.values())));
             }
             }
         }
         }
         if (randomBoolean()) {
         if (randomBoolean()) {
             builder.setNestedFilter(randomNestedFilter());
             builder.setNestedFilter(randomNestedFilter());
         }
         }
         if (randomBoolean()) {
         if (randomBoolean()) {
-            builder.setNestedPath(ESTestCase.randomAsciiOfLengthBetween(1, 10));
+            builder.setNestedPath(randomAsciiOfLengthBetween(1, 10));
         }
         }
         return builder;
         return builder;
     }
     }
@@ -102,7 +101,7 @@ public class ScriptSortBuilderTests extends AbstractSortTestCase<ScriptSortBuild
                 break;
                 break;
             case 1:
             case 1:
                 if (original.type() == ScriptSortType.NUMBER) {
                 if (original.type() == ScriptSortType.NUMBER) {
-                    result.sortMode(ESTestCase.randomValueOtherThan(result.sortMode(), () -> randomFrom(SortMode.values())));
+                    result.sortMode(randomValueOtherThan(result.sortMode(), () -> randomFrom(SortMode.values())));
                 } else {
                 } else {
                     // script sort type String only allows MIN and MAX, so we only switch
                     // script sort type String only allows MIN and MAX, so we only switch
                     if (original.sortMode() == SortMode.MIN) {
                     if (original.sortMode() == SortMode.MIN) {
@@ -113,7 +112,7 @@ public class ScriptSortBuilderTests extends AbstractSortTestCase<ScriptSortBuild
                 }
                 }
                 break;
                 break;
             case 2:
             case 2:
-                result.setNestedFilter(ESTestCase.randomValueOtherThan(
+                result.setNestedFilter(randomValueOtherThan(
                         original.getNestedFilter(),
                         original.getNestedFilter(),
                         () -> randomNestedFilter()));
                         () -> randomNestedFilter()));
                 break;
                 break;