@Test
public void testHiveConfFactory() throws Exception {
HiveConf hiveConf = HiveConfFactory.get(Optional.absent(), SharedResourcesBrokerFactory.getImplicitBroker());
HiveConf hiveConf1 = HiveConfFactory.get(Optional.absent(), SharedResourcesBrokerFactory.getImplicitBroker());
Assert.assertEquals(hiveConf, hiveConf1);
Assert.assertTrue(hiveConf.getVar(METASTOREURIS).equals("file:///test"));
Assert.assertTrue(hiveConf.get(HIVE_METASTORE_TOKEN_SIGNATURE).equals("file:///test"));
HiveConf hiveConf2 = HiveConfFactory.get(Optional.of("hcat1"), SharedResourcesBrokerFactory.getImplicitBroker());
HiveConf hiveConf3 = HiveConfFactory.get(Optional.of("hcat1"), SharedResourcesBrokerFactory.getImplicitBroker());
Assert.assertEquals(hiveConf2, hiveConf3);
HiveConf hiveConf4 = HiveConfFactory.get(Optional.of("hcat11"), SharedResourcesBrokerFactory.getImplicitBroker());
Assert.assertNotEquals(hiveConf3, hiveConf4);
Assert.assertNotEquals(hiveConf4, hiveConf);
Assert.assertEquals(hiveConf3.getVar(METASTOREURIS), "hcat1");
Assert.assertEquals(hiveConf3.get(HIVE_METASTORE_TOKEN_SIGNATURE), "hcat1");
Assert.assertEquals(hiveConf4.getVar(METASTOREURIS), "hcat11");
Assert.assertEquals(hiveConf4.get(HIVE_METASTORE_TOKEN_SIGNATURE), "hcat11");
}
}