mirror of https://github.com/apache/lucene.git
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:
parent
11d65e5cb0
commit
5bb97b264e
|
@ -77,8 +77,7 @@ public class SimpleFSLockFactory extends FSLockFactory {
|
||||||
* @param lockDirName where lock files should be created.
|
* @param lockDirName where lock files should be created.
|
||||||
*/
|
*/
|
||||||
public SimpleFSLockFactory(String lockDirName) throws IOException {
|
public SimpleFSLockFactory(String lockDirName) throws IOException {
|
||||||
lockDir = new File(lockDirName);
|
setLockDir(new File(lockDirName));
|
||||||
setLockDir(lockDir);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Lock makeLock(String lockName) {
|
public Lock makeLock(String lockName) {
|
||||||
|
|
|
@ -260,6 +260,11 @@ public class TestLockFactory extends LuceneTestCase {
|
||||||
_TestUtil.rmDir(indexDirName);
|
_TestUtil.rmDir(indexDirName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testSimpleFSLockFactory() throws IOException {
|
||||||
|
// test string file instantiation
|
||||||
|
new SimpleFSLockFactory("test");
|
||||||
|
}
|
||||||
|
|
||||||
// Verify: setDisableLocks works
|
// Verify: setDisableLocks works
|
||||||
public void testDisableLocks() throws IOException {
|
public void testDisableLocks() throws IOException {
|
||||||
File indexDirName = _TestUtil.getTempDir("index.TestLockFactory4");
|
File indexDirName = _TestUtil.getTempDir("index.TestLockFactory4");
|
||||||
|
|
Loading…
Reference in New Issue