lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Elschot <paul.elsc...@xs4all.nl>
Subject Fwd: svn commit: r168454 - /lucene/java/trunk/src/test/org/apache/lucene/search/CheckHits.java
Date Fri, 06 May 2005 15:40:00 GMT
Daniel,

When using the static TestCase methods
it is quite likely that the testCase attribute of CheckHits
can be removed completely. 
I suppose JUnit assumes a single thread for reporting
errors/failures of a test case?

Regards,
Paul Elschot


----------  Forwarded Message  ----------

Subject: svn commit: r168454 - /lucene/java/trunk/src/test/org/apache/lucene/
search/CheckHits.java
Date: Friday 06 May 2005 00:46
From: dnaber@apache.org
To: java-commits@lucene.apache.org

Author: dnaber
Date: Thu May  5 15:46:09 2005
New Revision: 168454

URL: http://svn.apache.org/viewcvs?rev=168454&view=rev
Log:
call static methods via class, not via object (avoids warning in Eclipse)

Modified:
    lucene/java/trunk/src/test/org/apache/lucene/search/CheckHits.java

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/CheckHits.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/src/test/org/apache/
lucene/search/CheckHits.java?rev=168454&r1=168453&r2=168454&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/CheckHits.java 
(original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/CheckHits.java Thu May  
5 15:46:09 2005
@@ -44,15 +44,15 @@
       actual.add(new Integer(hits.id(i)));
     }
 
-    testCase.assertEquals(query.toString(defaultFieldName), correct, actual);
+    TestCase.assertEquals(query.toString(defaultFieldName), correct, actual);
   }
 
   /** Tests that a Hits has an expected order of documents */
   public static void checkDocIds(String mes, int[] results, Hits hits, 
TestCase testCase)
   throws IOException {
-    testCase.assertEquals(mes + " nr of hits", results.length, 
hits.length());
+    TestCase.assertEquals(mes + " nr of hits", results.length, 
hits.length());
     for (int i = 0; i < results.length; i++) {
-      testCase.assertEquals(mes + " doc nrs for hit " + i, results[i], 
hits.id(i));
+      TestCase.assertEquals(mes + " doc nrs for hit " + i, results[i], 
hits.id(i));
     }
   }
 
@@ -73,7 +73,7 @@
     final float scoreTolerance = 1.0e-7f;
     for (int i = 0; i < results.length; i++) {
       if (Math.abs(hits1.score(i) -  hits2.score(i)) > scoreTolerance) {
-        testCase.fail("Hit " + i + ", doc nrs " + hits1.id(i) + " and " + 
hits2.id(i)
+        TestCase.fail("Hit " + i + ", doc nrs " + hits1.id(i) + " and " + 
hits2.id(i)
                       + "\nunequal scores: " + hits1.score(i)
                       + "\n           and: " + hits2.score(i)
                       + "\nfor query:" + query.toString());






-------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message