Use getDataDir also for index backwards compatibility tests

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@928243 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2010-03-27 18:34:21 +00:00
parent c3d2d45dca
commit 5738583f3b
1 changed files with 7 additions and 11 deletions

View File

@ -74,11 +74,11 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
}
*/
/* Unzips dirName + ".zip" --> dirName, removing dirName
/* Unzips zipName --> dirName, removing dirName
first */
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]);
}