Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrelves2007-03-13 01:04:32 -0400
committerrelves2007-03-13 01:04:32 -0400
commit3b6d1281220af170714932cf0824606ab9fbf8f6 (patch)
tree1525fee11c2b8336df6ce1ead2e491aa55b0c5f4 /org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/internal
parent47e70d4e7c805cddd8f99971fb5d0da9d8b04be6 (diff)
downloadorg.eclipse.mylyn.tasks-3b6d1281220af170714932cf0824606ab9fbf8f6.tar.gz
org.eclipse.mylyn.tasks-3b6d1281220af170714932cf0824606ab9fbf8f6.tar.xz
org.eclipse.mylyn.tasks-3b6d1281220af170714932cf0824606ab9fbf8f6.zip
NEW - bug 170679: [api] improve hyperlink detection api
https://bugs.eclipse.org/bugs/show_bug.cgi?id=170679
Diffstat (limited to 'org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/internal')
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkDetectorTest.java36
1 files changed, 22 insertions, 14 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
index 3dd0e7cad..d255f96ae 100644
--- 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
@@ -5,41 +5,49 @@ import junit.framework.TestCase;
import org.eclipse.jface.text.hyperlink.IHyperlink;
import org.eclipse.mylar.internal.trac.core.TracCorePlugin;
import org.eclipse.mylar.tasks.core.TaskRepository;
+import org.eclipse.mylar.tasks.ui.TasksUiPlugin;
import org.eclipse.mylar.tasks.ui.WebHyperlink;
public class TracHyperlinkDetectorTest extends TestCase {
- private TracHyperlinkDetector detector;
+ // private TaskHyperlinkDetector detector;
private TaskRepository repository;
@Override
protected void setUp() throws Exception {
super.setUp();
-
+
repository = new TaskRepository(TracCorePlugin.REPOSITORY_KIND, "http://localhost");
- detector = new TracHyperlinkDetector();
+ // detector = new TaskHyperlinkDetector();
}
-
+
public void testFindHyperlinks1() {
- IHyperlink[] links = detector.findHyperlinks(repository, "#11", 0, 0);
+ IHyperlink[] links = TasksUiPlugin.getRepositoryUi(TracCorePlugin.REPOSITORY_KIND).findHyperlinks(repository,
+ "#11", 0, 0);
+ // 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"));
-// }
+ // 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"));
+ // }
public void testFindWikiHyperlinks1() {
- IHyperlink[] links = detector.findHyperlinks(repository, "[wiki:page]", 0, 0);
+ IHyperlink[] links = TasksUiPlugin.getRepositoryUi(TracCorePlugin.REPOSITORY_KIND).findHyperlinks(repository,
+ "[wiki:page]", 0, 0);
+ // IHyperlink[] links = detector.findHyperlinks(repository,
+ // "[wiki:page]", 0, 0);
assertNotNull(links);
assertEquals(1, links.length);
- assertEquals("http://localhost/wiki/page", ((WebHyperlink)links[0]).getURLString());
+ assertEquals("http://localhost/wiki/page", ((WebHyperlink) links[0]).getURLString());
}
}

Back to the top