mirror of
https://github.com/apache/lucene.git
synced 2025-03-03 23:09:36 +00:00
LUCENE-2804: fix newFSDirectory so the tests work with -Dtests.directory=RAMDirectory
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1049413 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7065133f3a
commit
c541f29f7e
@ -773,6 +773,11 @@ public abstract class LuceneTestCase extends Assert {
|
|||||||
} catch (ClassCastException e) {
|
} catch (ClassCastException e) {
|
||||||
// TEST_DIRECTORY is not a sub-class of FSDirectory, so draw one at random
|
// TEST_DIRECTORY is not a sub-class of FSDirectory, so draw one at random
|
||||||
fsdirClass = FS_DIRECTORIES[random.nextInt(FS_DIRECTORIES.length)];
|
fsdirClass = FS_DIRECTORIES[random.nextInt(FS_DIRECTORIES.length)];
|
||||||
|
|
||||||
|
if (fsdirClass.indexOf(".") == -1) {// if not fully qualified, assume .store
|
||||||
|
fsdirClass = "org.apache.lucene.store." + fsdirClass;
|
||||||
|
}
|
||||||
|
|
||||||
clazz = Class.forName(fsdirClass).asSubclass(FSDirectory.class);
|
clazz = Class.forName(fsdirClass).asSubclass(FSDirectory.class);
|
||||||
}
|
}
|
||||||
MockDirectoryWrapper dir = new MockDirectoryWrapper(random, newFSDirectoryImpl(clazz, f, lf));
|
MockDirectoryWrapper dir = new MockDirectoryWrapper(random, newFSDirectoryImpl(clazz, f, lf));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user