@Test
  public void testLogFilesAreArchived() throws Exception {
    LOG.info("testLogFilesAreArchived");
    slm = new SplitLogManager(master, conf);
    FileSystem fs = TEST_UTIL.getTestFileSystem();
    Path dir = TEST_UTIL.getDataTestDirOnTestFS("testLogFilesAreArchived");
    conf.set(HConstants.HBASE_DIR, dir.toString());
    String serverName = ServerName.valueOf("foo", 1, 1).toString();
    Path logDirPath = new Path(new Path(dir, HConstants.HREGION_LOGDIR_NAME), serverName);
    fs.mkdirs(logDirPath);
    // create an empty log file
    String logFile = new Path(logDirPath, TEST_UTIL.getRandomUUID().toString()).toString();
    fs.create(new Path(logDirPath, logFile)).close();

    // spin up a thread mocking split done.
    new Thread() {
      @Override
      public void run() {
        boolean done = false;
        while (!done) {
          for (Map.Entry<String, Task> entry : slm.getTasks().entrySet()) {
            final ServerName worker1 = ServerName.valueOf("worker1,1,1");
            SplitLogTask slt = new SplitLogTask.Done(worker1);
            boolean encounteredZKException = false;
            try {
              ZKUtil.setData(zkw, entry.getKey(), slt.toByteArray());
            } catch (KeeperException e) {
              LOG.warn(e.toString(), e);
              encounteredZKException = true;
            }
            if (!encounteredZKException) {
              done = true;
            }
          }
        }
      }
    }.start();

    slm.splitLogDistributed(logDirPath);

    assertFalse(fs.exists(logDirPath));
  }
Test whether the splitlog correctly creates a task in zookeeper
hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitLogManager.java