@BeforeClass
  public static void onetimeSetup() throws Exception {
    HiveConf conf = new HiveConfForTest(TestViewEntity.class);
    conf
    .setVar(HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER,
        "org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory");
    conf.setVar(HiveConf.ConfVars.SEMANTIC_ANALYZER_HOOK,
        CheckInputReadEntity.class.getName());
    HiveConf
        .setBoolVar(conf, HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY, false);
    SessionState.start(conf);
    driver = new Driver(conf);
  }
Hook used in the test to capture the set of ReadEntities
ql/src/test/org/apache/hadoop/hive/ql/plan/TestViewEntity.java