@Test(expected=MetaException.class)
  @ConditionalIgnoreOnSessionHiveMetastoreClient
  public void testAddPartitionSpecForView() throws Exception {

    String tableName = "test_add_partition_view";
    createView(tableName);
    Partition partition = buildPartition(DB_NAME, tableName, DEFAULT_YEAR_VALUE);
    PartitionSpecProxy partitionSpecProxy =
        buildPartitionSpec(DB_NAME, tableName, null, Lists.newArrayList(partition));
    client.add_partitions_pspec(partitionSpecProxy);
  }
Tests for creating partitions from partition spec.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestAddPartitionsFromPartSpec.java