fix minor style issues in test

This commit is contained in:
Michael Sokolov 2022-06-29 11:03:59 -04:00
parent 95de554b65
commit e078bc1cd9
1 changed files with 7 additions and 6 deletions

View File

@ -19,14 +19,15 @@ package org.apache.lucene.search;
import org.apache.lucene.document.Document; import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field; import org.apache.lucene.document.Field;
import org.apache.lucene.index.*; import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.QueryTimeout;
import org.apache.lucene.index.Term;
import org.apache.lucene.store.Directory; import org.apache.lucene.store.Directory;
import org.apache.lucene.tests.analysis.MockAnalyzer; import org.apache.lucene.tests.analysis.MockAnalyzer;
import org.apache.lucene.tests.util.LuceneTestCase; import org.apache.lucene.tests.util.LuceneTestCase;
/** Tests the {@link TimeLimitingBulkScorer}. */ /** Tests the {@link TimeLimitingBulkScorer}. */
@LuceneTestCase.SuppressSysoutChecks(
bugUrl = "http://test.is.timing.sensitive.so.it.prints.instead.of.failing")
public class TestTimeLimitingBulkScorer extends LuceneTestCase { public class TestTimeLimitingBulkScorer extends LuceneTestCase {
public void testTimeLimitingBulkScorer() throws Exception { public void testTimeLimitingBulkScorer() throws Exception {
@ -51,7 +52,7 @@ public class TestTimeLimitingBulkScorer extends LuceneTestCase {
Query query = new TermQuery(new Term("default", "ones")); Query query = new TermQuery(new Term("default", "ones"));
directoryReader = DirectoryReader.open(directory); directoryReader = DirectoryReader.open(directory);
searcher = new IndexSearcher(directoryReader); searcher = new IndexSearcher(directoryReader);
searcher.setTimeout(CountingQueryTimeout(10)); searcher.setTimeout(countingQueryTimeout(10));
top = searcher.search(query, n); top = searcher.search(query, n);
hits = top.scoreDocs; hits = top.scoreDocs;
assertTrue( assertTrue(
@ -61,10 +62,10 @@ public class TestTimeLimitingBulkScorer extends LuceneTestCase {
directory.close(); directory.close();
} }
public static QueryTimeout CountingQueryTimeout(int timeallowed) { private static QueryTimeout countingQueryTimeout(int timeallowed) {
return new QueryTimeout() { return new QueryTimeout() {
public static int counter = 0; static int counter = 0;
@Override @Override
public boolean shouldExit() { public boolean shouldExit() {