Source:
<code>public void checkAcquireLockFailure() { assertTrue(LockManagerFactory.getLockManager().acquireLock(updateLock1).getFirst()); assertFalse(LockManagerFactory.getLockManager().acquireLock(lockLock1).getFirst()); LockManagerFactory.getLockManager().releaseLock(updateLock1); assertTrue(LockManagerFactory.getLockManager().acquireLock(lockLock1).getFirst()); LockManagerFactory.getLockManager().releaseLock(lockLock1); assertTrue(LockManagerFactory.getLockManager().acquireLock(updateAndLockLock).getFirst()); Pair<Boolean, Set<String>> lockResult = LockManagerFactory.getLockManager().acquireLock(lockLock1); assertFalse(lockResult.getFirst()); assertTrue(lockResult.getSecond().contains(ERROR1)); assertEquals(lockResult.getSecond().size(), 1); lockResult = LockManagerFactory.getLockManager().acquireLock(updateLock2); assertFalse(lockResult.getFirst()); <START> assertTrue(lockResult.getSecond().contains(ERROR2)); <END> assertEquals(lockResult.getSecond().size(), 1); LockManagerFactory.getLockManager().releaseLock(updateAndLockLock); assertTrue(LockManagerFactory.getLockManager().acquireLock(lockLock1).getFirst()); assertTrue(LockManagerFactory.getLockManager().acquireLock(updateLock2).getFirst()); LockManagerFactory.getLockManager().releaseLock(lockLock1); LockManagerFactory.getLockManager().releaseLock(updateLock2); }</code><technical_language>good if write a test case for shared lock failure resulting in more error messages. understand part of functionality better</technical_language>

Target:
public void checkAcquireLockFailure() { assertTrue(LockManagerFactory.getLockManager().acquireLock(updateLock1).getFirst()); assertFalse(LockManagerFactory.getLockManager().acquireLock(lockLock1).getFirst()); LockManagerFactory.getLockManager().releaseLock(updateLock1); assertTrue(LockManagerFactory.getLockManager().acquireLock(lockLock1).getFirst()); LockManagerFactory.getLockManager().releaseLock(lockLock1); assertTrue(LockManagerFactory.getLockManager().acquireLock(updateAndLockLock).getFirst()); Pair<Boolean, Set<String>> lockResult = LockManagerFactory.getLockManager().acquireLock(lockLock1); assertFalse(lockResult.getFirst()); assertTrue(lockResult.getSecond().contains(ERROR1)); assertEquals(lockResult.getSecond().size(), 1); lockResult = LockManagerFactory.getLockManager().acquireLock(updateLock2); assertFalse(lockResult.getFirst()); assertTrue(lockResult.getSecond().contains(ERROR2)); assertEquals(lockResult.getSecond().size(), 1); LockManagerFactory.getLockManager().releaseLock(updateAndLockLock); assertTrue(LockManagerFactory.getLockManager().acquireLock(lockLock1).getFirst()); assertTrue(LockManagerFactory.getLockManager().acquireLock(updateLock2).getFirst()); LockManagerFactory.getLockManager().releaseLock(lockLock1); LockManagerFactory.getLockManager().releaseLock(updateLock2); assertTrue(LockManagerFactory.getLockManager().acquireLock(updateAndLockLock).getFirst()); assertTrue(LockManagerFactory.getLockManager().acquireLock(updateLock3).getFirst()); lockResult = LockManagerFactory.getLockManager().acquireLock(failLockLock); assertFalse(lockResult.getFirst()); assertTrue(lockResult.getSecond().contains(ERROR1)); assertTrue(lockResult.getSecond().contains(ERROR3)); assertEquals(lockResult.getSecond().size(), 2); LockManagerFactory.getLockManager().releaseLock(updateAndLockLock); LockManagerFactory.getLockManager().releaseLock(updateLock3); }