@Test
  public void testDummyTxnManagerOnAcidTable() throws Exception {
    dropTable(new String[] {"T10", "T11"});
    // Create an ACID table with DbTxnManager
    driver.run("create table T10 (a int, b int) " +
        "clustered by(b) into 2 buckets stored as orc TBLPROPERTIES ('transactional'='true')");
    driver.run("create table T11 (a int, b int) clustered by(b) into 2 buckets stored as orc");

    // All DML should fail with DummyTxnManager on ACID table
    useDummyTxnManagerTemporarily(conf);
    try {
      driver.compileAndRespond("select * from T10", true);
      assert false;
    } catch (CommandProcessorException e) {
      Assert.assertEquals(ErrorMsg.TXNMGR_NOT_ACID.getErrorCode(), e.getResponseCode());
      Assert.assertTrue(e.getMessage().contains("This command is not allowed on an ACID table"));
    }

    useDummyTxnManagerTemporarily(conf);
    try {
      driver.compileAndRespond("insert into table T10 values (1, 2)", true);
    } catch (CommandProcessorException e) {
      Assert.assertEquals(ErrorMsg.TXNMGR_NOT_ACID.getErrorCode(), e.getResponseCode());
      Assert.assertTrue(e.getMessage().contains("This command is not allowed on an ACID table"));
    }

    useDummyTxnManagerTemporarily(conf);
    try {
      driver.compileAndRespond("update T10 set a=0 where b=1", true);
    } catch (CommandProcessorException e) {
      Assert.assertEquals(ErrorMsg.ACID_OP_ON_NONACID_TXNMGR.getErrorCode(), e.getResponseCode());
      Assert.assertTrue(e.getMessage().contains(
          "Attempt to do update or delete using transaction manager that does not support these operations."));
    }

    useDummyTxnManagerTemporarily(conf);
    try {
      driver.compileAndRespond("delete from T10", true);
    } catch (CommandProcessorException e) {
      Assert.assertEquals(ErrorMsg.ACID_OP_ON_NONACID_TXNMGR.getErrorCode(), e.getResponseCode());
      Assert.assertTrue(e.getMessage().contains(
          "Attempt to do update or delete using transaction manager that does not support these operations."));
    }
    conf.setVar(HiveConf.ConfVars.HIVE_TXN_MANAGER, "org.apache.hadoop.hive.ql.lockmgr.DbTxnManager");
  }
check that locks in Waiting state show what they are waiting on
This test is somewhat abusive in that it make DbLockManager retain locks for 2
different queries (which are not part of the same transaction) which can never
happen in real use cases... but it makes testing convenient.
ql/src/test/org/apache/hadoop/hive/ql/lockmgr/TestDbTxnManager2.java