summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Zarna2013-07-15 08:32:09 (EDT)
committerGerrit Code Review @ Eclipse.org2013-07-15 21:23:12 (EDT)
commit9ff2036321263f7e444884fe23bdd74b0921fae3 (patch)
treed0eb6f0566064696bc647384267adca812815448
parent70b66a7e31cca2979b802a231be70b231a283892 (diff)
downloadorg.eclipse.mylyn.reviews-9ff2036321263f7e444884fe23bdd74b0921fae3.zip
org.eclipse.mylyn.reviews-9ff2036321263f7e444884fe23bdd74b0921fae3.tar.gz
org.eclipse.mylyn.reviews-9ff2036321263f7e444884fe23bdd74b0921fae3.tar.bz2
add a test for abandoning a Changerefs/changes/59/14559/2
Change-Id: I081137c5337dc29ba9e2bb1fb4adbbb28f032093 Signed-off-by: Tomasz Zarna <tomasz.zarna@tasktop.com>
-rw-r--r--org.eclipse.mylyn.gerrit.tests/src/org/eclipse/mylyn/internal/gerrit/core/remote/GerritReviewRemoteFactoryTest.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.gerrit.tests/src/org/eclipse/mylyn/internal/gerrit/core/remote/GerritReviewRemoteFactoryTest.java b/org.eclipse.mylyn.gerrit.tests/src/org/eclipse/mylyn/internal/gerrit/core/remote/GerritReviewRemoteFactoryTest.java
index c668581..9cfdf50 100644
--- a/org.eclipse.mylyn.gerrit.tests/src/org/eclipse/mylyn/internal/gerrit/core/remote/GerritReviewRemoteFactoryTest.java
+++ b/org.eclipse.mylyn.gerrit.tests/src/org/eclipse/mylyn/internal/gerrit/core/remote/GerritReviewRemoteFactoryTest.java
@@ -28,6 +28,7 @@ import java.util.Map.Entry;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jgit.api.CommitCommand;
import org.eclipse.mylyn.gerrit.tests.support.GerritProject.CommitResult;
import org.eclipse.mylyn.internal.gerrit.core.client.GerritChange;
@@ -198,4 +199,20 @@ public class GerritReviewRemoteFactoryTest extends GerritRemoteTest {
assertThat(childChange.getSubject(), is(reviewDep1.getSubject()));
assertThat(childChange.getModificationDate(), is(reviewDep1.getModificationDate()));
}
+
+ @Test
+ public void testAbandonChange() throws Exception {
+ String message1 = "abandon, time: " + System.currentTimeMillis(); //$NON-NLS-1$
+
+ reviewHarness.client.abandon(reviewHarness.shortId, 1, message1, new NullProgressMonitor());
+ reviewHarness.consumer.retrieve(false);
+ reviewHarness.listener.waitForResponse(2, 2);
+
+ assertThat(getReview().getState(), is(ReviewStatus.ABANDONED));
+ List<IComment> comments = getReview().getComments();
+ assertThat(comments.size(), is(1));
+ IComment lastComment = comments.get(0);
+ assertThat(lastComment.getAuthor().getDisplayName(), is("tests"));
+ assertThat(lastComment.getDescription(), is("Patch Set 1: Abandoned\n\n" + message1));
+ }
}