@Test
  public void testCloseAllClients() throws IOException, MetaException, LoginException {
    final HiveClientCache cache = new HiveClientCache(1000);
    HiveClientCache.ICacheableMetaStoreClient client1 = (HiveClientCache.ICacheableMetaStoreClient) cache.get(hiveConf);
    hiveConf.setVar(HiveConf.ConfVars.METASTORE_URIS, " "); // URIs are checked for string equivalence, even spaces make them different
    HiveClientCache.ICacheableMetaStoreClient client2 = (HiveClientCache.ICacheableMetaStoreClient) cache.get(hiveConf);
    cache.closeAllClientsQuietly();
    assertTrue(client1.isClosed());
    assertTrue(client2.isClosed());
  }
Check that a *new* client is created if asked from different threads even with
the same hive configuration
@throws ExecutionException
@throws InterruptedException
hcatalog/core/src/test/java/org/apache/hive/hcatalog/common/TestHiveClientCache.java