Examples of Patch


Examples of com.google.gerrit.reviewdb.client.Patch

    }
    return headerLines;
  }

  Patch toPatch(final PatchSet.Id setId) {
    final Patch p = new Patch(new Patch.Key(setId, getNewName()));
    p.setChangeType(getChangeType());
    p.setPatchType(getPatchType());
    p.setSourceFileName(getOldName());
    p.setInsertions(insertions);
    p.setDeletions(deletions);
    return p;
  }
View Full Code Here

Examples of com.linkedin.data.transform.patch.Patch

    PatchTree update = PatchCreator.diff(g1, g2);

    assertEquals(update.toString(), "{$delete=[description]}");
    assertFalse(g1.equals(g2));

    DataComplexProcessor processor = new DataComplexProcessor(new Patch(), update.getDataMap(), g1.data());
    processor.run(false);

    assertEquals(g1, g2);
  }
View Full Code Here

Examples of com.linkedin.data.transform.patch.Patch

    g2.setName("Some Group");
    PatchTree update = PatchCreator.diff(g1, g2);
    assertEquals(update.toString(), "{$set={id=42, name=Some Group}}");
    assertFalse(g1.equals(g2));

    DataComplexProcessor processor = new DataComplexProcessor(new Patch(), update.getDataMap(), g1.data());
    processor.run(false);

    assertEquals(g1, g2);
  }
View Full Code Here

Examples of com.linkedin.data.transform.patch.Patch

    g2.data().put("$foo", "value");
    PatchTree update = PatchCreator.diff(g1, g2);
    assertEquals(update.toString(), "{$set={$foo=value}}");
    assertFalse(g1.equals(g2));

    DataComplexProcessor processor = new DataComplexProcessor(new Patch(), update.getDataMap(), g1.data());
    processor.run(false);

    assertEquals(g1, g2);
  }
View Full Code Here

Examples of com.linkedin.data.transform.patch.Patch

    ((DataMap)g2.data().get("$foo")).put("bar", 42);
    PatchTree update = PatchCreator.diff(g1, g2);
    assertEquals(update.toString(), "{$$foo={$set={bar=42}}}");
    assertFalse(g1.equals(g2));

    DataComplexProcessor processor = new DataComplexProcessor(new Patch(), update.getDataMap(), g1.data());
    processor.run(false);

    assertEquals(g1, g2);
  }
View Full Code Here

Examples of com.linkedin.data.transform.patch.Patch

{
  public static <T extends RecordTemplate> void applyPatch(T original,
                                                           PatchRequest<T> patch) throws DataProcessingException
  {
    DataComplexProcessor processor =
        new DataComplexProcessor(new Patch(), patch.getPatchDocument(), original.data());
    processor.run(false);
  }
View Full Code Here

Examples of com.streamreduce.datasource.patch.Patch

        // apply patches if you are the patch master
        while (currentPatchLevel < latestPatchAvailable) {
            try {
                currentPatchLevel = currentPatchLevel + 1;

                Patch patch = (Patch) applicationContext.getBean("patch" + currentPatchLevel);
                if (patch == null) {
                    logger.info("[BOOTSTRAP] class not found for patch" + currentPatchLevel);
                    logger.info("[BOOTSTRAP] patch " + currentPatchLevel + " not applied, exiting patch process");
                    break;
                }

                patch.applyPatch(applicationManager, applicationContext);

                // if it fails do no set this.. there is no "continue" here.
                systemInfo.setPatchLevel(currentPatchLevel);
                systemStatusDAO.save(systemInfo);
View Full Code Here

Examples of difflib.Patch

        String oldContent = getDriftFileBits(subject, drift.getOldDriftFile().getHashId());
        List<String> oldList = asList(oldContent.split("\\n"));
        String newContent = getDriftFileBits(subject, drift.getNewDriftFile().getHashId());
        List<String> newList = asList(newContent.split("\\n"));

        Patch patch = DiffUtils.diff(oldList, newList);
        List<String> deltas = DiffUtils.generateUnifiedDiff(drift.getPath(), drift.getPath(), oldList, patch, 10);

        return new FileDiffReport(patch.getDeltas().size(), deltas);
    }
View Full Code Here

Examples of difflib.Patch

        DriftFile drift2File = drift2.getNewDriftFile();
        String content2 = (null == drift2File) ? "" : getDriftFileBits(subject, drift2File.getHashId());
        List<String> content2List = asList(content2.split("\\n"));

        Patch patch = DiffUtils.diff(content1List, content2List);
        List<String> deltas = DiffUtils
            .generateUnifiedDiff(drift1.getPath(), drift2.getPath(), content1List, patch, 10);

        return new FileDiffReport(patch.getDeltas().size(), deltas);
    }
View Full Code Here

Examples of difflib.Patch

        List<String> actualList = asList(actualContents.split("\\n"));

        String expectedContents = StreamUtil.slurp(new FileReader(expectedFile));
        List<String> expectedList = asList(expectedContents.split("\\n"));

        Patch patch = DiffUtils.diff(actualList, expectedList);
        List<String> diffs = DiffUtils.generateUnifiedDiff(actualFile.getName(), "expected.cassandra.yaml", actualList,
            patch, 5);
        assertTrue(patch.getDeltas().isEmpty(), actualFile.getName() + " was not configured correctly. The "
            + "following differences were found:\n" + StringUtil.listToString(diffs, "\n"));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.