@Test
  public void testBasicImpersonation() throws ParseException, Exception {

    setupAuthorization();

    runAsUser("user1", "create table t1 (a integer)");
    try {
      runAsUser("user2", "drop table t1");
      fail("Exception expected");
    } catch (CommandProcessorException cpe) {
      assertThat(cpe.getMessage(), Matchers.containsString("HiveAccessControlException Permission denied"));
    }
    runAsUser("user1", "drop table t1");
  }
ScheduledQuery integration test.

Checks for more complex scenarios; like impersonation works when scheduled queries are executed.
itests/hive-unit/src/test/java/org/apache/hadoop/hive/schq/TestScheduledQueryIntegration.java