parent
566992d2a1
commit
20b7258d41
|
@ -95,15 +95,25 @@ public class InternalGeoCentroidTests extends InternalAggregationTestCase<Intern
|
|||
break;
|
||||
case 1:
|
||||
count += between(1, 100);
|
||||
if (centroid == null) {
|
||||
// if the new count is > 0 then we need to make sure there is a
|
||||
// centroid or the constructor will throw an exception
|
||||
centroid = new GeoPoint(randomDoubleBetween(-90, 90, false), randomDoubleBetween(-180, 180, false));
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
GeoPoint newCentroid = new GeoPoint(centroid);
|
||||
if (randomBoolean()) {
|
||||
newCentroid.resetLat(centroid.getLat() / 2.0);
|
||||
if (centroid == null) {
|
||||
centroid = new GeoPoint(randomDoubleBetween(-90, 90, false), randomDoubleBetween(-180, 180, false));
|
||||
count = between(1, 100);
|
||||
} else {
|
||||
newCentroid.resetLon(centroid.getLon() / 2.0);
|
||||
GeoPoint newCentroid = new GeoPoint(centroid);
|
||||
if (randomBoolean()) {
|
||||
newCentroid.resetLat(centroid.getLat() / 2.0);
|
||||
} else {
|
||||
newCentroid.resetLon(centroid.getLon() / 2.0);
|
||||
}
|
||||
centroid = newCentroid;
|
||||
}
|
||||
centroid = newCentroid;
|
||||
break;
|
||||
case 3:
|
||||
if (metaData == null) {
|
||||
|
|
|
@ -206,7 +206,7 @@ public class InternalScriptedMetricTests extends InternalAggregationTestCase<Int
|
|||
break;
|
||||
case 1:
|
||||
Object newValue = randomValue(valueTypes, 0);
|
||||
while ((newValue == null && value == null) || newValue.equals(value)) {
|
||||
while ((newValue == null && value == null) || (newValue != null && newValue.equals(value))) {
|
||||
int levels = randomIntBetween(1, 3);
|
||||
Supplier[] valueTypes = new Supplier[levels];
|
||||
for (int i = 0; i < levels; i++) {
|
||||
|
|
Loading…
Reference in New Issue