test_class.file: feya/libraries/archive_diff/diff.generator/src/test/java/com/google/archivepatcher/generator/FileByFileV1DeltaGeneratorTest.java
test_class.identifier: FileByFileV1DeltaGeneratorTest
test_case.body: @Test
    public void testGenerateDelta_BaseCase() throws Exception {
      // Simple test of generating a patch with no changes.
      FileByFileV1DeltaGenerator generator = new FileByFileV1DeltaGenerator();
      ByteArrayOutputStream buffer = new ByteArrayOutputStream();
      try (TempFileHolder oldArchive = new TempFileHolder();
          TempFileHolder newArchive = new TempFileHolder()) {
        UnitTestZipArchive.saveTestZip(oldArchive.file);
        UnitTestZipArchive.saveTestZip(newArchive.file);
        generator.generateDelta(oldArchive.file, newArchive.file, buffer);
      }
      byte[] result = buffer.toByteArray();
      Assert.assertTrue(result.length > 0);
    }
test_case.class_method_signature: FileByFileV1DeltaGeneratorTest.testGenerateDelta_BaseCase()
test_case.full_signature: @Test public void testGenerateDelta_BaseCase()
test_case.identifier: testGenerateDelta_BaseCase
test_case.invocations: saveTestZip saveTestZip generateDelta toByteArray assertTrue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGenerateDelta_BaseCase()
focal_class.declarator: recommendationModifiers
focal_class.modifier: private final
focal_class.original_string: private final List<RecommendationModifier> recommendationModifiers;
focal_class.type: List<RecommendationModifier>
focal_class.var_name: recommendationModifiers
focal_class.file: feya/libraries/archive_diff/diff.generator/src/main/java/com/google/archivepatcher/generator/FileByFileV1DeltaGenerator.java
focal_class.identifier: FileByFileV1DeltaGenerator
focal_class.interfaces: implements DeltaGenerator
focal_class.class_method_signature: FileByFileV1DeltaGenerator.FileByFileV1DeltaGenerator(RecommendationModifier... recommendationModifiers)
focal_class.full_signature: public  FileByFileV1DeltaGenerator(RecommendationModifier... recommendationModifiers)
focal_class.identifier: FileByFileV1DeltaGenerator
focal_class.modifiers: public
focal_class.parameters: (RecommendationModifier... recommendationModifiers)
focal_class.signature:  FileByFileV1DeltaGenerator(RecommendationModifier... recommendationModifiers)
focal_class.class_method_signature: FileByFileV1DeltaGenerator.generateDelta(File oldFile, File newFile, OutputStream patchOut)
focal_class.full_signature: @Override public void generateDelta(File oldFile, File newFile, OutputStream patchOut)
focal_class.identifier: generateDelta
focal_class.modifiers: @Override public
focal_class.parameters: (File oldFile, File newFile, OutputStream patchOut)
focal_class.return: void
focal_class.signature: void generateDelta(File oldFile, File newFile, OutputStream patchOut)
focal_class.class_method_signature: FileByFileV1DeltaGenerator.getDeltaGenerator()
focal_class.full_signature: protected DeltaGenerator getDeltaGenerator()
focal_class.identifier: getDeltaGenerator
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: DeltaGenerator
focal_class.signature: DeltaGenerator getDeltaGenerator()
focal_method.body: @Override
    public void generateDelta(File oldFile, File newFile, OutputStream patchOut)
        throws IOException, InterruptedException {
      try (TempFileHolder deltaFriendlyOldFile = new TempFileHolder();
          TempFileHolder deltaFriendlyNewFile = new TempFileHolder();
          TempFileHolder deltaFile = new TempFileHolder();
          FileOutputStream deltaFileOut = new FileOutputStream(deltaFile.file);
          BufferedOutputStream bufferedDeltaOut = new BufferedOutputStream(deltaFileOut)) {
        PreDiffExecutor.Builder builder =
            new PreDiffExecutor.Builder()
                .readingOriginalFiles(oldFile, newFile)
                .writingDeltaFriendlyFiles(deltaFriendlyOldFile.file, deltaFriendlyNewFile.file);
        for (RecommendationModifier modifier : recommendationModifiers) {
          builder.withRecommendationModifier(modifier);
        }
        PreDiffExecutor executor = builder.build();
        PreDiffPlan preDiffPlan = executor.prepareForDiffing();
        DeltaGenerator deltaGenerator = getDeltaGenerator();
        deltaGenerator.generateDelta(
            deltaFriendlyOldFile.file, deltaFriendlyNewFile.file, bufferedDeltaOut);
        bufferedDeltaOut.close();
        PatchWriter patchWriter =
            new PatchWriter(
                preDiffPlan,
                deltaFriendlyOldFile.file.length(),
                deltaFriendlyNewFile.file.length(),
                deltaFile.file);
        patchWriter.writeV1Patch(patchOut);
      }
    }
focal_method.class_method_signature: FileByFileV1DeltaGenerator.generateDelta(File oldFile, File newFile, OutputStream patchOut)
focal_method.full_signature: @Override public void generateDelta(File oldFile, File newFile, OutputStream patchOut)
focal_method.identifier: generateDelta
focal_method.invocations: writingDeltaFriendlyFiles readingOriginalFiles withRecommendationModifier build prepareForDiffing getDeltaGenerator generateDelta close length length writeV1Patch
focal_method.modifiers: @Override public
focal_method.parameters: (File oldFile, File newFile, OutputStream patchOut)
focal_method.return: void
focal_method.signature: void generateDelta(File oldFile, File newFile, OutputStream patchOut)