mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
60596: Merged V4.2-BUG-FIX (4.2.2) to HEAD-BUG-FIX (Cloud/4.3) 60363: Merged DEV to V4.2-BUG-FIX (4.2.2) 58124: Added missing transaction(s) in SOLRTrackingComponentTest (MNT-9806) 58128: Added missing transaction(s) in MultiTDemoTest (MNT-9806) 58247: Added missing transaction(s) in TransferServiceToBeRefactoredTest. Fixed dozens of warnings as well. (MNT-9806) 58248: Added missing transaction(s) in WikiServiceImplTest. Fixed code warnings. (MNT-9806) 58249: Added missing transaction(s) in CalendarServiceImplTest. (MNT-9806) 58251: Added missing transaction(s) in NodeServiceTest. (MNT-9806) 58252: Added missing transaction(s) in LockDAOTest. (MNT-9806) 58253: Added missing transaction(s) in NodeDAOTest. (MNT-9806) 58257: Added missing transaction(s) in SOLRDAOTest. (MNT-9806) 58259: Added missing transaction(s) in ReplicationRestApiTest (MNT-9806) 58260: Added missing transaction(s) in RunningActionRestApiTest (MNT-9806) 58304: Added missing transaction(s) in UnlockMethodTest (MNT-9806) 58368: Added missing transaction(s) in UnlockMethodTest (MNT-9806) 58892: Added missing transaction(s) in NodeServiceTest (MNT-9806) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@62327 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -242,12 +242,20 @@ public class LockDAOTest extends TestCase
|
||||
|
||||
public void testReleaseLockRepeated() throws Exception
|
||||
{
|
||||
String token = lock(lockAAA, 500000L, true);
|
||||
final String token = lock(lockAAA, 500000L, true);
|
||||
release(lockAAA, token, true);
|
||||
release(lockAAA, token, false);
|
||||
try
|
||||
{
|
||||
lockDAO.releaseLock(lockAAA, token, false);
|
||||
transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Void>()
|
||||
{
|
||||
@Override
|
||||
public Void execute() throws Throwable
|
||||
{
|
||||
lockDAO.releaseLock(lockAAA, token, false);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
fail("Pessimistic lock release should have failed.");
|
||||
}
|
||||
catch (LockAcquisitionException e)
|
||||
@@ -256,7 +264,14 @@ public class LockDAOTest extends TestCase
|
||||
}
|
||||
try
|
||||
{
|
||||
boolean released = lockDAO.releaseLock(lockAAA, token, true);
|
||||
boolean released = transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Boolean>()
|
||||
{
|
||||
@Override
|
||||
public Boolean execute() throws Throwable
|
||||
{
|
||||
return lockDAO.releaseLock(lockAAA, token, true);
|
||||
}
|
||||
});
|
||||
// Expected
|
||||
assertFalse("Release should have been negative.", released);
|
||||
}
|
||||
|
Reference in New Issue
Block a user