@Test
  public void testTruncateTablePartitionedDeleteAll() throws Exception {
    // Partitioned table - delete all
    client.truncateTable(partitionedTable.getDbName(), partitionedTable.getTableName(), null);
    Assert.assertTrue("Location should exist",
        metaStore.isPathExists(new Path(testTables[0].getSd().getLocation())));
    List<Partition> partitions =
        client.listPartitions(partitionedTable.getDbName(), partitionedTable.getTableName(),
            (short)-1);
    for(Partition partition : partitions) {
      Path dataFile = new Path(partition.getSd().getLocation() + "/dataFile");
      Assert.assertFalse("Every dataFile should be removed", metaStore.isPathExists(dataFile));
    }
  }
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