Package org.locationtech.geogig.api.porcelain

Examples of org.locationtech.geogig.api.porcelain.DiffOp.call()


     */
    public Feature[] getFeaturesToCommit(String path, boolean noDeletions) {
        DiffOp diffOp = repository.command(DiffOp.class);
        diffOp.setCompareIndex(true);
        diffOp.setFilter(path);
        Iterator<DiffEntry> diffs = diffOp.call();
        List<Feature> list = Lists.newArrayList();
        while (diffs.hasNext()) {
            DiffEntry diff = diffs.next();
            if (!diff.changeType().equals(ChangeType.REMOVED) || !noDeletions) {
                RevFeature revFeature = repository.command(RevObjectParse.class)
View Full Code Here


        insertAndAdd(points3);
        deleteAndAdd(points2);
        delete(points3);
        DiffOp op = geogig.command(DiffOp.class);
        op.setCompareIndex(true);
        Iterator<DiffEntry> diffs = op.call();
        Patch patch = geogig.command(CreatePatchOp.class).setDiffs(diffs).call();

        assertEquals(3, patch.count());
        assertEquals(1, patch.getAddedFeatures().size());
        assertEquals(1, patch.getRemovedFeatures().size());
View Full Code Here

    @Test
    public void testCreatePatchAddNewFeatureToEmptyRepo() throws Exception {
        insert(points1);
        DiffOp op = geogig.command(DiffOp.class);
        Iterator<DiffEntry> diffs = op.call();
        Patch patch = geogig.command(CreatePatchOp.class).setDiffs(diffs).call();
        assertEquals(1, patch.getAddedFeatures().size());
    }

    @Test
View Full Code Here

    @Test
    public void testCreatePatchAddNewEmptyFeatureTypeToEmptyRepo() throws Exception {
        WorkingTree workingTree = geogig.getRepository().workingTree();
        workingTree.createTypeTree(linesName, linesType);
        DiffOp op = geogig.command(DiffOp.class).setReportTrees(true);
        Iterator<DiffEntry> diffs = op.call();
        Patch patch = geogig.command(CreatePatchOp.class).setDiffs(diffs).call();
        assertEquals(1, patch.getAlteredTrees().size());
        assertEquals(ObjectId.NULL, patch.getAlteredTrees().get(0).getOldFeatureType());
        assertEquals(RevFeatureTypeImpl.build(linesType).getId(), patch.getAlteredTrees().get(0)
                .getNewFeatureType());
View Full Code Here

        WorkingTree workingTree = geogig.getRepository().workingTree();
        workingTree.createTypeTree(linesName, linesType);
        geogig.command(AddOp.class).setUpdateOnly(false).call();
        workingTree.delete(linesName);
        DiffOp op = geogig.command(DiffOp.class).setReportTrees(true);
        Iterator<DiffEntry> diffs = op.call();
        Patch patch = geogig.command(CreatePatchOp.class).setDiffs(diffs).call();
        assertEquals(1, patch.getAlteredTrees().size());
        assertEquals(RevFeatureTypeImpl.build(linesType).getId(), patch.getAlteredTrees().get(0)
                .getOldFeatureType());
        assertEquals(ObjectId.NULL, patch.getAlteredTrees().get(0).getNewFeatureType());
View Full Code Here

        DiffOp op = geogig.command(DiffOp.class).setReportTrees(true);

        insertAndAdd(points1, points2);
        geogig.getRepository().workingTree().updateTypeTree(pointsName, modifiedPointsType);

        Iterator<DiffEntry> diffs = op.call();
        Patch patch = geogig.command(CreatePatchOp.class).setDiffs(diffs).call();
        assertEquals(1, patch.getAlteredTrees().size());
        assertEquals(RevFeatureTypeImpl.build(pointsType).getId(), patch.getAlteredTrees().get(0)
                .getOldFeatureType());
        assertEquals(RevFeatureTypeImpl.build(modifiedPointsType).getId(),
View Full Code Here

    @Test
    public void testCreatePatchAddNewEmptyPath() throws Exception {
        insert(points1);
        delete(points1);
        DiffOp op = geogig.command(DiffOp.class).setReportTrees(true);
        Iterator<DiffEntry> diffs = op.call();
        // ArrayList<DiffEntry> list = Lists.newArrayList(diffs);
        Patch patch = geogig.command(CreatePatchOp.class).setDiffs(diffs).call();
        assertEquals(1, patch.getAlteredTrees().size());
    }
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.