disable virus checker for geo tests

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1710016 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2015-10-22 13:41:27 +00:00
parent 5969426d82
commit af3a54ad0b
2 changed files with 10 additions and 8 deletions

View File

@ -198,14 +198,7 @@ public class TestBKDTree extends BaseGeoPointTestCase {
return new BKDTreeDocValuesFormat(maxPointsInLeaf, maxPointsSortInHeap);
}
private static Directory noVirusChecker(Directory dir) {
if (dir instanceof MockDirectoryWrapper) {
((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
}
return dir;
}
private static Directory getDirectory() {
private Directory getDirectory() {
return noVirusChecker(newDirectory());
}
}

View File

@ -45,6 +45,7 @@ import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.SimpleCollector;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.MockDirectoryWrapper;
import org.junit.BeforeClass;
// TODO: cutover TestGeoUtils too?
@ -562,6 +563,7 @@ public abstract class BaseGeoPointTestCase extends LuceneTestCase {
} else {
dir = newDirectory();
}
noVirusChecker(dir);
Set<Integer> deleted = new HashSet<>();
// RandomIndexWriter is too slow here:
@ -755,5 +757,12 @@ public abstract class BaseGeoPointTestCase extends LuceneTestCase {
}
IOUtils.close(r, dir);
}
protected Directory noVirusChecker(Directory dir) {
if (dir instanceof MockDirectoryWrapper) {
((MockDirectoryWrapper) dir).setEnableVirusScanner(false);
}
return dir;
}
}