@Test
  public void dropPartition() throws Exception {
    String dbName = "default";
    String tableName = "hcatdropparttable";
    String partColName = "pc";
    HCatTable table = new HCatTable(dbName, tableName);
    table.partCol(new HCatFieldSchema(partColName, TypeInfoFactory.stringTypeInfo, ""));
    table.cols(Arrays.asList(new HCatFieldSchema("onecol", TypeInfoFactory.stringTypeInfo, "")));
    hCatClient.createTable(HCatCreateTableDesc.create(table).build());
    String partName = "testpart";
    Map<String, String> partSpec = new HashMap<String, String>(1);
    partSpec.put(partColName, partName);
    hCatClient.addPartition(
        HCatAddPartitionDesc.create(
            new HCatPartition(table, partSpec, null)
        ).build()
    );
    hCatClient.dropPartitions(dbName, tableName, partSpec, false);

    List<HCatNotificationEvent> events = hCatClient.getNextNotification(firstEventId, 0, null);
    assertEquals(3, events.size());

    HCatNotificationEvent event = events.get(2);
    assertEquals(firstEventId + 3, event.getEventId());
    assertTrue(event.getEventTime() >= startTime);
    assertEquals(HCatConstants.HCAT_DROP_PARTITION_EVENT, event.getEventType());
    assertEquals(dbName, event.getDbName());
    assertEquals(tableName, event.getTableName());

    // Parse the message field
    DropPartitionMessage dropPartitionMessage = md.getDropPartitionMessage(event.getMessage());
    assertEquals(dbName, dropPartitionMessage.getDB());
    assertEquals(tableName, dropPartitionMessage.getTable());
    assertEquals(TableType.MANAGED_TABLE.toString(), dropPartitionMessage.getTableType());
    List<Map<String, String>> droppedPartSpecs = dropPartitionMessage.getPartitions();
    assertNotNull(droppedPartSpecs);
    assertEquals(1,droppedPartSpecs.size());
    assertEquals(partSpec,droppedPartSpecs.get(0));
  }
This can't use TestHCatClient because it has to have control over certain conf variables when
the metastore is started.  Plus, we don't need a metastore running in another thread.  The
local one is fine.
itests/hcatalog-unit/src/test/java/org/apache/hive/hcatalog/api/TestHCatClientNotification.java