From 11745211d36e87fabd3403bf46e8717fc724b01b Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Tue, 20 Oct 2015 14:29:03 +0000 Subject: [PATCH] LUCENE-6847: sidestep virus checkers until we can do LUCENE-6835 git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1709609 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/test/org/apache/lucene/bkdtree/TestBKDTree.java | 9 ++++++--- .../test/org/apache/lucene/rangetree/TestRangeTree.java | 9 ++++++--- .../org/apache/lucene/bkdtree3d/TestGeo3DPointField.java | 9 ++++++--- 3 files changed, 18 insertions(+), 9 deletions(-) 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()); + } }