LUCENE-2598: use the specified -Dtests.directory when tests copy from an existing one too

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@988259 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2010-08-23 19:15:42 +00:00
parent 4e737ef56e
commit 707617ee02
2 changed files with 10 additions and 2 deletions

View File

@ -343,7 +343,11 @@ public abstract class LuceneTestCase extends TestCase {
public MockDirectoryWrapper newDirectory(Random r, Directory d) throws IOException {
StackTraceElement[] stack = new Exception().getStackTrace();
MockDirectoryWrapper dir = new MockDirectoryWrapper(new RAMDirectory(d));
Directory impl = LuceneTestCaseJ4.newDirectoryImpl(TEST_DIRECTORY);
for (String file : d.listAll()) {
d.copy(impl, file, file);
}
MockDirectoryWrapper dir = new MockDirectoryWrapper(impl);
stores.put(dir, stack);
return dir;
}

View File

@ -596,7 +596,11 @@ public class LuceneTestCaseJ4 {
public static MockDirectoryWrapper newDirectory(Random r, Directory d) throws IOException {
StackTraceElement[] stack = new Exception().getStackTrace();
MockDirectoryWrapper dir = new MockDirectoryWrapper(new RAMDirectory(d));
Directory impl = newDirectoryImpl(TEST_DIRECTORY);
for (String file : d.listAll()) {
d.copy(impl, file, file);
}
MockDirectoryWrapper dir = new MockDirectoryWrapper(impl);
stores.put(dir, stack);
return dir;
}