@AfterClass
  public static void tearDown() throws Exception {
    if(hiveConf != null && hiveConfBackup != null) {
      FileOutputStream fos = new FileOutputStream(new File(hiveConf.getHiveSiteLocation().toURI()));
      fos.write(hiveConfBackup);
      fos.close();
    }
    if (hiveserver2 != null) {
      hiveserver2.stop();
      hiveserver2 = null;
    }
    Thread.sleep(1000);
    LOG.info("hiveServer2 stop ......");
  }
An abstract implementation of TrustDomainAuthentication Test.
itests/hive-unit/src/test/java/org/apache/hive/service/auth/TrustDomainAuthenticationTest.java