public static List<Object[]> getMetaStores() throws Exception {
    List<Object[]> metaStores = new ArrayList<Object[]>();

    Configuration conf = MetastoreConf.newMetastoreConf();
    // set some values to use for getting conf. vars
    MetastoreConf.setBoolVar(conf, MetastoreConf.ConfVars.METRICS_ENABLED, true);
    MetastoreConf.setLongVar(conf, MetastoreConf.ConfVars.BATCH_RETRIEVE_MAX, 2);
    MetastoreConf.setLongVar(conf, MetastoreConf.ConfVars.BATCH_RETRIEVE_OBJECTS_MAX, 2);
    MetastoreConf.setLongVar(conf, MetastoreConf.ConfVars.LIMIT_PARTITION_REQUEST,
        DEFAULT_LIMIT_PARTITION_REQUEST);
    MetaStoreTestUtils.setConfForStandloneMode(conf);

    // Do this only on your own peril, and never in the production code
    conf.set("datanucleus.autoCreateTables", "false");

    // Example for using cluster configuration xml-s
    // -Dtest.hms.client.configs=/tmp/conf/core-site.xml,/tmp/conf/hive-site.xml
    String testHMSClientConfiguration = System.getProperty("test.hms.client.configs");
    if (testHMSClientConfiguration != null) {
      Configuration clusterConf = new Configuration(conf);
      // Loading the extra configuration options
      String[] configurationFiles = testHMSClientConfiguration.split(",");
      for(String configurationFile : configurationFiles) {
        clusterConf.addResource(new Path(configurationFile));
      }

      // Using MetaStore running in an existing cluster
      AbstractMetaStoreService cluster =
          new MiniHMS.Builder()
              .setConf(clusterConf)
              .setType(MiniHMS.MiniHMSType.CLUSTER)
              .build();
      metaStores.add(new Object[]{"Cluster", cluster});
    }

    // Create Embedded MetaStore
    conf.set("javax.jdo.option.ConnectionURL",
        "jdbc:derby:memory:${test.tmp.dir}/" + MetaStoreServerUtils.JUNIT_DATABASE_PREFIX
            + "1;create=true");
    MetastoreConf.setBoolVar(conf, MetastoreConf.ConfVars.TRY_DIRECT_SQL, false);
    AbstractMetaStoreService embedded =
        new MiniHMS.Builder()
            .setConf(conf)
            .setType(MiniHMS.MiniHMSType.EMBEDDED)
            .build();
    metaStores.add(new Object[] {"Embedded", embedded});

    // Create Remote MetaStore
    conf.set("javax.jdo.option.ConnectionURL",
        "jdbc:derby:memory:${test.tmp.dir}/" + MetaStoreServerUtils.JUNIT_DATABASE_PREFIX
        + "2;create=true");
    MetastoreConf.setBoolVar(conf, MetastoreConf.ConfVars.TRY_DIRECT_SQL, true);
    AbstractMetaStoreService remote =
        new MiniHMS.Builder()
            .setConf(conf)
            .setType(MiniHMS.MiniHMSType.REMOTE)
            .build();
    metaStores.add(new Object[] {"Remote", remote});

    return metaStores;
  }
We would like to run the tests with 2 MetaStore configurations
- Embedded - Where the MetaStore is running in the same thread, and does not use Thrift
- Remote - Where the MetaStore is started in a different thread, and uses Thrift for
communication

Or if the test.hms.client.configs system property is set, it would return a single test
MetaStoreService which uses these configs. In this case the MetaStore should be created
manually or by an external application.
@return The list of the test MetaStoreService implementations usable by @Parameterized
.Parameters
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/MetaStoreFactoryForTests.java