@Test
  public void testIsSubDirectoryWorks() {
    Path rootDir = new Path("hdfs://root/.hbase-snapshot/");

    assertFalse(SnapshotDescriptionUtils.isSubDirectoryOf(rootDir, rootDir));
    assertFalse(SnapshotDescriptionUtils
      .isSubDirectoryOf(new Path("hdfs://root/.hbase-snapshotdir"), rootDir));
    assertFalse(
      SnapshotDescriptionUtils.isSubDirectoryOf(new Path("hdfs://root/.hbase-snapshot"), rootDir));
    assertFalse(
      SnapshotDescriptionUtils.isSubDirectoryOf(new Path("hdfs://.hbase-snapshot"), rootDir));
    assertFalse(
      SnapshotDescriptionUtils.isSubDirectoryOf(new Path("hdfs://.hbase-snapshot/.tmp"), rootDir));
    assertFalse(SnapshotDescriptionUtils.isSubDirectoryOf(new Path("hdfs://root"), rootDir));
    assertTrue(SnapshotDescriptionUtils
      .isSubDirectoryOf(new Path("hdfs://root/.hbase-snapshot/.tmp"), rootDir));
    assertTrue(SnapshotDescriptionUtils
      .isSubDirectoryOf(new Path("hdfs://root/.hbase-snapshot/.tmp/snapshot"), rootDir));

    assertFalse(
      SnapshotDescriptionUtils.isSubDirectoryOf(new Path("s3://root/.hbase-snapshot/"), rootDir));
    assertFalse(SnapshotDescriptionUtils.isSubDirectoryOf(new Path("s3://root"), rootDir));
    assertFalse(SnapshotDescriptionUtils
      .isSubDirectoryOf(new Path("s3://root/.hbase-snapshot/.tmp/snapshot"), rootDir));
  }
Test that we throw an exception if there is no working snapshot directory when we attempt to
'complete' the snapshot
@throws Exception on failure
hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestSnapshotDescriptionUtils.java