@Override
  protected void checkPartitionsAfterDelete(String tableName, List<Partition> droppedPartitions,
      List<Partition> existingPartitions, boolean deleteData, boolean purge) throws Exception {

    List<Partition> partitions = getClient().listPartitions(DB_NAME, tableName, MAX);
    Assert.assertEquals(
        "The table " + tableName + " has " + partitions.size() + " partitions, but it should have " + existingPartitions
            .size(), existingPartitions.size(), partitions.size());
    for (Partition droppedPartition : droppedPartitions) {
      Assert.assertFalse(partitions.contains(droppedPartition));
      Path partitionPath = new Path(droppedPartition.getSd().getLocation());
      if (deleteData) {
        Assert.assertFalse("The location '" + partitionPath.toString() + "' should not exist.",
            getMetaStore().isPathExists(partitionPath));
      } else {
        Assert.assertTrue("The location '" + partitionPath.toString() + "' should exist.",
            getMetaStore().isPathExists(partitionPath));
      }
    }

    for (Partition existingPartition : existingPartitions) {
      Assert.assertTrue(partitions.contains(existingPartition));
      Path partitionPath = new Path(existingPartition.getSd().getLocation());
      Assert.assertTrue("The location '" + partitionPath.toString() + "' should exist.",
          getMetaStore().isPathExists(partitionPath));
    }
  }
Test class for delete partitions related methods on temporary tables.
ql/src/test/org/apache/hadoop/hive/ql/metadata/TestSessionHiveMetastoreClientDropPartitionsTempTable.java