mirror of https://github.com/apache/lucene.git
LUCENE-7719: tests: Eliminate needless SuppressSysoutChecks and address lint warning
This commit is contained in:
parent
d0b9d3459f
commit
42fdb54927
|
@ -24,7 +24,6 @@ import java.util.Locale;
|
||||||
|
|
||||||
import org.apache.lucene.util.LuceneTestCase;
|
import org.apache.lucene.util.LuceneTestCase;
|
||||||
|
|
||||||
@LuceneTestCase.SuppressSysoutChecks(bugUrl = "")//Gradle interferes with this Lucene test rule
|
|
||||||
public class TestSplittingBreakIterator extends LuceneTestCase {
|
public class TestSplittingBreakIterator extends LuceneTestCase {
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -51,12 +51,9 @@ import org.apache.lucene.search.TermQuery;
|
||||||
import org.apache.lucene.search.TopDocs;
|
import org.apache.lucene.search.TopDocs;
|
||||||
import org.apache.lucene.store.Directory;
|
import org.apache.lucene.store.Directory;
|
||||||
import org.apache.lucene.util.LuceneTestCase;
|
import org.apache.lucene.util.LuceneTestCase;
|
||||||
import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
|
||||||
@SuppressCodecs({"MockFixedIntBlock", "MockVariableIntBlock", "MockSep", "MockRandom", "Lucene3x"})
|
|
||||||
@LuceneTestCase.SuppressSysoutChecks(bugUrl = "")//Gradle interferes with this Lucene test rule
|
|
||||||
public class TestUnifiedHighlighter extends LuceneTestCase {
|
public class TestUnifiedHighlighter extends LuceneTestCase {
|
||||||
|
|
||||||
private final FieldType fieldType; // for "body" generally, but not necessarily others. See constructor
|
private final FieldType fieldType; // for "body" generally, but not necessarily others. See constructor
|
||||||
|
|
|
@ -37,15 +37,12 @@ import org.apache.lucene.search.TopDocs;
|
||||||
import org.apache.lucene.store.Directory;
|
import org.apache.lucene.store.Directory;
|
||||||
import org.apache.lucene.util.BytesRef;
|
import org.apache.lucene.util.BytesRef;
|
||||||
import org.apache.lucene.util.LuceneTestCase;
|
import org.apache.lucene.util.LuceneTestCase;
|
||||||
import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
|
|
||||||
import org.apache.lucene.util.TestUtil;
|
import org.apache.lucene.util.TestUtil;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
@SuppressCodecs({"MockFixedIntBlock", "MockVariableIntBlock", "MockSep", "MockRandom", "Lucene3x"})
|
|
||||||
@LuceneTestCase.SuppressSysoutChecks(bugUrl = "")//Gradle interferes with this Lucene test rule
|
|
||||||
public class TestUnifiedHighlighterRanking extends LuceneTestCase {
|
public class TestUnifiedHighlighterRanking extends LuceneTestCase {
|
||||||
|
|
||||||
Analyzer indexAnalyzer;
|
Analyzer indexAnalyzer;
|
||||||
|
|
|
@ -32,8 +32,6 @@ import org.apache.lucene.store.Directory;
|
||||||
import org.apache.lucene.util.LuceneTestCase;
|
import org.apache.lucene.util.LuceneTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
@LuceneTestCase.SuppressCodecs({"MockFixedIntBlock", "MockVariableIntBlock", "MockSep", "MockRandom", "Lucene3x"})
|
|
||||||
@LuceneTestCase.SuppressSysoutChecks(bugUrl = "")//Gradle interferes with this Lucene test rule
|
|
||||||
public class TestUnifiedHighlighterReanalysis extends LuceneTestCase {
|
public class TestUnifiedHighlighterReanalysis extends LuceneTestCase {
|
||||||
|
|
||||||
private MockAnalyzer indexAnalyzer =
|
private MockAnalyzer indexAnalyzer =
|
||||||
|
|
|
@ -54,8 +54,6 @@ import org.apache.lucene.util.QueryBuilder;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
|
||||||
@LuceneTestCase.SuppressCodecs({"MockFixedIntBlock", "MockVariableIntBlock", "MockSep", "MockRandom", "Lucene3x"})
|
|
||||||
@LuceneTestCase.SuppressSysoutChecks(bugUrl = "")//Gradle interferes with this Lucene test rule
|
|
||||||
public class TestUnifiedHighlighterStrictPhrases extends LuceneTestCase {
|
public class TestUnifiedHighlighterStrictPhrases extends LuceneTestCase {
|
||||||
|
|
||||||
final FieldType fieldType;
|
final FieldType fieldType;
|
||||||
|
|
|
@ -48,8 +48,6 @@ import java.util.Map;
|
||||||
* This test DOES NOT represent all testing for highlighting when term vectors are used. Other tests pick the offset
|
* This test DOES NOT represent all testing for highlighting when term vectors are used. Other tests pick the offset
|
||||||
* source at random (to include term vectors) and in-effect test term vectors generally.
|
* source at random (to include term vectors) and in-effect test term vectors generally.
|
||||||
*/
|
*/
|
||||||
@LuceneTestCase.SuppressCodecs({"MockFixedIntBlock", "MockVariableIntBlock", "MockSep", "MockRandom", "Lucene3x"})
|
|
||||||
@LuceneTestCase.SuppressSysoutChecks(bugUrl = "")//Gradle interferes with this Lucene test rule
|
|
||||||
public class TestUnifiedHighlighterTermVec extends LuceneTestCase {
|
public class TestUnifiedHighlighterTermVec extends LuceneTestCase {
|
||||||
|
|
||||||
private Analyzer indexAnalyzer;
|
private Analyzer indexAnalyzer;
|
||||||
|
|
|
@ -217,18 +217,20 @@ public class TestUnifiedHighlighterExtensibility extends LuceneTestCase {
|
||||||
// TEST OffsetsEnums & Passage visibility
|
// TEST OffsetsEnums & Passage visibility
|
||||||
|
|
||||||
// this code never runs; just for compilation
|
// this code never runs; just for compilation
|
||||||
OffsetsEnum oe = new OffsetsEnum(null, EMPTY);
|
Passage p;
|
||||||
oe.getTerm();
|
try (OffsetsEnum oe = new OffsetsEnum(null, EMPTY)) {
|
||||||
oe.getPostingsEnum();
|
oe.getTerm();
|
||||||
oe.freq();
|
oe.getPostingsEnum();
|
||||||
oe.hasMorePositions();
|
oe.freq();
|
||||||
oe.nextPosition();
|
oe.hasMorePositions();
|
||||||
oe.startOffset();
|
oe.nextPosition();
|
||||||
oe.endOffset();
|
oe.startOffset();
|
||||||
oe.getWeight();
|
oe.endOffset();
|
||||||
oe.setWeight(2f);
|
oe.getWeight();
|
||||||
|
oe.setWeight(2f);
|
||||||
|
}
|
||||||
|
|
||||||
Passage p = new Passage();
|
p = new Passage();
|
||||||
p.setStartOffset(0);
|
p.setStartOffset(0);
|
||||||
p.setEndOffset(9);
|
p.setEndOffset(9);
|
||||||
p.setScore(1f);
|
p.setScore(1f);
|
||||||
|
|
Loading…
Reference in New Issue