@Override
  protected void addPartitions(IMetaStoreClient client, Table table, List<String> values) throws Exception {
    List<Partition> partitions = new ArrayList<>();
    for (int i = 0; i < values.size(); i++) {
      partitions.add(new PartitionBuilder().inTable(table)
          .addValue(values.get(i))
          .setLocation(MetaStoreTestUtils.getTestWarehouseDir(values.get(i) + i))
          .build(conf));
    }
    client.add_partitions(partitions);
  }
Test class for alter/rename partitions related methods on temporary tables.
ql/src/test/org/apache/hadoop/hive/ql/metadata/TestSessionHiveMetastoreClientAlterPartitionsTempTable.java