@Test
  public void testReplEvents() throws Throwable {
    Map<String, Set<String>> eventsMap = prepareBootstrapData(primaryDbName);
    primary.run("use " + primaryDbName)
            .dump(primaryDbName);
    replica.load(replicatedDbName, primaryDbName);
    ReplMetaStoreEventListenerTestImpl.checkEventSanity(eventsMap, replicatedDbName);
    ReplMetaStoreEventListenerTestImpl.clearSanityData();

    eventsMap = prepareIncData(primaryDbName);
    LOG.info(testName.getMethodName() + ": first incremental dump and load.");
    WarehouseInstance.Tuple incre = primary.run("use " + primaryDbName)
            .dump(primaryDbName);
    replica.load(replicatedDbName, primaryDbName);
    ReplMetaStoreEventListenerTestImpl.checkEventSanity(eventsMap, replicatedDbName);
    ReplMetaStoreEventListenerTestImpl.clearSanityData();

    // Second incremental, after bootstrap
    eventsMap = prepareInc2Data(primaryDbName);
    LOG.info(testName.getMethodName() + ": second incremental dump and load.");
    primary.run("use " + primaryDbName)
            .dump(primaryDbName);
    replica.load(replicatedDbName, primaryDbName);
    ReplMetaStoreEventListenerTestImpl.checkEventSanity(eventsMap, replicatedDbName);
    ReplMetaStoreEventListenerTestImpl.clearSanityData();
  }
TestMetaStoreEventListenerInRepl - Test metastore events created by replication.
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestMetaStoreEventListenerInRepl.java