summaryrefslogtreecommitdiff
path: root/core/src/test/java/org/elasticsearch/index/fielddata/ScriptDocValuesDatesTests.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/test/java/org/elasticsearch/index/fielddata/ScriptDocValuesDatesTests.java')
-rw-r--r--core/src/test/java/org/elasticsearch/index/fielddata/ScriptDocValuesDatesTests.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/core/src/test/java/org/elasticsearch/index/fielddata/ScriptDocValuesDatesTests.java b/core/src/test/java/org/elasticsearch/index/fielddata/ScriptDocValuesDatesTests.java
index f8579efae7..626327d454 100644
--- a/core/src/test/java/org/elasticsearch/index/fielddata/ScriptDocValuesDatesTests.java
+++ b/core/src/test/java/org/elasticsearch/index/fielddata/ScriptDocValuesDatesTests.java
@@ -19,15 +19,16 @@
package org.elasticsearch.index.fielddata;
-import org.apache.lucene.index.SortedNumericDocValues;
import org.elasticsearch.index.fielddata.ScriptDocValues.Dates;
import org.elasticsearch.test.ESTestCase;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.ReadableDateTime;
+import java.io.IOException;
+
public class ScriptDocValuesDatesTests extends ESTestCase {
- public void test() {
+ public void test() throws IOException {
long[][] values = new long[between(3, 10)][];
ReadableDateTime[][] expectedDates = new ReadableDateTime[values.length][];
for (int d = 0; d < values.length; d++) {
@@ -56,20 +57,23 @@ public class ScriptDocValuesDatesTests extends ESTestCase {
}
private Dates wrap(long[][] values) {
- return new Dates(new SortedNumericDocValues() {
+ return new Dates(new AbstractSortedNumericDocValues() {
long[] current;
+ int i;
@Override
- public void setDocument(int doc) {
+ public boolean advanceExact(int doc) {
current = values[doc];
+ i = 0;
+ return current.length > 0;
}
@Override
- public int count() {
+ public int docValueCount() {
return current.length;
}
@Override
- public long valueAt(int index) {
- return current[index];
+ public long nextValue() {
+ return current[i++];
}
});
}