Skip to content

Apache Lucene open-source search software

test query with QueryUtils

Robert Muir6979137588e8
diff --git a/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowCollationMethods.java b/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowCollationMethods.java
index b1dd1622201..cee6b5e0c1e 100644
--- a/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowCollationMethods.java
+++ b/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowCollationMethods.java
@@ -107,7 +107,9 @@ public class TestSlowCollationMethods extends LuceneTestCase {
doCheckSorting(docs);
}
- private void doTestRanges(String startPoint, String endPoint, Query query) throws Exception {
+ private void doTestRanges(String startPoint, String endPoint, Query query) throws Exception {
+ QueryUtils.check(query);
+
// positive test
TopDocs docs = searcher.search(query, numDocs);
for (ScoreDoc doc : docs.scoreDocs) {
@@ -146,4 +148,11 @@ public class TestSlowCollationMethods extends LuceneTestCase {
doTestRanges(startPoint, endPoint, query);
}
}
+
+ public void testQuery() {
+ String startPoint = _TestUtil.randomUnicodeString(random());
+ String endPoint = _TestUtil.randomUnicodeString(random());
+ Query query = new SlowCollatedTermRangeQuery("field", startPoint, endPoint, true, true, collator);
+ QueryUtils.check(random(), query, searcher);
+ }
}