@Test public void testPrepareForDiffing_OneCompressedEntry_Changed_Limited() throws IOException { byte[] oldBytes = UnitTestZipArchive.makeTestZip(Collections.singletonList(ENTRY_LEVEL_6)); File oldFile = store(oldBytes); byte[] newBytes = UnitTestZipArchive.makeTestZip(Collections.singletonList(ENTRY_LEVEL_9)); File newFile = store(newBytes); TotalRecompressionLimiter limiter = new TotalRecompressionLimiter(1); PreDiffExecutor executor = new PreDiffExecutor.Builder() .readingOriginalFiles(oldFile, newFile) .writingDeltaFriendlyFiles(deltaFriendlyOldFile, deltaFriendlyNewFile) .withRecommendationModifier(limiter) .build(); PreDiffPlan plan = executor.prepareForDiffing(); Assert.assertNotNull(plan); Assert.assertTrue(plan.getOldFileUncompressionPlan().isEmpty()); Assert.assertTrue(plan.getNewFileUncompressionPlan().isEmpty()); Assert.assertTrue(plan.getDeltaFriendlyNewFileRecompressionPlan().isEmpty()); assertFileEquals(oldFile, deltaFriendlyOldFile); assertFileEquals(newFile, deltaFriendlyNewFile); }
public PreDiffPlan prepareForDiffing() throws IOException { PreDiffPlan preDiffPlan = generatePreDiffPlan(); List<TypedRange<JreDeflateParameters>> deltaFriendlyNewFileRecompressionPlan = null; if (deltaFriendlyOldFile != null) { deltaFriendlyNewFileRecompressionPlan = Collections.unmodifiableList(generateDeltaFriendlyFiles(preDiffPlan)); } return new PreDiffPlan( preDiffPlan.getQualifiedRecommendations(), preDiffPlan.getOldFileUncompressionPlan(), preDiffPlan.getNewFileUncompressionPlan(), deltaFriendlyNewFileRecompressionPlan); }
PreDiffExecutor { public PreDiffPlan prepareForDiffing() throws IOException { PreDiffPlan preDiffPlan = generatePreDiffPlan(); List<TypedRange<JreDeflateParameters>> deltaFriendlyNewFileRecompressionPlan = null; if (deltaFriendlyOldFile != null) { deltaFriendlyNewFileRecompressionPlan = Collections.unmodifiableList(generateDeltaFriendlyFiles(preDiffPlan)); } return new PreDiffPlan( preDiffPlan.getQualifiedRecommendations(), preDiffPlan.getOldFileUncompressionPlan(), preDiffPlan.getNewFileUncompressionPlan(), deltaFriendlyNewFileRecompressionPlan); } }
PreDiffExecutor { public PreDiffPlan prepareForDiffing() throws IOException { PreDiffPlan preDiffPlan = generatePreDiffPlan(); List<TypedRange<JreDeflateParameters>> deltaFriendlyNewFileRecompressionPlan = null; if (deltaFriendlyOldFile != null) { deltaFriendlyNewFileRecompressionPlan = Collections.unmodifiableList(generateDeltaFriendlyFiles(preDiffPlan)); } return new PreDiffPlan( preDiffPlan.getQualifiedRecommendations(), preDiffPlan.getOldFileUncompressionPlan(), preDiffPlan.getNewFileUncompressionPlan(), deltaFriendlyNewFileRecompressionPlan); } private  PreDiffExecutor(
      File originalOldFile,
      File originalNewFile,
      File deltaFriendlyOldFile,
      File deltaFriendlyNewFile,
      List<RecommendationModifier> recommendationModifiers); }
PreDiffExecutor { public PreDiffPlan prepareForDiffing() throws IOException { PreDiffPlan preDiffPlan = generatePreDiffPlan(); List<TypedRange<JreDeflateParameters>> deltaFriendlyNewFileRecompressionPlan = null; if (deltaFriendlyOldFile != null) { deltaFriendlyNewFileRecompressionPlan = Collections.unmodifiableList(generateDeltaFriendlyFiles(preDiffPlan)); } return new PreDiffPlan( preDiffPlan.getQualifiedRecommendations(), preDiffPlan.getOldFileUncompressionPlan(), preDiffPlan.getNewFileUncompressionPlan(), deltaFriendlyNewFileRecompressionPlan); } private  PreDiffExecutor(
      File originalOldFile,
      File originalNewFile,
      File deltaFriendlyOldFile,
      File deltaFriendlyNewFile,
      List<RecommendationModifier> recommendationModifiers); PreDiffPlan prepareForDiffing(); }
PreDiffExecutor { public PreDiffPlan prepareForDiffing() throws IOException { PreDiffPlan preDiffPlan = generatePreDiffPlan(); List<TypedRange<JreDeflateParameters>> deltaFriendlyNewFileRecompressionPlan = null; if (deltaFriendlyOldFile != null) { deltaFriendlyNewFileRecompressionPlan = Collections.unmodifiableList(generateDeltaFriendlyFiles(preDiffPlan)); } return new PreDiffPlan( preDiffPlan.getQualifiedRecommendations(), preDiffPlan.getOldFileUncompressionPlan(), preDiffPlan.getNewFileUncompressionPlan(), deltaFriendlyNewFileRecompressionPlan); } private  PreDiffExecutor(
      File originalOldFile,
      File originalNewFile,
      File deltaFriendlyOldFile,
      File deltaFriendlyNewFile,
      List<RecommendationModifier> recommendationModifiers); PreDiffPlan prepareForDiffing();  }