@Test public void testKillQueryByIdAdmin() throws Exception {
    ExceptionHolder tExecuteHolder = new ExceptionHolder();
    ExceptionHolder tKillHolder = new ExceptionHolder();
    testKillQueryInternal("user1", System.getProperty("user.name"), false, tExecuteHolder, tKillHolder);
    assertNotNull("tExecute", tExecuteHolder.throwable);
    assertEquals(HiveStatement.QUERY_CANCELLED_MESSAGE + " " + KillQueriesOperation.KILL_QUERY_MESSAGE,
        tExecuteHolder.throwable.getMessage());
    assertNull("tCancel", tKillHolder.throwable);
  }
Test CLI kill command of a query that is running.
We spawn 2 threads - one running the query and
the other attempting to cancel.
We're using a dummy udf to simulate a query,
that runs for a sufficiently long time.
@throws Exception
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestKillQueryWithAuthorizationDisabled.java