diff --git a/lucene/sandbox/src/test/org/apache/lucene/bkdtree/TestBKDTree.java b/lucene/sandbox/src/test/org/apache/lucene/bkdtree/TestBKDTree.java index 25cf24108b6..ecde513d7bd 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/bkdtree/TestBKDTree.java +++ b/lucene/sandbox/src/test/org/apache/lucene/bkdtree/TestBKDTree.java @@ -377,7 +377,7 @@ public class TestBKDTree extends LuceneTestCase { iwc.setCodec(codec); Directory dir; if (lats.length > 100000) { - dir = newFSDirectory(createTempDir("TestBKDTree")); + dir = noVirusChecker(newFSDirectory(createTempDir("TestBKDTree"))); } else { dir = getDirectory(); } @@ -634,11 +634,14 @@ public class TestBKDTree extends LuceneTestCase { return new BKDTreeDocValuesFormat(maxPointsInLeaf, maxPointsSortInHeap); } - private static Directory getDirectory() { - Directory dir = newDirectory(); + private static Directory noVirusChecker(Directory dir) { if (dir instanceof MockDirectoryWrapper) { ((MockDirectoryWrapper) dir).setEnableVirusScanner(false); } return dir; } + + private static Directory getDirectory() { + return noVirusChecker(newDirectory()); + } } diff --git a/lucene/sandbox/src/test/org/apache/lucene/rangetree/TestRangeTree.java b/lucene/sandbox/src/test/org/apache/lucene/rangetree/TestRangeTree.java index c535204363e..54dcf6dba0a 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/rangetree/TestRangeTree.java +++ b/lucene/sandbox/src/test/org/apache/lucene/rangetree/TestRangeTree.java @@ -369,7 +369,7 @@ public class TestRangeTree extends LuceneTestCase { iwc.setCodec(codec); Directory dir; if (values.length > 100000) { - dir = newFSDirectory(createTempDir("TestRangeTree")); + dir = noVirusChecker(newFSDirectory(createTempDir("TestRangeTree"))); } else { dir = getDirectory(); } @@ -768,11 +768,14 @@ public class TestRangeTree extends LuceneTestCase { return new RangeTreeDocValuesFormat(maxPointsInLeaf, maxPointsSortInHeap); } - private static Directory getDirectory() { - Directory dir = newDirectory(); + private static Directory noVirusChecker(Directory dir) { if (dir instanceof MockDirectoryWrapper) { ((MockDirectoryWrapper) dir).setEnableVirusScanner(false); } return dir; } + + private static Directory getDirectory() { + return noVirusChecker(newDirectory()); + } } diff --git a/lucene/spatial3d/src/test/org/apache/lucene/bkdtree3d/TestGeo3DPointField.java b/lucene/spatial3d/src/test/org/apache/lucene/bkdtree3d/TestGeo3DPointField.java index b8cc65178b1..a3f96078afe 100644 --- a/lucene/spatial3d/src/test/org/apache/lucene/bkdtree3d/TestGeo3DPointField.java +++ b/lucene/spatial3d/src/test/org/apache/lucene/bkdtree3d/TestGeo3DPointField.java @@ -923,7 +923,7 @@ public class TestGeo3DPointField extends LuceneTestCase { iwc.setCodec(codec); Directory dir; if (lats.length > 100000) { - dir = newFSDirectory(createTempDir("TestBKDTree")); + dir = noVirusChecker(newFSDirectory(createTempDir("TestBKDTree"))); } else { dir = getDirectory(); } @@ -1061,11 +1061,14 @@ public class TestGeo3DPointField extends LuceneTestCase { IOUtils.close(r, dir); } - private static Directory getDirectory() { - Directory dir = newDirectory(); + private static Directory noVirusChecker(Directory dir) { if (dir instanceof MockDirectoryWrapper) { ((MockDirectoryWrapper) dir).setEnableVirusScanner(false); } return dir; } + + private static Directory getDirectory() { + return noVirusChecker(newDirectory()); + } }