}
@Test(dataProvider = "writeLockNameProvider")
public void testLuceneIndexLocking(final String writeLockProvider) throws IOException {
final String commonIndexName = "myIndex";
LockFactory lockManagerA = makeLockFactory(cache(0,"lucene"), commonIndexName);
LockFactory lockManagerB = makeLockFactory(cache(1, "lucene"), commonIndexName);
LockFactory isolatedLockManager = makeLockFactory(cache(0, "lucene"), "anotherIndex");
Lock luceneLockA = lockManagerA.makeLock(writeLockProvider);
Lock luceneLockB = lockManagerB.makeLock(writeLockProvider);
Lock anotherLock = isolatedLockManager.makeLock(writeLockProvider);
assert luceneLockA.obtain();
assert luceneLockB.isLocked();
assert ! anotherLock.isLocked();
assert ! luceneLockA.obtain();