summaryrefslogtreecommitdiff
path: root/core/src/test/java/org/elasticsearch/index/fielddata/ScriptDocValuesGeoPointsTests.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/test/java/org/elasticsearch/index/fielddata/ScriptDocValuesGeoPointsTests.java')
-rw-r--r--core/src/test/java/org/elasticsearch/index/fielddata/ScriptDocValuesGeoPointsTests.java17
1 files changed, 10 insertions, 7 deletions
diff --git a/core/src/test/java/org/elasticsearch/index/fielddata/ScriptDocValuesGeoPointsTests.java b/core/src/test/java/org/elasticsearch/index/fielddata/ScriptDocValuesGeoPointsTests.java
index 466ca0b699..1f71a808ab 100644
--- a/core/src/test/java/org/elasticsearch/index/fielddata/ScriptDocValuesGeoPointsTests.java
+++ b/core/src/test/java/org/elasticsearch/index/fielddata/ScriptDocValuesGeoPointsTests.java
@@ -23,6 +23,7 @@ import org.elasticsearch.common.geo.GeoPoint;
import org.elasticsearch.common.geo.GeoUtils;
import org.elasticsearch.test.ESTestCase;
+import java.io.IOException;
import java.util.Arrays;
public class ScriptDocValuesGeoPointsTests extends ESTestCase {
@@ -30,22 +31,24 @@ public class ScriptDocValuesGeoPointsTests extends ESTestCase {
private static MultiGeoPointValues wrap(final GeoPoint... points) {
return new MultiGeoPointValues() {
int docID = -1;
+ int i;
@Override
- public GeoPoint valueAt(int i) {
+ public GeoPoint nextValue() {
if (docID != 0) {
fail();
}
- return points[i];
+ return points[i++];
}
@Override
- public void setDocument(int docId) {
- this.docID = docId;
+ public boolean advanceExact(int docId) {
+ docID = docId;
+ return points.length > 0;
}
@Override
- public int count() {
+ public int docValueCount() {
if (docID != 0) {
return 0;
}
@@ -62,7 +65,7 @@ public class ScriptDocValuesGeoPointsTests extends ESTestCase {
return randomDouble() * 360 - 180;
}
- public void testGeoGetLatLon() {
+ public void testGeoGetLatLon() throws IOException {
final double lat1 = randomLat();
final double lat2 = randomLat();
final double lon1 = randomLon();
@@ -81,7 +84,7 @@ public class ScriptDocValuesGeoPointsTests extends ESTestCase {
assertTrue(Arrays.equals(new double[] {lon1, lon2}, script.getLons()));
}
- public void testGeoDistance() {
+ public void testGeoDistance() throws IOException {
final double lat = randomLat();
final double lon = randomLon();
final MultiGeoPointValues values = wrap(new GeoPoint(lat, lon));