@Before
  public void createObjectStore() throws MetaException, InvalidOperationException {
    conf = MetastoreConf.newMetastoreConf();
    MetastoreConf.setBoolVar(conf, MetastoreConf.ConfVars.HIVE_IN_TEST, true);
    MetaStoreTestUtils.setConfForStandloneMode(conf);
    objectStore = new ObjectStore();
    objectStore.setConf(conf);

    // Create three catalogs
    HMSHandler.createDefaultCatalog(objectStore, new Warehouse(conf));

    Catalog cat1 = new CatalogBuilder()
        .setName(CAT1_NAME)
        .setLocation("/tmp/cat1")
        .build();
    objectStore.createCatalog(cat1);
    Catalog cat2 = new CatalogBuilder()
        .setName(CAT2_NAME)
        .setLocation("/tmp/cat2")
        .build();
    objectStore.createCatalog(cat2);
  }
Tests that catalogs are properly cached.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/cache/TestCatalogCaching.java