Apache Lucene open-source search software
Use getDataDir also for index backwards compatibility tests
Uwe Schindler5738583f3b51
diff --git a/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java b/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.javaindex 58225ee0fbe..9587d6494b1 100644--- a/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java+++ b/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java@@ -74,11 +74,11 @@ public class TestBackwardsCompatibility extends LuceneTestCase {}*/- /* Unzips dirName + ".zip" --> dirName, removing dirName+ /* Unzips zipName --> dirName, removing dirNamefirst */- public void unzip(String zipName, String destDirName) throws IOException {+ public void unzip(File zipName, String destDirName) throws IOException {- ZipFile zipFile = new ZipFile(zipName + ".zip");+ ZipFile zipFile = new ZipFile(zipName);Enumeration<? extends ZipEntry> entries = zipFile.entries();@@ -205,8 +205,7 @@ public class TestBackwardsCompatibility extends LuceneTestCase {int hasTested29 = 0;for(int i=0;i<oldNames.length;i++) {- String dirName = "src/test/org/apache/lucene/index/index." + oldNames[i];- unzip(dirName, oldNames[i]);+ unzip(getDataFile("index." + oldNames[i] + ".zip"), oldNames[i]);String fullPath = fullDir(oldNames[i]);Directory dir = FSDirectory.open(new File(fullPath));@@ -236,8 +235,7 @@ public class TestBackwardsCompatibility extends LuceneTestCase {public void testSearchOldIndex() throws IOException {for(int i=0;i<oldNames.length;i++) {- String dirName = "src/test/org/apache/lucene/index/index." + oldNames[i];- unzip(dirName, oldNames[i]);+ unzip(getDataFile("index." + oldNames[i] + ".zip"), oldNames[i]);searchIndex(oldNames[i], oldNames[i]);rmDir(oldNames[i]);}@@ -245,8 +243,7 @@ public class TestBackwardsCompatibility extends LuceneTestCase {public void testIndexOldIndexNoAdds() throws IOException {for(int i=0;i<oldNames.length;i++) {- String dirName = "src/test/org/apache/lucene/index/index." + oldNames[i];- unzip(dirName, oldNames[i]);+ unzip(getDataFile("index." + oldNames[i] + ".zip"), oldNames[i]);changeIndexNoAdds(oldNames[i]);rmDir(oldNames[i]);}@@ -254,8 +251,7 @@ public class TestBackwardsCompatibility extends LuceneTestCase {public void testIndexOldIndex() throws IOException {for(int i=0;i<oldNames.length;i++) {- String dirName = "src/test/org/apache/lucene/index/index." + oldNames[i];- unzip(dirName, oldNames[i]);+ unzip(getDataFile("index." + oldNames[i] + ".zip"), oldNames[i]);changeIndexWithAdds(oldNames[i]);rmDir(oldNames[i]);}