Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2011-10-14 11:57:45 +0000
committerFrank Becker2011-10-14 11:57:45 +0000
commit5eabc7717f111950dd6caa7e4466cec5916efdc4 (patch)
treed1a908d4e22c92377c4c760ac9827cf761370a01 /org.eclipse.mylyn.bugzilla.tests
parente2a435e29d5b13b405053b9cf4acff524a86eab4 (diff)
parenta0863f60ffb7e98ad3dd9f654538b0dd6b7a053e (diff)
downloadorg.eclipse.mylyn.tasks-5eabc7717f111950dd6caa7e4466cec5916efdc4.tar.gz
org.eclipse.mylyn.tasks-5eabc7717f111950dd6caa7e4466cec5916efdc4.tar.xz
org.eclipse.mylyn.tasks-5eabc7717f111950dd6caa7e4466cec5916efdc4.zip
Merge branch 'master' of ssh://fbecker@git.eclipse.org/gitroot/mylyn/org.eclipse.mylyn.tasks.git
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.tests')
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaRepositoryConnectorStandaloneTest.java4
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaTaskCompletionTest.java14
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java2
3 files changed, 11 insertions, 9 deletions
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaRepositoryConnectorStandaloneTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaRepositoryConnectorStandaloneTest.java
index e3bbdb9c5..854ec4eb0 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaRepositoryConnectorStandaloneTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaRepositoryConnectorStandaloneTest.java
@@ -308,6 +308,7 @@ public class BugzillaRepositoryConnectorStandaloneTest extends TestCase {
assertEquals(PriorityLevel.P3, mapping.getPriorityLevel());
if (!version.isSmaller(BugzillaVersion.BUGZILLA_3_6)) {
// fresh bugzilla 3.6 databases have a new schema for priorities
+ // the value "---" maybe present (as default) so we get P5 or P3 (if not present) as the level
taskData.getRoot().createMappedAttribute(BugzillaAttribute.PRIORITY.getKey()).setValue("Highest");
assertEquals(PriorityLevel.P1, mapping.getPriorityLevel());
taskData.getRoot().createMappedAttribute(BugzillaAttribute.PRIORITY.getKey()).setValue("High");
@@ -319,7 +320,8 @@ public class BugzillaRepositoryConnectorStandaloneTest extends TestCase {
taskData.getRoot().createMappedAttribute(BugzillaAttribute.PRIORITY.getKey()).setValue("Lowest");
assertEquals(PriorityLevel.P5, mapping.getPriorityLevel());
taskData.getRoot().createMappedAttribute(BugzillaAttribute.PRIORITY.getKey()).setValue("---");
- assertEquals(PriorityLevel.P3, mapping.getPriorityLevel());
+ PriorityLevel pl = mapping.getPriorityLevel();
+ assertTrue("P3 or P5 expected! but got " + pl.toString(), pl == PriorityLevel.P3 || pl == PriorityLevel.P5);
taskData.getRoot().createMappedAttribute(BugzillaAttribute.PRIORITY.getKey()).setValue("abc");
assertEquals(PriorityLevel.P3, mapping.getPriorityLevel());
}
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaTaskCompletionTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaTaskCompletionTest.java
index fcbd9504b..865c96245 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaTaskCompletionTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/core/BugzillaTaskCompletionTest.java
@@ -54,10 +54,11 @@ public class BugzillaTaskCompletionTest extends TestCase {
}
public void testCompletionDate() throws Exception {
- TaskTask task = new TaskTask(BugzillaCorePlugin.CONNECTOR_KIND, BugzillaFixture.TEST_BUGZILLA_LATEST_URL, "1");
+ TaskTask task = new TaskTask(BugzillaCorePlugin.CONNECTOR_KIND, BugzillaFixture.current().getRepositoryUrl(),
+ "1");
TaskAttributeMapper mapper = connector.getTaskDataHandler().getAttributeMapper(repository);
- TaskData taskData = new TaskData(mapper, BugzillaCorePlugin.CONNECTOR_KIND,
- BugzillaFixture.TEST_BUGZILLA_LATEST_URL, "1");
+ TaskData taskData = new TaskData(mapper, BugzillaCorePlugin.CONNECTOR_KIND, BugzillaFixture.current()
+ .getRepositoryUrl(), "1");
taskData.getRoot()
.createAttribute(BugzillaAttribute.BUG_STATUS.getKey())
.setValue(IBugzillaConstants.VALUE_STATUS_RESOLVED);
@@ -75,10 +76,11 @@ public class BugzillaTaskCompletionTest extends TestCase {
}
public void testCompletionDateForStates() throws Exception {
- TaskTask task = new TaskTask(BugzillaCorePlugin.CONNECTOR_KIND, BugzillaFixture.TEST_BUGZILLA_LATEST_URL, "1");
+ TaskTask task = new TaskTask(BugzillaCorePlugin.CONNECTOR_KIND, BugzillaFixture.current().getRepositoryUrl(),
+ "1");
TaskAttributeMapper mapper = connector.getTaskDataHandler().getAttributeMapper(repository);
- TaskData taskData = new TaskData(mapper, BugzillaCorePlugin.CONNECTOR_KIND,
- BugzillaFixture.TEST_BUGZILLA_LATEST_URL, "1");
+ TaskData taskData = new TaskData(mapper, BugzillaCorePlugin.CONNECTOR_KIND, BugzillaFixture.current()
+ .getRepositoryUrl(), "1");
TaskAttribute status = taskData.getRoot().createAttribute(BugzillaAttribute.BUG_STATUS.getKey());
status.setValue("REOPENED");
TaskAttribute attrComment = taskData.getRoot().createAttribute(BugzillaAttribute.COMMENTID.getKey());
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java
index 0caaf68db..dd93cf1b7 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/support/BugzillaFixture.java
@@ -58,8 +58,6 @@ public class BugzillaFixture extends TestFixture {
public static final String TEST_BUGZILLA_HEAD_URL = getServerUrl("bugshead");
- public static final String TEST_BUGZILLA_LATEST_URL = TEST_BUGZILLA_36_URL;
-
private static final String getServerUrl(String version) {
return TestConfiguration.getRepositoryUrl(version);
}

Back to the top