@Override
  @Test
  public void testExchangePartition() throws Exception {
    Map<String, String> partitionSpecs = getPartitionSpec(getPartitions()[1]);
    Partition exchangedPartition =
        getClient().exchange_partition(partitionSpecs, getSourceTable().getDbName(),
            getSourceTable().getTableName(), getDestTable().getDbName(), getDestTable().getTableName());
    Assert.assertNotNull(exchangedPartition);
    checkExchangedPartitions(getSourceTable(), getDestTable(), Lists.newArrayList(getPartitions()[1]));
    checkRemainingPartitions(getSourceTable(), getDestTable(),
        Lists.newArrayList(getPartitions()[0], getPartitions()[2], getPartitions()[3], getPartitions()[4]));
  }
Test class for exchange partitions related methods on temporary tables.
ql/src/test/org/apache/hadoop/hive/ql/metadata/TestSessionHiveMetastoreClientExchangePartitionsTempTable.java