Examples of Repo


Examples of com.jcabi.github.Repo

     * @throws Exception if some problem inside
     */
    @Test
    public void canRemoveFileFromBranch() throws Exception {
        final String branch = "branch-1";
        final Repo repo = MkContentsTest.repo();
        final String path = "removeme.txt";
        this.createFile(repo, path);
        final JsonObject json = MkContentsTest
            .content(path, "theDeleteMessage")
            .add("ref", branch)
            .add("committer", MkContentsTest.committer())
            .build();
        final RepoCommit commit = repo.contents().remove(json);
        MatcherAssert.assertThat(commit, Matchers.notNullValue());
        MatcherAssert.assertThat(
            commit.json().getString("message"),
            Matchers.equalTo("theDeleteMessage")
        );
View Full Code Here

Examples of com.jcabi.github.Repo

     * @throws IOException if any error occurs.
     */
    @Test
    public void canIterate() throws IOException {
        final MkStorage storage = new MkStorage.InFile();
        final Repo repo = repo(storage);
        final Content[] correct = this.addContent(
            repo, "foo/bar/1", "foo/bar/2"
        );
        this.addContent(repo, "foo/baz", "foo/boo");
        MatcherAssert.assertThat(
            repo.contents().iterate("foo/bar", "ref-1"),
            Matchers.contains(correct)
        );
    }
View Full Code Here

Examples of com.jcabi.github.Repo

                .attr("coords", coords.toString())
                .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.jcabi.github.Repo

     * @throws IOException If some problem inside
     */
    @Test
    public void getRepo() throws IOException {
        final MkStorage storage = new MkStorage.InFile();
        final Repo repo = this.repo(storage);
        MatcherAssert.assertThat(
            new MkRepoCommit(
                storage, repo, SHA1
            ).repo(), Matchers.equalTo(repo)
        );
View Full Code Here

Examples of com.jcabi.github.Repo

     * @throws Exception when a problem occurs.
     */
    @Test
    public void canCompareInstances() throws Exception {
        final MkStorage storage = new MkStorage.InFile();
        final Repo repoa = new MkRepo(
            storage, "login1",
            new Coordinates.Simple("test_login1", "test_repo1")
        );
        final Repo repob = new MkRepo(
            storage, "login2",
            new Coordinates.Simple("test_login2", "test_repo2")
        );
        final MkRepoCommit less =  new MkRepoCommit(
            storage, repoa, SHA1
View Full Code Here

Examples of com.jcabi.github.Repo

     */
    @Test
    public void compareEqual() throws Exception {
        final String sha = "c2c53d66948214258a26ca9ca845d7ac0c17f8e7";
        final MkStorage storage = new MkStorage.InFile();
        final Repo repo = this.repo(storage);
        final MkRepoCommit commit = new MkRepoCommit(storage, repo, sha);
        final MkRepoCommit other = new MkRepoCommit(storage, repo, sha);
        MatcherAssert.assertThat(
            commit.compareTo(other), Matchers.equalTo(0)
        );
View Full Code Here

Examples of com.jcabi.github.Repo

     * @throws Exception If some problem inside
     */
    @Test
    public void compareDifferent() throws Exception {
        final MkStorage storage = new MkStorage.InFile();
        final Repo repo = this.repo(storage);
        final MkRepoCommit commit = new MkRepoCommit(
            storage, repo, "6dcd4ce23d88e2ee9568ba546c007c63d9131c1b"
        );
        final MkRepoCommit other = new MkRepoCommit(
            storage, repo, "e9d71f5ee7c92d6dc9e92ffdad17b8bd49418f98"
View Full Code Here

Examples of com.jcabi.github.Repo

     * MkIssueLabels can list labels.
     * @throws Exception If some problem inside
     */
    @Test
    public void iteratesIssues() throws Exception {
        final Repo repo = this.repo();
        final String name = "bug";
        repo.labels().create(name, "c0c0c0");
        final Issue issue = repo.issues().create("title", "body");
        issue.labels().add(Collections.singletonList(name));
        MatcherAssert.assertThat(
            issue.labels().iterate(),
            Matchers.<Label>iterableWithSize(1)
        );
View Full Code Here

Examples of com.jcabi.github.Repo

     * MkIssueLabels can create labels through Smart decorator.
     * @throws Exception If some problem inside
     */
    @Test
    public void createsLabelsThroughDecorator() throws Exception {
        final Repo repo = this.repo();
        final Issue issue = repo.issues().create("how are you?", "");
        final String name = "task";
        new IssueLabels.Smart(issue.labels()).addIfAbsent(name, "f0f0f0");
        MatcherAssert.assertThat(
            issue.labels().iterate(),
            Matchers.<Label>iterableWithSize(1)
View Full Code Here

Examples of com.jcabi.github.Repo

     *
     * @throws Exception if some problem inside
     */
    @Test
    public void canGetOwnRepo() throws Exception {
        final Repo repo = MkContentTest.repo();
        final Contents contents = repo.contents();
        final Content content = contents.create(
            jsonContent("repo.txt", "for repo", "json repo")
        );
        MatcherAssert.assertThat(
            content.repo(),
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.