LUCENE-1905: fix bug when instantiating SimpleFSLockFacory with a String and add test

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@813154 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2009-09-09 22:50:24 +00:00
parent 11d65e5cb0
commit 5bb97b264e
2 changed files with 6 additions and 2 deletions

View File

@ -77,8 +77,7 @@ public class SimpleFSLockFactory extends FSLockFactory {
* @param lockDirName where lock files should be created.
*/
public SimpleFSLockFactory(String lockDirName) throws IOException {
lockDir = new File(lockDirName);
setLockDir(lockDir);
setLockDir(new File(lockDirName));
}
public Lock makeLock(String lockName) {

View File

@ -259,6 +259,11 @@ public class TestLockFactory extends LuceneTestCase {
// Cleanup
_TestUtil.rmDir(indexDirName);
}
public void testSimpleFSLockFactory() throws IOException {
// test string file instantiation
new SimpleFSLockFactory("test");
}
// Verify: setDisableLocks works
public void testDisableLocks() throws IOException {