Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2009-06-22 06:28:49 +0000
committerspingel2009-06-22 06:28:49 +0000
commit0e29c447583dd6c2a4b9298cc8c1822156786140 (patch)
tree67138178ffe2f96df61cf825b0f1bcf30cc49918 /org.eclipse.mylyn.trac.tests
parente0b64f228f16cca9aa66bf072767d62df4e7ffb1 (diff)
downloadorg.eclipse.mylyn.tasks-0e29c447583dd6c2a4b9298cc8c1822156786140.tar.gz
org.eclipse.mylyn.tasks-0e29c447583dd6c2a4b9298cc8c1822156786140.tar.xz
org.eclipse.mylyn.tasks-0e29c447583dd6c2a4b9298cc8c1822156786140.zip
NEW - bug 274761: honor default attribute values from Trac repository
https://bugs.eclipse.org/bugs/show_bug.cgi?id=274761
Diffstat (limited to 'org.eclipse.mylyn.trac.tests')
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerTest.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerTest.java
index ee6088b0f..4c2e6bcb0 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerTest.java
@@ -43,6 +43,7 @@ import org.eclipse.mylyn.internal.trac.core.util.TracUtil;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskAttachment;
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
+import org.eclipse.mylyn.tasks.core.TaskMapping;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.AbstractTaskAttachmentHandler;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
@@ -404,4 +405,40 @@ public class TracTaskDataHandlerTest extends TestCase {
return subTaskIds;
}
+ public void testInitializeTaskData_0_10() throws Exception {
+ init(TracTestConstants.TEST_TRAC_010_URL, Version.XML_RPC);
+ initializeTaskData();
+ }
+
+ public void testInitializeTaskData_0_11() throws Exception {
+ init(TracTestConstants.TEST_TRAC_011_URL, Version.XML_RPC);
+ initializeTaskData();
+ }
+
+ private void initializeTaskData() throws Exception {
+ TaskData taskData = new TaskData(taskDataHandler.getAttributeMapper(repository), TracCorePlugin.CONNECTOR_KIND,
+ "", "");
+ TaskMapping mapping = new TaskMapping() {
+ @Override
+ public String getDescription() {
+ return "description";
+ }
+
+ @Override
+ public String getSummary() {
+ return "summary";
+ }
+ };
+ taskDataHandler.initializeTaskData(repository, taskData, mapping, new NullProgressMonitor());
+ // initializeTaskData() should ignore the initialization data
+ TaskMapper mapper = new TracTaskMapper(taskData, null);
+ assertEquals("", mapper.getSummary());
+ assertEquals("", mapper.getDescription());
+ // check for default values
+ assertEquals("Defect", mapper.getTaskKind());
+ assertEquals("major", mapper.getPriority());
+ // empty attributes should not exist
+ assertNull(taskData.getRoot().getAttribute(TracAttribute.SEVERITY.getTracKey()));
+ }
+
}

Back to the top