mirror of https://github.com/apache/lucene.git
avoid compiler/Eclipse warnings
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@344468 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
292c9dfa72
commit
7e079d2950
|
@ -46,8 +46,8 @@ public class BooleanQueryTest {
|
|||
|
||||
public void collect(int docNr, float score) {
|
||||
/* System.out.println(docNr + " '" + dBase.getDocs()[docNr] + "': " + score); */
|
||||
testCase.assertTrue(queryText + ": positive score", score > 0.0);
|
||||
testCase.assertTrue(queryText + ": too many hits", totalMatched < expectedDocNrs.length);
|
||||
TestCase.assertTrue(queryText + ": positive score", score > 0.0);
|
||||
TestCase.assertTrue(queryText + ": too many hits", totalMatched < expectedDocNrs.length);
|
||||
int i;
|
||||
for (i = 0; i < expectedDocNrs.length; i++) {
|
||||
if ((! encountered[i]) && (expectedDocNrs[i] == docNr)) {
|
||||
|
@ -56,25 +56,24 @@ public class BooleanQueryTest {
|
|||
}
|
||||
}
|
||||
if (i == expectedDocNrs.length) {
|
||||
testCase.assertTrue(queryText + ": doc nr for hit not expected: " + docNr, false);
|
||||
TestCase.assertTrue(queryText + ": doc nr for hit not expected: " + docNr, false);
|
||||
}
|
||||
totalMatched++;
|
||||
}
|
||||
|
||||
void checkNrHits() {
|
||||
testCase.assertEquals(queryText + ": nr of hits", expectedDocNrs.length, totalMatched);
|
||||
TestCase.assertEquals(queryText + ": nr of hits", expectedDocNrs.length, totalMatched);
|
||||
}
|
||||
}
|
||||
|
||||
public void doTest() throws Exception {
|
||||
QueryParser parser = new QueryParser();
|
||||
|
||||
if (verbose) {
|
||||
System.out.println("");
|
||||
System.out.println("Query: " + queryText);
|
||||
}
|
||||
|
||||
SrndQuery lq = parser.parse(queryText);
|
||||
SrndQuery lq = QueryParser.parse(queryText);
|
||||
|
||||
/* if (verbose) System.out.println("Srnd: " + lq.toString()); */
|
||||
|
||||
|
|
|
@ -1,30 +1,23 @@
|
|||
package org.apache.lucene.queryParser.surround.query;
|
||||
|
||||
import org.apache.lucene.search.Query;
|
||||
|
||||
import org.apache.lucene.queryParser.surround.parser.QueryParser;
|
||||
import org.apache.lucene.queryParser.surround.parser.ParseException;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.apache.lucene.queryParser.surround.parser.QueryParser;
|
||||
|
||||
|
||||
public class ExceptionQueryTest {
|
||||
private String queryText;
|
||||
private boolean verbose;
|
||||
private TestCase testCase;
|
||||
|
||||
public ExceptionQueryTest(String queryText, boolean verbose) {
|
||||
this.queryText = queryText;
|
||||
this.verbose = verbose;
|
||||
this.testCase = testCase;
|
||||
}
|
||||
|
||||
public void doTest(StringBuffer failQueries) {
|
||||
QueryParser parser = new QueryParser();
|
||||
boolean pass = false;
|
||||
SrndQuery lq = null;
|
||||
try {
|
||||
lq = parser.parse(queryText);
|
||||
lq = QueryParser.parse(queryText);
|
||||
if (verbose) {
|
||||
System.out.println("Query: " + queryText + "\nParsed as: " + lq.toString());
|
||||
}
|
||||
|
|
|
@ -12,7 +12,6 @@ public class SingleFieldTestDb {
|
|||
private Directory db;
|
||||
private String[] docs;
|
||||
private String fieldName;
|
||||
private String dbName = "testdb";
|
||||
|
||||
public SingleFieldTestDb(String[] documents, String fName) {
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue