@Test
public void testHadoopArchiveLogsWithArchiveError() throws Exception {

  String[] args = getArgs();
  final HadoopArchiveLogsRunner halr = new HadoopArchiveLogsRunner(conf);
  HadoopArchives mockHadoopArchives = mock(HadoopArchives.class);
  when(mockHadoopArchives.run(Mockito.<String[]>any())).thenReturn(-1);
  halr.hadoopArchives = mockHadoopArchives;
  assertNotEquals(0, ToolRunner.run(halr, args));
  // Make sure the original log files are intact
  FileStatus[] app1Files = fs.listStatus(app1Path);
  assertEquals(FILE_COUNT, app1Files.length);
  for (int i = 0; i < FILE_COUNT; i++) {
    Assert.assertEquals(FILE_SIZES[i] * FILE_SIZE_INCREMENT,
        app1Files[i].getLen());
  }
}