Search in sources :

Example 1 with TestPatchset

use of com.google.gerrit.acceptance.testsuite.change.TestPatchset in project gerrit by GerritCodeReview.

the class PortedCommentsIT method portedReplyStillRefersToParentComment.

@Test
public void portedReplyStillRefersToParentComment() throws Exception {
    // Set up change and patchsets.
    Change.Id changeId = changeOps.newChange().create();
    TestPatchset patchset1 = changeOps.change(changeId).currentPatchset().get();
    PatchSet.Id patchset2Id = changeOps.change(changeId).newPatchset().create();
    // Add comments.
    String rootCommentUuid = newComment(patchset1.patchsetId()).create();
    String childCommentUuid = newComment(patchset1.patchsetId()).parentUuid(rootCommentUuid).create();
    CommentInfo portedComment = getPortedComment(patchset2Id, childCommentUuid);
    assertThat(portedComment).inReplyTo().isEqualTo(rootCommentUuid);
}
Also used : TestPatchset(com.google.gerrit.acceptance.testsuite.change.TestPatchset) PatchSet(com.google.gerrit.entities.PatchSet) Change(com.google.gerrit.entities.Change) CommentInfo(com.google.gerrit.extensions.common.CommentInfo) Test(org.junit.Test) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest)

Example 2 with TestPatchset

use of com.google.gerrit.acceptance.testsuite.change.TestPatchset in project gerrit by GerritCodeReview.

the class PortedCommentsIT method portedCommentHasOriginalTag.

@Test
public void portedCommentHasOriginalTag() throws Exception {
    // Set up change and patchsets.
    Change.Id changeId = changeOps.newChange().create();
    TestPatchset patchset1 = changeOps.change(changeId).currentPatchset().get();
    PatchSet.Id patchset2Id = changeOps.change(changeId).newPatchset().create();
    // Add comment.
    String commentUuid = newComment(patchset1.patchsetId()).tag("My comment tag").create();
    CommentInfo portedComment = getPortedComment(patchset2Id, commentUuid);
    assertThat(portedComment).tag().isEqualTo("My comment tag");
}
Also used : TestPatchset(com.google.gerrit.acceptance.testsuite.change.TestPatchset) PatchSet(com.google.gerrit.entities.PatchSet) Change(com.google.gerrit.entities.Change) CommentInfo(com.google.gerrit.extensions.common.CommentInfo) Test(org.junit.Test) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest)

Example 3 with TestPatchset

use of com.google.gerrit.acceptance.testsuite.change.TestPatchset in project gerrit by GerritCodeReview.

the class PortedCommentsIT method portedCommentHasOriginalMessage.

@Test
public void portedCommentHasOriginalMessage() throws Exception {
    // Set up change and patchsets.
    Change.Id changeId = changeOps.newChange().create();
    TestPatchset patchset1 = changeOps.change(changeId).currentPatchset().get();
    PatchSet.Id patchset2Id = changeOps.change(changeId).newPatchset().create();
    // Add comment.
    String commentUuid = newComment(patchset1.patchsetId()).message("My comment text").create();
    CommentInfo portedComment = getPortedComment(patchset2Id, commentUuid);
    assertThat(portedComment).message().isEqualTo("My comment text");
}
Also used : TestPatchset(com.google.gerrit.acceptance.testsuite.change.TestPatchset) PatchSet(com.google.gerrit.entities.PatchSet) Change(com.google.gerrit.entities.Change) CommentInfo(com.google.gerrit.extensions.common.CommentInfo) Test(org.junit.Test) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest)

Example 4 with TestPatchset

use of com.google.gerrit.acceptance.testsuite.change.TestPatchset in project gerrit by GerritCodeReview.

the class PortedCommentsIT method portedCommentHasOriginalPatchsetCommitId.

@Test
public void portedCommentHasOriginalPatchsetCommitId() throws Exception {
    // Set up change and patchsets.
    Change.Id changeId = changeOps.newChange().create();
    TestPatchset patchset1 = changeOps.change(changeId).currentPatchset().get();
    PatchSet.Id patchset2Id = changeOps.change(changeId).newPatchset().create();
    // Add comment.
    String commentUuid = newComment(patchset1.patchsetId()).create();
    CommentInfo portedComment = getPortedComment(patchset2Id, commentUuid);
    assertThat(portedComment).commitId().isEqualTo(patchset1.commitId().name());
}
Also used : TestPatchset(com.google.gerrit.acceptance.testsuite.change.TestPatchset) PatchSet(com.google.gerrit.entities.PatchSet) Change(com.google.gerrit.entities.Change) CommentInfo(com.google.gerrit.extensions.common.CommentInfo) Test(org.junit.Test) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest)

Aggregations

AbstractDaemonTest (com.google.gerrit.acceptance.AbstractDaemonTest)4 TestPatchset (com.google.gerrit.acceptance.testsuite.change.TestPatchset)4 Change (com.google.gerrit.entities.Change)4 PatchSet (com.google.gerrit.entities.PatchSet)4 CommentInfo (com.google.gerrit.extensions.common.CommentInfo)4 Test (org.junit.Test)4