@Test
public void testHadoopArchiveLogs() throws Exception {

  String[] args = getArgs();
  final HadoopArchiveLogsRunner halr = new HadoopArchiveLogsRunner(conf);
  assertEquals(0, ToolRunner.run(halr, args));
  fs = FileSystem.get(conf);
  FileStatus[] app1Files = fs.listStatus(app1Path);
  Assert.assertEquals(1, app1Files.length);
  FileStatus harFile = app1Files[0];
  Assert.assertEquals(app1.toString() + ".har", harFile.getPath().getName());
  Path harPath = new Path("har:///" + harFile.getPath().toUri().getRawPath());
  FileStatus[] harLogs = HarFs.get(harPath.toUri(), conf).listStatus(harPath);
  Assert.assertEquals(FILE_COUNT, harLogs.length);
  Arrays.sort(harLogs, new Comparator<FileStatus>() {
    @Override
    public int compare(FileStatus o1, FileStatus o2) {
      return o1.getPath().getName().compareTo(o2.getPath().getName());
    }
  });
  for (int i = 0; i < FILE_COUNT; i++) {
    FileStatus harLog = harLogs[i];
    Assert.assertEquals("log" + (i + 1), harLog.getPath().getName());
    Assert.assertEquals(FILE_SIZES[i] * FILE_SIZE_INCREMENT, harLog.getLen());
    Assert.assertEquals(
        new FsPermission(FsAction.READ_WRITE, FsAction.READ, FsAction.NONE),
        harLog.getPermission());
    Assert.assertEquals(System.getProperty("user.name"),
        harLog.getOwner());
  }
  Assert.assertEquals(0, fs.listStatus(workingDir).length);
}