lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dna...@apache.org
Subject svn commit: r344468 - in /lucene/java/trunk/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query: BooleanQueryTest.java ExceptionQueryTest.java SingleFieldTestDb.java
Date Tue, 15 Nov 2005 23:16:01 GMT
Author: dnaber
Date: Tue Nov 15 15:15:53 2005
New Revision: 344468

URL: http://svn.apache.org/viewcvs?rev=344468&view=rev
Log:
avoid compiler/Eclipse warnings

Modified:
    lucene/java/trunk/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTest.java
    lucene/java/trunk/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/ExceptionQueryTest.java
    lucene/java/trunk/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/SingleFieldTestDb.java

Modified: lucene/java/trunk/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTest.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTest.java?rev=344468&r1=344467&r2=344468&view=diff
==============================================================================
--- lucene/java/trunk/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTest.java
(original)
+++ lucene/java/trunk/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/BooleanQueryTest.java
Tue Nov 15 15:15:53 2005
@@ -46,8 +46,8 @@
 
     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 @@
         }
       }
       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()); */
     

Modified: lucene/java/trunk/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/ExceptionQueryTest.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/ExceptionQueryTest.java?rev=344468&r1=344467&r2=344468&view=diff
==============================================================================
--- lucene/java/trunk/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/ExceptionQueryTest.java
(original)
+++ lucene/java/trunk/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/ExceptionQueryTest.java
Tue Nov 15 15:15:53 2005
@@ -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());
       }

Modified: lucene/java/trunk/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/SingleFieldTestDb.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/SingleFieldTestDb.java?rev=344468&r1=344467&r2=344468&view=diff
==============================================================================
--- lucene/java/trunk/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/SingleFieldTestDb.java
(original)
+++ lucene/java/trunk/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/SingleFieldTestDb.java
Tue Nov 15 15:15:53 2005
@@ -12,7 +12,6 @@
   private Directory db;
   private String[] docs;
   private String fieldName;
-  private String dbName = "testdb";
   
   public SingleFieldTestDb(String[] documents, String fName) {
     try {



Mime
View raw message