mirror of https://github.com/apache/lucene.git
LUCENE-9028: fix test compile
This commit is contained in:
parent
332f1d7741
commit
1f6c06f305
|
@ -18,7 +18,7 @@
|
|||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.apache.lucene.analysis.Analyzer;
|
||||
import org.apache.lucene.analysis.CharArraySet;
|
||||
|
@ -740,7 +740,7 @@ public class TestIntervals extends LuceneTestCase {
|
|||
}
|
||||
|
||||
public void testPrefix() throws IOException {
|
||||
for (IntervalsSource source : List.of(Intervals.prefix(new BytesRef("p")),
|
||||
for (IntervalsSource source : Arrays.asList(Intervals.prefix(new BytesRef("p")),
|
||||
Intervals.multiterm(PrefixQuery.toAutomaton(new BytesRef("p")), "p*" ) )) {
|
||||
checkIntervals(source, "field1", 5, new int[][]{
|
||||
{},
|
||||
|
@ -756,12 +756,12 @@ public class TestIntervals extends LuceneTestCase {
|
|||
assertMatch(mi, 1, 1, 6, 14);
|
||||
}
|
||||
|
||||
for (IntervalsSource noSuch : List.of(Intervals.prefix(new BytesRef("qqq")),
|
||||
for (IntervalsSource noSuch : Arrays.asList(Intervals.prefix(new BytesRef("qqq")),
|
||||
Intervals.multiterm(PrefixQuery.toAutomaton(new BytesRef("qqq")), "qqq*" ))) {
|
||||
checkIntervals(noSuch, "field1", 0, new int[][]{});
|
||||
}
|
||||
|
||||
for (IntervalsSource source : List.of(Intervals.prefix(new BytesRef("p"), 1),
|
||||
for (IntervalsSource source : Arrays.asList(Intervals.prefix(new BytesRef("p"), 1),
|
||||
Intervals.multiterm(PrefixQuery.toAutomaton(new BytesRef("p")), 1, "p*")) ) {
|
||||
IllegalStateException e = expectThrows(IllegalStateException.class, () -> {
|
||||
for (LeafReaderContext ctx : searcher.getIndexReader().leaves()) {
|
||||
|
|
|
@ -211,10 +211,10 @@ public class TestPayloadCheckQuery extends LuceneTestCase {
|
|||
}
|
||||
|
||||
public void testRewrite() throws IOException {
|
||||
SpanMultiTermQueryWrapper fiv = new SpanMultiTermQueryWrapper(new WildcardQuery(new Term("field", "fiv*")));
|
||||
SpanMultiTermQueryWrapper hund = new SpanMultiTermQueryWrapper(new WildcardQuery(new Term("field", "hund*")));
|
||||
SpanMultiTermQueryWrapper twent = new SpanMultiTermQueryWrapper(new WildcardQuery(new Term("field", "twent*")));
|
||||
SpanMultiTermQueryWrapper nin = new SpanMultiTermQueryWrapper(new WildcardQuery(new Term("field", "nin*")));
|
||||
SpanMultiTermQueryWrapper<WildcardQuery> fiv = new SpanMultiTermQueryWrapper<>(new WildcardQuery(new Term("field", "fiv*")));
|
||||
SpanMultiTermQueryWrapper<WildcardQuery> hund = new SpanMultiTermQueryWrapper<>(new WildcardQuery(new Term("field", "hund*")));
|
||||
SpanMultiTermQueryWrapper<WildcardQuery> twent = new SpanMultiTermQueryWrapper<>(new WildcardQuery(new Term("field", "twent*")));
|
||||
SpanMultiTermQueryWrapper<WildcardQuery> nin = new SpanMultiTermQueryWrapper<>(new WildcardQuery(new Term("field", "nin*")));
|
||||
|
||||
SpanNearQuery sq = new SpanNearQuery(new SpanQuery[] {fiv, hund, twent, nin}, 0, true);
|
||||
|
||||
|
|
Loading…
Reference in New Issue