From 2380a957efcb798576e6d7195c5b12d46d66f581 Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Tue, 6 Mar 2007 18:52:32 +0000 Subject: [PATCH] Fixing backwards compatibility unit test to make its test dirs under tempDir git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@515249 13f79535-47bb-0310-9956-ffa450edef68 --- .../index/TestBackwardsCompatibility.java | 46 +++++++++++++------ 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java b/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java index c2acac13898..8d3dc929b1a 100644 --- a/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java +++ b/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java @@ -43,15 +43,19 @@ public class TestBackwardsCompatibility extends TestCase /* Unzips dirName + ".zip" --> dirName, removing dirName first */ - public void unzip(String dirName) throws IOException { - rmDir(dirName); + public void unzip(String zipName, String destDirName) throws IOException { Enumeration entries; ZipFile zipFile; - zipFile = new ZipFile(dirName + ".zip"); + zipFile = new ZipFile(zipName + ".zip"); entries = zipFile.entries(); + + String dirName = fullDir(destDirName); + File fileDir = new File(dirName); + rmDir(dirName); + fileDir.mkdir(); while (entries.hasMoreElements()) { @@ -89,9 +93,9 @@ public class TestBackwardsCompatibility extends TestCase String[] oldNames = {"prelockless.cfs", "prelockless.nocfs"}; for(int i=0;i