@Test
  public void testLockingOnInsertOverwriteNonNativeTables() throws Exception {
    dropTable(new String[] {"tab_not_acid"});
    driver.run("create table if not exists tab_not_acid (a int, b int)  " +
        " STORED BY 'org.apache.hadoop.hive.ql.metadata.StorageHandlerMock'");
    txnMgr.openTxn(ctx, "T1");
    driver.compileAndRespond("insert overwrite table tab_not_acid values(1,2)", true);
    txnMgr.acquireLocks(driver.getPlan(), ctx, "T1");
    List<ShowLocksResponseElement> locks = getLocks(txnMgr);
    Assert.assertEquals("Unexpected lock count", 1, locks.size());
    TestTxnDbUtil.checkLock(LockType.EXCLUSIVE, LockState.ACQUIRED, "default", "tab_not_acid", null, locks);
    txnMgr.rollbackTxn();
    dropTable(new String[] {"tab_not_acid"});
  }
Check to make sure we acquire proper locks for queries involving non-strict locking
ql/src/test/org/apache/hadoop/hive/ql/lockmgr/TestDbTxnManager2.java