@SuppressWarnings("deprecation")
  private void assertPartitionRollback(List<Partition> oldParts, List<Partition> alterParts) throws TException {
    try {
      getClient().alter_partitions(DB_NAME, TABLE_NAME, alterParts);
    } catch (MetaException | InvalidOperationException e) {
      assertEquals(oldParts, getClient().listPartitions(DB_NAME, TABLE_NAME, (short) -1));
      return;
    }
    fail("Exception should have been thrown.");
  }
Test class for alter/rename partitions related methods on temporary tables.
ql/src/test/org/apache/hadoop/hive/ql/metadata/TestSessionHiveMetastoreClientAlterPartitionsTempTable.java