Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/internal/trac')
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkDetectorTest.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkDetectorTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkDetectorTest.java
new file mode 100644
index 000000000..77d3db6c9
--- /dev/null
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkDetectorTest.java
@@ -0,0 +1,37 @@
+package org.eclipse.mylar.internal.trac.ui;
+
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.mylar.internal.trac.core.TracCorePlugin;
+import org.eclipse.mylar.tasks.core.TaskRepository;
+
+import junit.framework.TestCase;
+
+public class TracHyperlinkDetectorTest extends TestCase {
+
+ private TracHyperlinkDetector detector;
+ private TaskRepository repository;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ repository = new TaskRepository(TracCorePlugin.REPOSITORY_KIND, "http://localhost/");
+ detector = new TracHyperlinkDetector();
+ }
+
+ public void testFindHyperlinks1() {
+ IHyperlink[] links = detector.findHyperlinks(repository, "#11", 0, 0);
+ assertNotNull(links);
+ assertEquals(1, links.length);
+ assertTrue(links[0].getHyperlinkText().endsWith(" 11"));
+ }
+
+// public void testFindHyperlinks2() {
+// IHyperlink[] links = detector.findHyperlinks(repository, "#11, #1", 0, 0);
+// assertNotNull(links);
+// assertEquals(2, links.length);
+// assertTrue(links[0].getHyperlinkText().endsWith(" 11"));
+// assertTrue(links[0].getHyperlinkText().endsWith(" 1"));
+// }
+
+}

Back to the top