You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2016/01/04 12:10:35 UTC
svn commit: r1722843 - in /lucene/dev/trunk: ./ lucene/ lucene/sandbox/
lucene/sandbox/src/test/org/apache/lucene/util/BaseGeoPointTestCase.java
Author: mikemccand
Date: Mon Jan 4 11:10:35 2016
New Revision: 1722843
URL: http://svn.apache.org/viewvc?rev=1722843&view=rev
Log:
LUCENE-6956: make sure specific test method fails, instead of relying on 'unhandled exc in thread' from test framework
Modified:
lucene/dev/trunk/ (props changed)
lucene/dev/trunk/lucene/ (props changed)
lucene/dev/trunk/lucene/sandbox/ (props changed)
lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/util/BaseGeoPointTestCase.java
Modified: lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/util/BaseGeoPointTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/util/BaseGeoPointTestCase.java?rev=1722843&r1=1722842&r2=1722843&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/util/BaseGeoPointTestCase.java (original)
+++ lucene/dev/trunk/lucene/sandbox/src/test/org/apache/lucene/util/BaseGeoPointTestCase.java Mon Jan 4 11:10:35 2016
@@ -496,7 +496,7 @@ public abstract class BaseGeoPointTestCa
private static abstract class VerifyHits {
- public void test(boolean small, IndexSearcher s, NumericDocValues docIDToID, Set<Integer> deleted, Query query, double[] lats, double[] lons) throws Exception {
+ public void test(AtomicBoolean failed, boolean small, IndexSearcher s, NumericDocValues docIDToID, Set<Integer> deleted, Query query, double[] lats, double[] lons) throws Exception {
int maxDoc = s.getIndexReader().maxDoc();
final FixedBitSet hits = new FixedBitSet(maxDoc);
s.search(query, new SimpleCollector() {
@@ -550,6 +550,7 @@ public abstract class BaseGeoPointTestCa
}
if (fail) {
+ failed.set(true);
fail("some hits were wrong");
}
}
@@ -754,7 +755,7 @@ public abstract class BaseGeoPointTestCa
System.out.println(" query=" + query);
}
- verifyHits.test(small, s, docIDToID, deleted, query, lats, lons);
+ verifyHits.test(failed, small, s, docIDToID, deleted, query, lats, lons);
}
}
}
@@ -768,6 +769,7 @@ public abstract class BaseGeoPointTestCa
thread.join();
}
IOUtils.close(r, dir);
+ assertFalse(failed.get());
}
protected Directory noVirusChecker(Directory dir) {