protected static void setup() throws Exception {
    System.err.println("Running with remoteMode = " + isRemoteMetastoreMode);
    System.setProperty("hive.metastore.pre.event.listeners",
        AuthorizationPreEventListener.class.getName());
    System.setProperty("hive.security.metastore.authorization.manager",
        MetaStoreAuthzAPIAuthorizerEmbedOnly.class.getName());

    hiveConf = new HiveConf();
    if (isRemoteMetastoreMode) {
      MetaStoreTestUtils.startMetaStoreWithRetry(hiveConf);
    }
    hiveConf.setIntVar(HiveConf.ConfVars.METASTORE_THRIFT_CONNECTION_RETRIES, 3);
    hiveConf.set(HiveConf.ConfVars.PRE_EXEC_HOOKS.varname, "");
    hiveConf.set(HiveConf.ConfVars.POST_EXEC_HOOKS.varname, "");
    hiveConf.set(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY.varname, "false");

    msc = new HiveMetaStoreClient(hiveConf);

  }
Test case for {@link MetaStoreAuthzAPIAuthorizerEmbedOnly} The authorizer is
supposed to allow api calls for metastore in embedded mode while disallowing
them in remote metastore mode. Note that this is an abstract class, the
subclasses that set the mode and the tests here get run as part of their
testing.
itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/AbstractTestAuthorizationApiAuthorizer.java