Examples of addModifiedFeature()


Examples of org.locationtech.geogig.api.plumbing.diff.Patch.addModifiedFeature()

                        .setObjectId(diffEntry.newObjectId()).call().get();
                if (revObject instanceof RevFeature) {
                    FeatureDiff diff = command(DiffFeature.class)
                            .setNewVersion(Suppliers.ofInstance(diffEntry.getNewObject()))
                            .setOldVersion(Suppliers.ofInstance(diffEntry.getOldObject())).call();
                    patch.addModifiedFeature(diff);
                } else if (revObject instanceof RevTree) {
                    RevFeatureType oldFeatureType = command(RevObjectParse.class)
                            .setObjectId(diffEntry.getOldObject().getMetadataId())
                            .call(RevFeatureType.class).get();
                    RevFeatureType newFeatureType = command(RevObjectParse.class)
View Full Code Here

Examples of org.locationtech.geogig.api.plumbing.diff.Patch.addModifiedFeature()

        Optional<?> oldValue = Optional.fromNullable(points1.getProperty("sp").getValue());
        GenericAttributeDiffImpl diff = new GenericAttributeDiffImpl(oldValue, Optional.of("new"));
        map.put(pointsType.getDescriptor("sp"), diff);
        FeatureDiff feaureDiff = new FeatureDiff(path, map, RevFeatureTypeImpl.build(pointsType),
                RevFeatureTypeImpl.build(pointsType));
        patch.addModifiedFeature(feaureDiff);
        File file = new File(platform.pwd(), "test.patch");
        BufferedWriter writer = Files.newWriter(file, Charsets.UTF_8);
        PatchSerializer.write(writer, patch);
        writer.flush();
        writer.close();
View Full Code Here

Examples of org.locationtech.geogig.api.plumbing.diff.Patch.addModifiedFeature()

        Optional<?> oldValue = Optional.fromNullable(points1.getProperty("sp").getValue());
        GenericAttributeDiffImpl diff = new GenericAttributeDiffImpl(oldValue, Optional.of("new"));
        map.put(pointsType.getDescriptor("sp"), diff);
        FeatureDiff feaureDiff = new FeatureDiff(path, map, RevFeatureTypeImpl.build(pointsType),
                RevFeatureTypeImpl.build(pointsType));
        patch.addModifiedFeature(feaureDiff);
        geogig.command(ApplyPatchOp.class).setPatch(patch).call();
        RevTree root = repo.workingTree().getTree();
        Optional<Node> featureBlobId = findTreeChild(root, path);
        assertTrue(featureBlobId.isPresent());
        Iterator<DiffEntry> unstaged = repo.workingTree().getUnstaged(pointsName);
View Full Code Here

Examples of org.locationtech.geogig.api.plumbing.diff.Patch.addModifiedFeature()

        Optional<?> oldValue = Optional.fromNullable(points1.getProperty("sp").getValue());
        GenericAttributeDiffImpl diff = new GenericAttributeDiffImpl(oldValue, Optional.of("new"));
        map.put(pointsType.getDescriptor("sp"), diff);
        FeatureDiff feaureDiff = new FeatureDiff(path, map, RevFeatureTypeImpl.build(pointsType),
                RevFeatureTypeImpl.build(pointsType));
        patch.addModifiedFeature(feaureDiff);
        try {
            geogig.command(ApplyPatchOp.class).setPatch(patch).call();
            fail();
        } catch (CannotApplyPatchException e) {
            assertTrue(true);
View Full Code Here

Examples of org.locationtech.geogig.api.plumbing.diff.Patch.addModifiedFeature()

        Optional<?> oldValue = Optional.fromNullable(points1B.getProperty("extra").getValue());
        GenericAttributeDiffImpl diff = new GenericAttributeDiffImpl(oldValue, null);
        map.put(modifiedPointsType.getDescriptor("extra"), diff);
        FeatureDiff featureDiff = new FeatureDiff(path, map,
                RevFeatureTypeImpl.build(modifiedPointsType), RevFeatureTypeImpl.build(pointsType));
        patch.addModifiedFeature(featureDiff);
        geogig.command(ApplyPatchOp.class).setPatch(patch).call();
        Optional<RevFeature> feature = geogig.command(RevObjectParse.class)
                .setRefSpec("WORK_HEAD:" + path).call(RevFeature.class);
        assertTrue(feature.isPresent());
        ImmutableList<Optional<Object>> values = feature.get().getValues();
View Full Code Here

Examples of org.locationtech.geogig.api.plumbing.diff.Patch.addModifiedFeature()

        Optional<?> newValue = Optional.fromNullable(points1B.getProperty("extra").getValue());
        GenericAttributeDiffImpl diff = new GenericAttributeDiffImpl(null, newValue);
        map.put(modifiedPointsType.getDescriptor("extra"), diff);
        FeatureDiff featureDiff = new FeatureDiff(path, map, RevFeatureTypeImpl.build(pointsType),
                RevFeatureTypeImpl.build(modifiedPointsType));
        patch.addModifiedFeature(featureDiff);
        geogig.command(ApplyPatchOp.class).setPatch(patch).call();
        // TODO
    }

    @Test
View Full Code Here

Examples of org.locationtech.geogig.api.plumbing.diff.Patch.addModifiedFeature()

        Optional<?> oldValue = Optional.fromNullable(points1B.getProperty("extra").getValue());
        GenericAttributeDiffImpl diff = new GenericAttributeDiffImpl(oldValue, null);
        map.put(modifiedPointsType.getDescriptor("extra"), diff);
        FeatureDiff featureDiff = new FeatureDiff(path, map,
                RevFeatureTypeImpl.build(modifiedPointsType), RevFeatureTypeImpl.build(pointsType));
        patch.addModifiedFeature(featureDiff);
        try {
            geogig.command(ApplyPatchOp.class).setPatch(patch).call();
            fail();
        } catch (CannotApplyPatchException e) {
            assertTrue(true);
View Full Code Here

Examples of org.locationtech.geogig.api.plumbing.diff.Patch.addModifiedFeature()

        Optional<?> newValue = Optional.fromNullable(points1B.getProperty("extra").getValue());
        GenericAttributeDiffImpl diff = new GenericAttributeDiffImpl(null, newValue);
        map.put(modifiedPointsType.getDescriptor("extra"), diff);
        FeatureDiff featureDiff = new FeatureDiff(path, map,
                RevFeatureTypeImpl.build(modifiedPointsType), RevFeatureTypeImpl.build(modifiedPointsType));
        patch.addModifiedFeature(featureDiff);
        try {
            geogig.command(ApplyPatchOp.class).setPatch(patch).call();
            fail();
        } catch (CannotApplyPatchException e) {
            assertTrue(true);
View Full Code Here

Examples of org.locationtech.geogig.api.plumbing.diff.Patch.addModifiedFeature()

        Optional<?> oldValue = Optional.fromNullable(points1.getProperty("sp").getValue());
        GenericAttributeDiffImpl diff = new GenericAttributeDiffImpl(oldValue, Optional.of("new"));
        map.put(pointsType.getDescriptor("sp"), diff);
        FeatureDiff featureDiff = new FeatureDiff(path, map, RevFeatureTypeImpl.build(pointsType),
                RevFeatureTypeImpl.build(pointsType));
        patch.addModifiedFeature(featureDiff);
        try {
            geogig.command(ApplyPatchOp.class).setPatch(patch).call();
            fail();
        } catch (CannotApplyPatchException e) {
            assertTrue(true);
View Full Code Here

Examples of org.locationtech.geogig.api.plumbing.diff.Patch.addModifiedFeature()

        Optional<?> oldValue = Optional.fromNullable(points1B.getProperty("extra").getValue());
        GenericAttributeDiffImpl diff = new GenericAttributeDiffImpl(oldValue, null);
        map.put(modifiedPointsType.getDescriptor("extra"), diff);
        FeatureDiff featureDiff = new FeatureDiff(pathModify, map,
                RevFeatureTypeImpl.build(modifiedPointsType), RevFeatureTypeImpl.build(pointsType));
        patch.addModifiedFeature(featureDiff);
        Patch rejected = geogig.command(ApplyPatchOp.class).setPatch(patch).setApplyPartial(true)
                .call();
        assertFalse(rejected.isEmpty());
        RevTree root = repo.workingTree().getTree();
        assertNotNull(root);
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.