public static HiveServer create(
     Map<String, String> properties,
     File baseDir,
     File confDir,
     File logDir,
     String policyFile,
     FileSystem fileSystem)
     throws Exception {
   String type = properties.get(HiveServerFactory.HIVESERVER2_TYPE);
   if (type == null) {
     type = System.getProperty(HiveServerFactory.HIVESERVER2_TYPE);
   }
   if (type == null) {
     type = HiveServerFactory.HiveServer2Type.InternalHiveServer2.name();
   }
   hiveServer2Type = HiveServerFactory.HiveServer2Type.valueOf(type.trim());
   return HiveServerFactory.create(
       hiveServer2Type, properties, baseDir, confDir, logDir, policyFile, fileSystem);
 }
  @BeforeClass
  public static void setup() throws Exception {
    haEnabled = true;
    properties = new HashMap<String, String>();
    properties.put(
        HiveAuthzConf.AuthzConfVars.AUTHZ_ONFAILURE_HOOKS.getVar(),
        DummySentryOnFailureHook.class.getName());
    createContext();
    DummySentryOnFailureHook.invoked = false;

    // Do not run these tests if run with external HiveServer2
    // This test checks for a static member, which will not
    // be set if HiveServer2 and the test run in different JVMs
    String hiveServer2Type = System.getProperty(HiveServerFactory.HIVESERVER2_TYPE);
    if (hiveServer2Type != null) {
      Assume.assumeTrue(
          HiveServerFactory.isInternalServer(
              HiveServerFactory.HiveServer2Type.valueOf(hiveServer2Type.trim())));
    }
  }