@Test
  public void testAlterPartitionsCheckRollbackUnknownPartition() throws Exception {
    createTable4PartColsParts(getClient());
    Table table = getClient().getTable(DB_NAME, TABLE_NAME);
    Partition newPart1 =
        new PartitionBuilder().inTable(table).addValue("1111").addValue("1111").addValue("11").build(conf);
    List<Partition> oldPartitions = getClient().listPartitions(DB_NAME, TABLE_NAME, (short) -1);
    Partition newPart2 = new Partition(oldPartitions.get(0));
    makeTestChangesOnPartition(newPart2);
    assertPartitionRollback(oldPartitions, Lists.newArrayList(newPart2, newPart1));
  }
Test class for alter/rename partitions related methods on temporary tables.
ql/src/test/org/apache/hadoop/hive/ql/metadata/TestSessionHiveMetastoreClientAlterPartitionsTempTable.java