diff options
author | Frank Becker | 2012-05-23 18:08:45 +0000 |
---|---|---|
committer | Frank Becker | 2012-05-24 18:48:20 +0000 |
commit | fe4d9a54c723e0334b28a0af6ab68da1907a5bf2 (patch) | |
tree | c8de8659aad00d0c43e3cbf6542b6449386ad6dc /org.eclipse.mylyn.bugzilla.tests | |
parent | 579b730e415b28a00596365d3bd6b759a84f9ef4 (diff) | |
download | org.eclipse.mylyn.tasks-fe4d9a54c723e0334b28a0af6ab68da1907a5bf2.tar.gz org.eclipse.mylyn.tasks-fe4d9a54c723e0334b28a0af6ab68da1907a5bf2.tar.xz org.eclipse.mylyn.tasks-fe4d9a54c723e0334b28a0af6ab68da1907a5bf2.zip |
ASSIGNED - bug 358682: Target Milestone no longer appears when creating
a bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=358682
Change-Id: Id11e04b113a2bc93bf8f86bca412e6a3d545f48e
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.tests')
-rw-r--r-- | org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskDataHandlerTest.java | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskDataHandlerTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskDataHandlerTest.java index e976c2dfb..06381dbb3 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskDataHandlerTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskDataHandlerTest.java @@ -14,8 +14,11 @@ package org.eclipse.mylyn.bugzilla.tests; import junit.framework.TestCase; import org.eclipse.mylyn.bugzilla.tests.support.BugzillaFixture; +import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel; import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute; +import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient; import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector; +import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; import org.eclipse.mylyn.internal.tasks.core.DefaultTaskMapping; import org.eclipse.mylyn.tasks.core.ITaskMapping; import org.eclipse.mylyn.tasks.core.TaskMapping; @@ -24,7 +27,6 @@ import org.eclipse.mylyn.tasks.core.data.AbstractTaskDataHandler; import org.eclipse.mylyn.tasks.core.data.TaskAttribute; import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper; import org.eclipse.mylyn.tasks.core.data.TaskData; -import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel; /** * @author Frank Becker @@ -36,9 +38,12 @@ public class BugzillaTaskDataHandlerTest extends TestCase { private BugzillaRepositoryConnector connector; + private BugzillaClient client; + @Override public void setUp() throws Exception { repository = BugzillaFixture.current().repository(); + client = BugzillaFixture.current().client(); connector = BugzillaFixture.current().connector(); } @@ -95,4 +100,30 @@ public class BugzillaTaskDataHandlerTest extends TestCase { assertTrue(taskDataHandler.initializeTaskData(repository, taskData, taskMappingSelect, null)); } + public void testPropertyTargetMilestoneUndefined() throws Exception { + AbstractTaskDataHandler taskDataHandler = connector.getTaskDataHandler(); + repository.removeProperty(IBugzillaConstants.BUGZILLA_PARAM_USETARGETMILESTONE); + TaskAttributeMapper mapper = taskDataHandler.getAttributeMapper(repository); + TaskData taskData = new TaskData(mapper, repository.getConnectorKind(), repository.getRepositoryUrl(), ""); + assertTrue(taskDataHandler.initializeTaskData(repository, taskData, null, null)); + assertNotNull(taskData.getRoot().getAttribute(BugzillaAttribute.TARGET_MILESTONE.getKey())); + } + + public void testPropertyTargetMilestoneTrue() throws Exception { + AbstractTaskDataHandler taskDataHandler = connector.getTaskDataHandler(); + repository.setProperty(IBugzillaConstants.BUGZILLA_PARAM_USETARGETMILESTONE, Boolean.TRUE.toString()); + TaskAttributeMapper mapper = taskDataHandler.getAttributeMapper(repository); + TaskData taskData = new TaskData(mapper, repository.getConnectorKind(), repository.getRepositoryUrl(), ""); + assertTrue(taskDataHandler.initializeTaskData(repository, taskData, null, null)); + assertNotNull(taskData.getRoot().getAttribute(BugzillaAttribute.TARGET_MILESTONE.getKey())); + } + + public void testPropertyTargetMilestoneFalse() throws Exception { + AbstractTaskDataHandler taskDataHandler = connector.getTaskDataHandler(); + repository.setProperty(IBugzillaConstants.BUGZILLA_PARAM_USETARGETMILESTONE, Boolean.FALSE.toString()); + TaskAttributeMapper mapper = taskDataHandler.getAttributeMapper(repository); + TaskData taskData = new TaskData(mapper, repository.getConnectorKind(), repository.getRepositoryUrl(), ""); + assertTrue(taskDataHandler.initializeTaskData(repository, taskData, null, null)); + assertNull(taskData.getRoot().getAttribute(BugzillaAttribute.TARGET_MILESTONE.getKey())); + } } |