@Test
  public void testDropTableExternalWithoutPurge() throws Exception {
    Table table = externalTable;

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

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

    Table newTable = table.deepCopy();
    newTable.setTableName("external_table_for_purge");
    newTable.getSd().setLocation(metaStore.getWarehouseRoot() + "/external/purge_table_dir");
    newTable.getParameters().put("external.table.purge", "true");

    client.createTable(newTable);
    client.dropTable(newTable.getDbName(), newTable.getTableName(), true, true, false);

    Assert.assertFalse("Table path should be removed",
        metaStore.isPathExists(new Path(newTable.getSd().getLocation())));
    Assert.assertTrue("Table path should be in trash",
        metaStore.isPathExistsInTrash(new Path(newTable.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