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

    createTable();
    Partition partition = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE);
    PartitionSpecProxy partitionSpecProxy =
        buildPartitionSpec(DB_NAME, null, 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