Examples of patch()


Examples of com.jcabi.github.PublicKey.patch()

    public void canBePatched() throws Exception {
        final String original = "PublicKey2";
        final PublicKey key = new MkGithub().users().get("jeff")
            .keys().create("Title2", original);
        final String patched = String.format("%s_patch", original);
        key.patch(
            Json.createObjectBuilder().add(KEY, patched).build()
        );
        MatcherAssert.assertThat(
            key.json().getString(KEY),
            Matchers.equalTo(patched)
View Full Code Here

Examples of com.jcabi.github.Pull.patch()

     */
    @Test
    public void canPatchJson() throws Exception {
        final Pull pull = repo().pulls().create("Test Patch", "def", "abc");
        final String value = "someValue";
        pull.patch(
            Json.createObjectBuilder().add("patch", value).build()
        );
        MatcherAssert.assertThat(
            pull.json().getString("patch"),
            Matchers.equalTo(value)
View Full Code Here

Examples of com.jcabi.github.PullComment.patch()

     */
    @Test
    public void executePatchRequest() throws Exception {
        final String path = "/path/to/file.txt";
        final PullComment comment = MkPullCommentTest.comment();
        comment.patch(Json.createObjectBuilder().add("path", path).build());
        MatcherAssert.assertThat(
            comment.json().toString(),
            Matchers.containsString(path)
        );
    }
View Full Code Here

Examples of com.jcabi.github.PullComment.patch()

                body,
                orig.getString("commit_id"),
                orig.getString("path"),
                comment
            );
            reply.patch(
                Json.createObjectBuilder()
                    .add("original_position", String.valueOf(comment)).build()
            );
            return reply;
        } finally {
View Full Code Here

Examples of com.jcabi.github.Reference.patch()

    public void patchesRef() throws Exception {
        final Reference ref = this.reference();
        final JsonObject json = Json.createObjectBuilder()
            .add("sha", "testshaPATCH")
            .build();
        ref.patch(json);
        MatcherAssert.assertThat(
            ref.json().getString("sha"),
            Matchers.is("testshaPATCH")
        );
    }
View Full Code Here

Examples of com.jcabi.github.ReleaseAsset.patch()

        MatcherAssert.assertThat(
            asset.json().getString(attribute),
            Matchers.is(orig)
        );
        final String patched = "patched.txt";
        asset.patch(
            Json.createObjectBuilder().add(attribute, patched).build()
        );
        MatcherAssert.assertThat(
            asset.json().getString(attribute),
            Matchers.is(patched)
View Full Code Here

Examples of com.jcabi.github.Repo.patch()

                .add("name").set(name).up()
                .add("description").set("test repository").up()
                .add("private").set("false").up()
        );
        final Repo repo = this.get(coords);
        repo.patch(json);
        Logger.info(
            this, "repository %s created by %s",
            coords, this.self
        );
        return repo;
View Full Code Here

Examples of com.threerings.getdown.tools.Patcher.patch()

            MetaProgressObserver mprog = new MetaProgressObserver(_progobs, list.size());
            for (Resource prsrc : list) {
                mprog.startElement(1);
                try {
                    Patcher patcher = new Patcher();
                    patcher.patch(prsrc.getLocal().getParentFile(), prsrc.getLocal(), mprog);
                } catch (Exception e) {
                    log.warning("Failed to apply patch", "prsrc", prsrc, e);
                }

                // clean up the patch file
View Full Code Here

Examples of floobits.common.interfaces.IDoc.patch()

        if (!d.makeWritable()) {
            Flog.info("Document: %s is not writable.", d);
            return;
        }

        String text = d.patch(positions);
        if (text == null) {
            getBuf();
            return;
        }
View Full Code Here

Examples of milk.jpatch.attribs.AttributesPatch.patch()

        // Especially important is that a CodePatch is always applied.
        Attribute[] attribs = ret.getAttributes();
        // It should never happen that the map used in generation is accessed.
        AttributesPatch ap = AttributesPatch.generate(new Attribute[0],
                attribs, null);
        List<Attribute> attribL = ap.patch(new ArrayList<Attribute>(
                Arrays.asList(attribs)), map);
        ret = map.applyTo(ret);
        ret.setAttributes(attribL.toArray(new Attribute[attribL.size()]));
        return ret;
    }
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.