Search in sources :

Example 1 with ChangeAndCommit

use of com.google.gerrit.server.change.GetRelated.ChangeAndCommit in project gerrit by GerritCodeReview.

the class GetRelatedIT method assertRelated.

private void assertRelated(PatchSet.Id psId, ChangeAndCommit... expected) throws Exception {
    List<ChangeAndCommit> actual = getRelated(psId);
    assertThat(actual).named("related to " + psId).hasSize(expected.length);
    for (int i = 0; i < actual.size(); i++) {
        String name = "index " + i + " related to " + psId;
        ChangeAndCommit a = actual.get(i);
        ChangeAndCommit e = expected[i];
        assertThat(a._changeNumber).named("change ID of " + name).isEqualTo(e._changeNumber);
        // Don't bother checking changeId; assume _changeNumber is sufficient.
        assertThat(a._revisionNumber).named("revision of " + name).isEqualTo(e._revisionNumber);
        assertThat(a.commit.commit).named("commit of " + name).isEqualTo(e.commit.commit);
        assertThat(a._currentRevisionNumber).named("current revision of " + name).isEqualTo(e._currentRevisionNumber);
    }
}
Also used : ChangeAndCommit(com.google.gerrit.server.change.GetRelated.ChangeAndCommit)

Example 2 with ChangeAndCommit

use of com.google.gerrit.server.change.GetRelated.ChangeAndCommit in project gerrit by GerritCodeReview.

the class GetRelatedIT method changeAndCommit.

private static ChangeAndCommit changeAndCommit(PatchSet.Id psId, ObjectId commitId, int currentRevisionNum) {
    ChangeAndCommit result = new ChangeAndCommit();
    result._changeNumber = psId.getParentKey().get();
    result.commit = new CommitInfo();
    result.commit.commit = commitId.name();
    result._revisionNumber = psId.get();
    result._currentRevisionNumber = currentRevisionNum;
    result.status = "NEW";
    return result;
}
Also used : CommitInfo(com.google.gerrit.extensions.common.CommitInfo) ChangeAndCommit(com.google.gerrit.server.change.GetRelated.ChangeAndCommit)

Aggregations

ChangeAndCommit (com.google.gerrit.server.change.GetRelated.ChangeAndCommit)2 CommitInfo (com.google.gerrit.extensions.common.CommitInfo)1