Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfbecker2010-05-26 20:52:23 +0000
committerfbecker2010-05-26 20:52:23 +0000
commitc600ebece9a5a456b70fa64d8157221c72b0bd6a (patch)
treec8217d4d89a981a6a0dcad186f789fc7fde6105a
parent540f5b0e1aa97b58ac0e71824da323026d80d335 (diff)
downloadorg.eclipse.mylyn.tasks-c600ebece9a5a456b70fa64d8157221c72b0bd6a.tar.gz
org.eclipse.mylyn.tasks-c600ebece9a5a456b70fa64d8157221c72b0bd6a.tar.xz
org.eclipse.mylyn.tasks-c600ebece9a5a456b70fa64d8157221c72b0bd6a.zip
ASSIGNED - bug 304910: [api] recognize comment#number link on bug editor without bug number too
https://bugs.eclipse.org/bugs/show_bug.cgi?id=304910
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaTaskHyperlinkDetectorTest.java31
1 files changed, 7 insertions, 24 deletions
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaTaskHyperlinkDetectorTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaTaskHyperlinkDetectorTest.java
index 86f8ce0fd..b8b82f4ca 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaTaskHyperlinkDetectorTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaTaskHyperlinkDetectorTest.java
@@ -66,22 +66,6 @@ public class BugzillaTaskHyperlinkDetectorTest extends TestCase {
private final String BUG_FORMAT_1_2 = "bug# 2";
- private final String TASK_FORMAT_1_COMMENT_1 = "task#123c#44556677";
-
- private final String TASK_FORMAT_2_COMMENT_1 = "task# 123c#44556677";
-
- private final String TASK_FORMAT_3_COMMENT_1 = "task123c#44556677";
-
- private final String TASK_FORMAT_4_COMMENT_1 = "task #123c#44556677";
-
- private final String BUG_FORMAT_1_COMMENT_1 = "bug# 123c#44556677";
-
- private final String BUG_FORMAT_2_COMMENT_1 = "bug # 123c#44556677";
-
- private final String BUG_FORMAT_3_COMMENT_1 = "bug123c#44556677";
-
- private final String BUG_FORMAT_4_COMMENT_1 = "bug #123c#44556677";
-
private final String TASK_FORMAT_1_COMMENT_2 = "task#123 comment #44556677";
private final String TASK_FORMAT_2_COMMENT_2 = "task# 123 comment #44556677";
@@ -193,9 +177,7 @@ public class BugzillaTaskHyperlinkDetectorTest extends TestCase {
commentFormats = new String[] { COMMENT_1, COMMENT_2, COMMENT_3, COMMENT_4 };
bugFormats = new String[] { TASK_FORMAT_1, TASK_FORMAT_2, TASK_FORMAT_3, TASK_FORMAT_4, BUG_FORMAT_1,
BUG_FORMAT_2, BUG_FORMAT_3, BUG_FORMAT_4 };
- bugCommentFormats = new String[] { TASK_FORMAT_1_COMMENT_1, TASK_FORMAT_2_COMMENT_1, TASK_FORMAT_3_COMMENT_1,
- TASK_FORMAT_4_COMMENT_1, BUG_FORMAT_1_COMMENT_1, BUG_FORMAT_2_COMMENT_1, BUG_FORMAT_3_COMMENT_1,
- BUG_FORMAT_4_COMMENT_1, TASK_FORMAT_1_COMMENT_2, TASK_FORMAT_2_COMMENT_2, TASK_FORMAT_3_COMMENT_2,
+ bugCommentFormats = new String[] { TASK_FORMAT_1_COMMENT_2, TASK_FORMAT_2_COMMENT_2, TASK_FORMAT_3_COMMENT_2,
TASK_FORMAT_4_COMMENT_2, BUG_FORMAT_1_COMMENT_2, BUG_FORMAT_2_COMMENT_2, BUG_FORMAT_3_COMMENT_2,
BUG_FORMAT_4_COMMENT_2, TASK_FORMAT_1_COMMENT_3, TASK_FORMAT_2_COMMENT_3, TASK_FORMAT_3_COMMENT_3,
TASK_FORMAT_4_COMMENT_3, BUG_FORMAT_1_COMMENT_3, BUG_FORMAT_2_COMMENT_3, BUG_FORMAT_3_COMMENT_3,
@@ -533,7 +515,7 @@ public class BugzillaTaskHyperlinkDetectorTest extends TestCase {
IHyperlink[] links = detector.detectHyperlinks(viewer, region, false);
assertNotNull(links);
assertEquals(1, links.length);
- assertEquals(testString.indexOf(DUPLICATE_NUMBER), links[0].getHyperlinkRegion().getOffset());
+ assertEquals(testString.indexOf(DUPLICATE), links[0].getHyperlinkRegion().getOffset());
}
public void testNoRepositoryInViewNoRepositoryInManager() {
@@ -645,7 +627,7 @@ public class BugzillaTaskHyperlinkDetectorTest extends TestCase {
IHyperlink[] links = detector.detectHyperlinks(viewer, region, false);
assertNotNull(links);
assertEquals(1, links.length);
- assertEquals(testString.indexOf(ATTACHMENT_NUMBER), links[0].getHyperlinkRegion().getOffset());
+ assertEquals(testString.indexOf(ATTACHMENT_OLD), links[0].getHyperlinkRegion().getOffset());
}
public void testAttachmentNew() {
@@ -655,7 +637,7 @@ public class BugzillaTaskHyperlinkDetectorTest extends TestCase {
IHyperlink[] links = detector.detectHyperlinks(viewer, region, false);
assertNotNull(links);
assertEquals(1, links.length);
- assertEquals(testString.indexOf(ATTACHMENT_NUMBER), links[0].getHyperlinkRegion().getOffset());
+ assertEquals(testString.indexOf(ATTACHMENT_NEW), links[0].getHyperlinkRegion().getOffset());
}
public void testCommentLotsOfWhitespace() {
@@ -664,8 +646,9 @@ public class BugzillaTaskHyperlinkDetectorTest extends TestCase {
Region region = new Region(0, testString.length());
IHyperlink[] links = detector.detectHyperlinks(viewer, region, false);
assertNotNull(links);
- assertEquals(1, links.length);
- assertEquals(testString.indexOf(ATTACHMENT_NUMBER), links[0].getHyperlinkRegion().getOffset());
+ assertEquals(2, links.length);
+ assertEquals(testString.indexOf("bug 123"), links[0].getHyperlinkRegion().getOffset());
+ assertEquals(testString.indexOf("bug 245 comment 1"), links[1].getHyperlinkRegion().getOffset());
}
}

Back to the top