Package com.jcabi.github

Examples of com.jcabi.github.Repo$Smart


     * @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


                .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

     * @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

     * @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

     */
    @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

     * @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

     * 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

     * 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

     *
     * @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

     *
     * @throws Exception when a problem occurs.
     */
    @Test
    public void canGetCommentsNumberIfNonZero() throws Exception {
        final Repo repo =  MkPullTest.repo();
        final Pull pull = repo.pulls().create("", "", "");
        pull.comments().post("comment1", "path1", "how are you?", 1);
        pull.comments().post("comment2", "path2", "how are you2?", 2);
        MatcherAssert.assertThat(
            pull.json().getInt("comments"),
            Matchers.is(2)
View Full Code Here

TOP

Related Classes of com.jcabi.github.Repo$Smart

Copyright © 2018 www.massapicom. 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.