@BeforeClass
  public static void setUpTestDataDir() throws Exception {
    LOG.info("Using warehouse directory " + TEST_WAREHOUSE_DIR);
    File f = new File(TEST_WAREHOUSE_DIR);
    if (f.exists()) {
      FileUtil.fullyDelete(f);
    }
    Assert.assertTrue(new File(TEST_WAREHOUSE_DIR).mkdirs());
  }
Simplify writing HCatalog tests that require a HiveMetaStore.
hcatalog/core/src/test/java/org/apache/hive/hcatalog/mapreduce/HCatBaseTest.java