@Test
  public void testServerConfigsEmbeddedMetastore() throws IOException, Throwable {

    // set hive-site.xml to default hive-site.xml that has embedded metastore
    HiveConf.setHiveSiteLocation(oldDefaultHiveSite);

    HiveConf conf = new HiveConf();

    // check config properties expected with embedded metastore client
    assertTrue(HiveConf.isLoadMetastoreConfig());
    assertEquals("from.hivemetastore-site.xml",
        conf.get("hive.dummyparam.test.server.specific.config.override"));

    assertEquals("from.hivemetastore-site.xml",
        conf.get("hive.dummyparam.test.server.specific.config.metastoresite"));

    assertEquals("from.hive-site.xml",
        conf.get("hive.dummyparam.test.server.specific.config.hivesite"));

    // verify that hiveserver2 config is not loaded
    assertFalse(HiveConf.isLoadHiveServer2Config());
    assertNull(conf.get("hive.dummyparam.test.server.specific.config.hiveserver2site"));

    // check if hiveserver2 config gets loaded when HS2 is started
    new HiveServer2();
    conf = new HiveConf();
    verifyHS2ConfParams(conf);

    assertEquals("from.hivemetastore-site.xml",
        conf.get("hive.dummyparam.test.server.specific.config.metastoresite"));
  }
Verify if appropriate server configuration (metastore, hiveserver2) get
loaded when the embedded clients are loaded

Checks values used in the configs used for testing.

@throws IOException
@throws Throwable
itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/TestServerSpecificConfig.java