private void checkPartitionNames(List<String> expected, short numParts, String order,
      String defaultPartName, ExprNodeGenericFuncDesc expr, Table t) throws Exception {
    PartitionsByExprRequest request = new PartitionsByExprRequest();
    request.setDbName(DB_NAME);
    request.setTblName(TABLE_NAME);
    byte[] exprs = {(byte)-1};
    if (expr != null) {
      exprs = SerializationUtilities.serializeObjectWithTypeInformation(expr);
    }
    request.setExpr(exprs);
    request.setMaxParts(numParts);
    request.setOrder(order);
    request.setDefaultPartitionName(defaultPartName);
    request.setId(t.getId());
    List<String> partitionNames = getClient().listPartitionNames(request);
    assertArrayEquals(expected.toArray(), partitionNames.toArray());
  }
Test class for list partitions related methods on temporary tables.
ql/src/test/org/apache/hadoop/hive/ql/metadata/TestSessionHiveMetastoreClientListPartitionsTempTable.java