Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Ehrnhoefer2011-11-27 19:00:31 +0000
committerSteffen Pingel2011-11-27 19:00:31 +0000
commitdca8657902a64a5a9d273dc2beb51cf928cfb840 (patch)
tree68dc8e5ea6c68c1d12cffd0ca566bb3677ec6853 /org.eclipse.mylyn.tasks.tests/src
parenta471ecb8a423d0327c82d8a132945bf61d4901ac (diff)
downloadorg.eclipse.mylyn.tasks-dca8657902a64a5a9d273dc2beb51cf928cfb840.tar.gz
org.eclipse.mylyn.tasks-dca8657902a64a5a9d273dc2beb51cf928cfb840.tar.xz
org.eclipse.mylyn.tasks-dca8657902a64a5a9d273dc2beb51cf928cfb840.zip
NEW - bug 353433: [patch] Copy Details - URL should falls back to
connector.getTaskUrl if no taskUrl in ITask https://bugs.eclipse.org/bugs/show_bug.cgi?id=353433
Diffstat (limited to 'org.eclipse.mylyn.tasks.tests/src')
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java
index 508d25eb5..823e7552c 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java
@@ -13,11 +13,17 @@ package org.eclipse.mylyn.tasks.tests;
import junit.framework.TestCase;
+import org.eclipse.mylyn.internal.provisional.commons.ui.ClipboardCopier;
+import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager;
import org.eclipse.mylyn.internal.tasks.ui.actions.CopyTaskDetailsAction;
+import org.eclipse.mylyn.internal.tasks.ui.actions.CopyTaskDetailsAction.Mode;
+import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryConnector;
import org.eclipse.mylyn.tasks.tests.connector.MockTask;
+import org.eclipse.mylyn.tasks.ui.TasksUi;
/**
* @author Steffen Pingel
+ * @author Thomas Ehrnhoefer
*/
public class CopyDetailsActionTest extends TestCase {
@@ -59,4 +65,19 @@ public class CopyDetailsActionTest extends TestCase {
assertEquals("abc", CopyTaskDetailsAction.getTextForTask(task));
}
+ public void testGetSummaryAndUrl() {
+ MockTask task = new MockTask("321");
+ task.setSummary("s321");
+ task.setTaskKey("321");
+ MockRepositoryConnector connector = new MockRepositoryConnector() {
+ @Override
+ public String getTaskUrl(String repositoryUrl, String taskId) {
+ return "http://321.com";
+ }
+ };
+ ((TaskRepositoryManager) TasksUi.getRepositoryManager()).addRepositoryConnector(connector);
+ assertEquals("321: s321" + ClipboardCopier.LINE_SEPARATOR + "http://321.com",
+ CopyTaskDetailsAction.getTextForTask(task, Mode.SUMMARY_URL));
+ }
+
}

Back to the top