示例#1
0
  @Test
  public void shouldBeAbleToCreateEmptyArchiveWhenOverwriting() throws IOException {
    CustomZipOutputStream ignored = ZipOutputStreams.newOutputStream(output, OVERWRITE_EXISTING);
    ignored.close();

    try (Zip zip = new Zip(output, false)) {
      assertTrue(zip.getFileNames().isEmpty());
    }
  }
示例#2
0
  @Test
  public void shouldBeAbleToCreateEmptyArchive() throws IOException {
    CustomZipOutputStream ignored = ZipOutputStreams.newOutputStream(output);
    ignored.close();

    try (Zip zip = new Zip(output, /* forWriting */ false)) {
      assertTrue(zip.getFileNames().isEmpty());
    }
  }