@Before
  public void setUp() throws Exception {
    initHiveConf();
    SessionState.start(conf);
    QueryState queryState = QueryState.getNewQueryState(conf, new LineageState());
    queryState.createHMSCache();
    SessionState.get().addQueryState(queryState.getQueryId(), queryState);
    // setup metastore client cache
    if (conf.getBoolVar(HiveConf.ConfVars.MSC_CACHE_ENABLED)) {
      HiveMetaStoreClientWithLocalCache.init(conf);
    }
    setClient(Hive.get(conf).getMSC());
    getClient().dropDatabase(DB_NAME, true, true, true);
    getMetaStore().cleanWarehouseDirs();
  }
Test class for list partitions related methods on temporary tables.
ql/src/test/org/apache/hadoop/hive/ql/metadata/TestSessionHiveMetastoreClientListPartitionsTempTable.java