Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2007-03-08 00:39:53 -0500
committerspingel2007-03-08 00:39:53 -0500
commitf9f43cca24f42cad79e3643e6e479e32a194fa4f (patch)
treeb099cb9c9aa293c019d5f36edb54fb45f2dbf72a /org.eclipse.mylyn.trac.tests
parentdaf99fc6225a98197fac5e7ee8e10ff8efeb18e0 (diff)
downloadorg.eclipse.mylyn.tasks-f9f43cca24f42cad79e3643e6e479e32a194fa4f.tar.gz
org.eclipse.mylyn.tasks-f9f43cca24f42cad79e3643e6e479e32a194fa4f.tar.xz
org.eclipse.mylyn.tasks-f9f43cca24f42cad79e3643e6e479e32a194fa4f.zip
NEW - bug 176566: Hyperlinking support for Trac
https://bugs.eclipse.org/bugs/show_bug.cgi?id=176566
Diffstat (limited to 'org.eclipse.mylyn.trac.tests')
-rw-r--r--org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkDetectorTest.java37
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java3
3 files changed, 43 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF b/org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF
index 48ba04ca3..c32d1a5e2 100644
--- a/org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF
@@ -13,7 +13,9 @@ Require-Bundle: org.junit,
org.eclipse.mylar.trac.ui,
org.eclipse.mylar.trac.core,
org.eclipse.search,
- org.eclipse.mylar
+ org.eclipse.mylar,
+ org.eclipse.ui.workbench.texteditor,
+ org.eclipse.jface.text
Export-Package: org.eclipse.mylar.trac.tests
Bundle-Activator: org.eclipse.mylar.trac.tests.TracTestPlugin
Eclipse-LazyStart: true
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"));
+// }
+
+}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java
index d137a714f..1ad703b3f 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/AllTracTests.java
@@ -14,6 +14,8 @@ package org.eclipse.mylar.trac.tests;
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.eclipse.mylar.internal.trac.ui.TracHyperlinkDetectorTest;
+
/**
* @author Mik Kersten
* @author Steffen Pingel
@@ -44,6 +46,7 @@ public class AllTracTests {
suite.addTestSuite(TracQueryHitTest.class);
suite.addTestSuite(TracRepositorySettingsPageTest.class);
suite.addTestSuite(TracClientProxyTest.class);
+ suite.addTestSuite(TracHyperlinkDetectorTest.class);
// $JUnit-END$
return suite;
}

Back to the top