Removed concurrency lock methods from LockStore and implementations (ALF-20031)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@56052 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Matt Ward
2013-09-26 16:29:02 +00:00
parent 1a339d90db
commit e0ff9648ae
4 changed files with 1 additions and 134 deletions

View File

@@ -154,46 +154,4 @@ public abstract class AbstractLockStoreTestBase<T extends LockStore>
assertEquals(nodeRef3, it.next());
assertEquals(nodeRef4, it.next());
}
@Test()
public void whenTryLockFailsTransactionWillRetry() throws InterruptedException
{
final NodeRef nodeRef = new NodeRef("workspace://SpacesStore/whenTryLockFailsTransactionWillRetry");
// The "other" thread, that got there first and took the lock.
Thread thread = new Thread(getClass().getSimpleName()+"-testTryLock")
{
@Override
public void run()
{
try
{
// Deliberately NOT releasing this lock, so we can check for tryLock failure.
lockStore.acquireConcurrencyLock(nodeRef);
}
catch (Throwable e)
{
// This shouldn't happen the first time.
fail("Failed to a acquire lock");
}
}
};
thread.start();
// Wait for the other thread to perform the lock.
thread.join();
// Second attempt will fail (already locked above), expected exception
// must be thrown for retrying behaviour to work correctly.
try
{
lockStore.acquireConcurrencyLock(nodeRef);
fail("Exception was not thrown when unable to acquire lock.");
}
catch (LockTryException e)
{
// Good, we got the correct exception.
}
}
}