@Test
  public void testMasterLockAcquire() throws Exception {
    LockManager.MasterLock lock =
      masterServices.getLockManager().createMasterLock(namespace, LockType.EXCLUSIVE, "desc");
    assertTrue(lock.tryAcquire(2000));
    assertTrue(lock.getProc().isLocked());
    lock.release();
    assertEquals(null, lock.getProc());
  }
Tests that basic lock functionality works.
hbase-server/src/test/java/org/apache/hadoop/hbase/master/locking/TestLockManager.java