@Test
  public void testDropTableDeleteDir() throws Exception {
    Table table = testTables[0];
    Partition externalPartition = client.getPartition(partitionedTable.getDbName(),
        partitionedTable.getTableName(), "test_part_col=a2");

    client.dropTable(table.getDbName(), table.getTableName(), true, false);

    Assert.assertFalse("Table path should be removed",
        metaStore.isPathExists(new Path(table.getSd().getLocation())));

    table.unsetId();
    client.createTable(table);
    client.dropTable(table.getDbName(), table.getTableName(), false, false);

    Assert.assertTrue("Table path should be kept",
        metaStore.isPathExists(new Path(table.getSd().getLocation())));

    // Drop table with partitions
    client.dropTable(partitionedTable.getDbName(), partitionedTable.getTableName(), true, false);

    Assert.assertFalse("Table path should be removed",
        metaStore.isPathExists(new Path(partitionedTable.getSd().getLocation())));

    Assert.assertFalse("Extra partition path should be removed",
        metaStore.isPathExists(new Path(externalPartition.getSd().getLocation())));
  }
This test creates and queries a table and then drops it. Good for testing the happy path
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestTablesCreateDropAlterTruncate.java