use of com.jcabi.github.Repo in project jcabi-github by jcabi.
the class MkRepoCommitTest method compareDifferent.
/**
* MkRepoCommit can compare different commits.
* @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");
MatcherAssert.assertThat(commit.compareTo(other), Matchers.not(0));
MatcherAssert.assertThat(other.compareTo(commit), Matchers.not(0));
}
use of com.jcabi.github.Repo in project jcabi-github by jcabi.
the class MkRepoCommitTest method canCompareInstances.
/**
* MkRepoCommit should be able to compare different instances.
*
* @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);
final MkRepoCommit greater = new MkRepoCommit(storage, repob, SHA2);
MatcherAssert.assertThat(less.compareTo(greater), Matchers.lessThan(0));
MatcherAssert.assertThat(greater.compareTo(less), Matchers.greaterThan(0));
}
use of com.jcabi.github.Repo in project jcabi-github by jcabi.
the class MkRepoCommitTest method compareEqual.
/**
* MkRepoCommit can compare equal commits.
* @throws Exception If some problem inside
*/
@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));
MatcherAssert.assertThat(other.compareTo(commit), Matchers.equalTo(0));
}
use of com.jcabi.github.Repo in project jcabi-github by jcabi.
the class MkRepoCommitTest method getRepo.
/**
* MkRepoCommit can return repository.
* @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));
}
use of com.jcabi.github.Repo in project jcabi-github by jcabi.
the class MkRepoTest method fetchBranches.
/**
* Repo can fetch its branches.
*
* @throws IOException if some problem inside
*/
@Test
public void fetchBranches() throws IOException {
final String user = "testuser";
final Repo repo = new MkRepo(new MkStorage.InFile(), user, new Coordinates.Simple(user, "testrepo"));
MatcherAssert.assertThat(repo.branches(), Matchers.notNullValue());
}
Aggregations