Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Parker2013-02-02 23:19:36 +0000
committerMiles Parker2013-02-05 18:44:09 +0000
commit391a1f6f8c836ad27a0fe884508cc779376dd247 (patch)
tree882b7282c2b95c284140d68418ff6b7ec7749d06 /org.eclipse.mylyn.gerrit.ui.tests
parent1ec8ecdb68d7a64481a3eec49a16a7fe06baf528 (diff)
downloadorg.eclipse.mylyn.reviews-391a1f6f8c836ad27a0fe884508cc779376dd247.tar.gz
org.eclipse.mylyn.reviews-391a1f6f8c836ad27a0fe884508cc779376dd247.tar.xz
org.eclipse.mylyn.reviews-391a1f6f8c836ad27a0fe884508cc779376dd247.zip
386705: expand patch set when hyperlink clicked
Change-Id: I3b61060d9bee2dc8f039fcd071d2540792525d0e Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=386705
Diffstat (limited to 'org.eclipse.mylyn.gerrit.ui.tests')
-rw-r--r--org.eclipse.mylyn.gerrit.ui.tests/src/org/eclipse/mylyn/internal/gerrit/ui/GerritUrlHandlerTest.java49
1 files changed, 48 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.gerrit.ui.tests/src/org/eclipse/mylyn/internal/gerrit/ui/GerritUrlHandlerTest.java b/org.eclipse.mylyn.gerrit.ui.tests/src/org/eclipse/mylyn/internal/gerrit/ui/GerritUrlHandlerTest.java
index 712d138bf..1c202df33 100644
--- a/org.eclipse.mylyn.gerrit.ui.tests/src/org/eclipse/mylyn/internal/gerrit/ui/GerritUrlHandlerTest.java
+++ b/org.eclipse.mylyn.gerrit.ui.tests/src/org/eclipse/mylyn/internal/gerrit/ui/GerritUrlHandlerTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Tasktop Technologies and others.
+1 * Copyright (c) 2012 Tasktop Technologies and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -96,4 +96,51 @@ public class GerritUrlHandlerTest {
assertEquals("4698", handler.getTaskId(repository, "http://review.mylyn.org/#/c/4698/5/foo/bar"));
}
+ @Test
+ public void testGetPatchSetNumberPatchSet() {
+ TaskRepository repository = new TaskRepository(GerritConnector.CONNECTOR_KIND, "http://review.mylyn.org/");
+ String url = "http://review.mylyn.org/#/c/4698/5";
+ String taskId = handler.getTaskId(repository, url);
+ assertEquals(5, handler.getPatchSetNumber(repository, url, taskId));
+ }
+
+ @Test
+ public void testGetPatchSetNumberPatchSetTrailingSlash() {
+ TaskRepository repository = new TaskRepository(GerritConnector.CONNECTOR_KIND, "http://review.mylyn.org/");
+ String url = "http://review.mylyn.org/#/c/4698/5/";
+ String taskId = handler.getTaskId(repository, url);
+ assertEquals(5, handler.getPatchSetNumber(repository, url, taskId));
+ }
+
+ @Test
+ public void testGetPatchSetNumberPatchSetFile() {
+ TaskRepository repository = new TaskRepository(GerritConnector.CONNECTOR_KIND, "http://review.mylyn.org/");
+ String url = "http://review.mylyn.org/#/c/4698/5/foo/bar";
+ String taskId = handler.getTaskId(repository, url);
+ assertEquals(5, handler.getPatchSetNumber(repository, url, taskId));
+ }
+
+ @Test
+ public void testGetPatchSetNumberNoneSpecified() {
+ TaskRepository repository = new TaskRepository(GerritConnector.CONNECTOR_KIND, "http://review.mylyn.org/");
+ String url = "http://review.mylyn.org/#/c/4698";
+ String taskId = handler.getTaskId(repository, url);
+ assertEquals(-1, handler.getPatchSetNumber(repository, url, taskId));
+ }
+
+ @Test
+ public void testGetPatchSetNumberNoneSpecifiedTrailingSlash() {
+ TaskRepository repository = new TaskRepository(GerritConnector.CONNECTOR_KIND, "http://review.mylyn.org/");
+ String url = "http://review.mylyn.org/#/c/4698/";
+ String taskId = handler.getTaskId(repository, url);
+ assertEquals(-1, handler.getPatchSetNumber(repository, url, taskId));
+ }
+
+ @Test
+ public void testGetPatchSetNumberNoneSpecifiedNotAnInteger() {
+ TaskRepository repository = new TaskRepository(GerritConnector.CONNECTOR_KIND, "http://review.mylyn.org/");
+ String url = "http://review.mylyn.org/#/c/A1";
+ String taskId = handler.getTaskId(repository, url);
+ assertEquals(-1, handler.getPatchSetNumber(repository, url, taskId));
+ }
}

Back to the top