@BeforeClass
  public static void setUp() throws Exception {
    hiveConf = new HiveConf(TestHiveRemote.class);
    //TODO: HIVE-28289: TestHive/TestHiveRemote to run on Tez
    hiveConf.setVar(HiveConf.ConfVars.HIVE_EXECUTION_ENGINE, "mr");
    hiveConf.setVar(HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER,
        "org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory");
    hiveConf.setBoolVar(HiveConf.ConfVars.FIRE_EVENTS_FOR_DML, true);
    MetastoreConf.setVar(hiveConf, MetastoreConf.ConfVars.EVENT_LISTENERS, DummyFireInsertListener.class.getName());
    MetaStoreTestUtils.startMetaStoreWithRetry(hiveConf);
  }
Start a remote metastore and initialize a Hive object pointing at it.
ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHiveRemote.java