Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

avoid compiler/Eclipse warnings

Daniel Naber7e079d29503b
diff --git a/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTest.java b/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTest.java
index d5c1d671484..9aa05616c7d 100644
--- a/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTest.java
+++ b/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTest.java
@@ -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()); */
diff --git a/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/ExceptionQueryTest.java b/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/ExceptionQueryTest.java
index 4c3bbfa85fc..e88495e63b7 100644
--- a/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/ExceptionQueryTest.java
+++ b/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/ExceptionQueryTest.java
@@ -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());
}
diff --git a/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/SingleFieldTestDb.java b/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/SingleFieldTestDb.java
index e8474e63706..da06b45386a 100644
--- a/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/SingleFieldTestDb.java
+++ b/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/SingleFieldTestDb.java
@@ -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 {