Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrelves2008-06-13 20:26:36 +0000
committerrelves2008-06-13 20:26:36 +0000
commitd2a0d7a2cf7310e2b7d2a38238fcb27ff58838f4 (patch)
treecf0b78e2af0600420f8c66a054c739427baa7b34 /org.eclipse.mylyn.bugzilla.tests
parent5e18646afbd6948395dda4ed27041a6e92fe3bca (diff)
downloadorg.eclipse.mylyn.tasks-d2a0d7a2cf7310e2b7d2a38238fcb27ff58838f4.tar.gz
org.eclipse.mylyn.tasks-d2a0d7a2cf7310e2b7d2a38238fcb27ff58838f4.tar.xz
org.eclipse.mylyn.tasks-d2a0d7a2cf7310e2b7d2a38238fcb27ff58838f4.zip
NEW - bug 237140: remove deprecated code from Bugzilla
https://bugs.eclipse.org/bugs/show_bug.cgi?id=237140
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.tests')
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/com/eclipse/mylyn/bugzilla/deprecated/BugzillaStackTraceDuplicateDetector.java1
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/com/eclipse/mylyn/bugzilla/deprecated/BugzillaTaskEditor.java1
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/com/eclipse/mylyn/bugzilla/deprecated/BugzillaTaskEditorFactory.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/com/eclipse/mylyn/bugzilla/deprecated/DuplicateDetetionTest.java23
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/com/eclipse/mylyn/bugzilla/deprecated/NewBugWizardTest.java63
6 files changed, 53 insertions, 41 deletions
diff --git a/org.eclipse.mylyn.bugzilla.tests/META-INF/MANIFEST.MF b/org.eclipse.mylyn.bugzilla.tests/META-INF/MANIFEST.MF
index b4e80aa38..2160cc8df 100644
--- a/org.eclipse.mylyn.bugzilla.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.bugzilla.tests/META-INF/MANIFEST.MF
@@ -24,7 +24,9 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.search,
org.eclipse.mylyn.commons.net,
org.eclipse.mylyn.bugzilla.ide,
- org.eclipse.mylyn.commons.ui
+ org.eclipse.mylyn.commons.ui,
+ org.eclipse.compare;bundle-version="3.4.0",
+ org.eclipse.mylyn.commons.core;bundle-version="3.0.0"
Bundle-ActivationPolicy: lazy
Bundle-Vendor: Eclipse.org
Bundle-ClassPath: bugzilla-test.jar
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/com/eclipse/mylyn/bugzilla/deprecated/BugzillaStackTraceDuplicateDetector.java b/org.eclipse.mylyn.bugzilla.tests/src/com/eclipse/mylyn/bugzilla/deprecated/BugzillaStackTraceDuplicateDetector.java
index 53e5d7f69..5c6124554 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/com/eclipse/mylyn/bugzilla/deprecated/BugzillaStackTraceDuplicateDetector.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/com/eclipse/mylyn/bugzilla/deprecated/BugzillaStackTraceDuplicateDetector.java
@@ -13,6 +13,7 @@ import java.net.URLEncoder;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;
+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;
import org.eclipse.mylyn.internal.tasks.core.deprecated.AbstractLegacyDuplicateDetector;
import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData;
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/com/eclipse/mylyn/bugzilla/deprecated/BugzillaTaskEditor.java b/org.eclipse.mylyn.bugzilla.tests/src/com/eclipse/mylyn/bugzilla/deprecated/BugzillaTaskEditor.java
index 33204ad37..b786c6e22 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/com/eclipse/mylyn/bugzilla/deprecated/BugzillaTaskEditor.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/com/eclipse/mylyn/bugzilla/deprecated/BugzillaTaskEditor.java
@@ -36,6 +36,7 @@ import org.eclipse.mylyn.internal.bugzilla.core.BugzillaOperation;
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration;
import org.eclipse.mylyn.internal.bugzilla.ui.BugzillaUiPlugin;
+import org.eclipse.mylyn.internal.bugzilla.ui.editor.KeywordsDialog;
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
import org.eclipse.mylyn.internal.provisional.commons.ui.DatePicker;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/com/eclipse/mylyn/bugzilla/deprecated/BugzillaTaskEditorFactory.java b/org.eclipse.mylyn.bugzilla.tests/src/com/eclipse/mylyn/bugzilla/deprecated/BugzillaTaskEditorFactory.java
index 1b0f1d757..e56367f62 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/com/eclipse/mylyn/bugzilla/deprecated/BugzillaTaskEditorFactory.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/com/eclipse/mylyn/bugzilla/deprecated/BugzillaTaskEditorFactory.java
@@ -9,8 +9,6 @@
package com.eclipse.mylyn.bugzilla.deprecated;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
-import org.eclipse.mylyn.internal.bugzilla.ui.editor.BugzillaTaskEditor;
-import org.eclipse.mylyn.internal.bugzilla.ui.editor.NewBugzillaTaskEditor;
import org.eclipse.mylyn.internal.tasks.ui.deprecated.AbstractRepositoryTaskEditor;
import org.eclipse.mylyn.internal.tasks.ui.deprecated.AbstractTaskEditorFactory;
import org.eclipse.mylyn.internal.tasks.ui.deprecated.RepositoryTaskEditorInput;
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/com/eclipse/mylyn/bugzilla/deprecated/DuplicateDetetionTest.java b/org.eclipse.mylyn.bugzilla.tests/src/com/eclipse/mylyn/bugzilla/deprecated/DuplicateDetetionTest.java
index 889e80747..947c14aa3 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/com/eclipse/mylyn/bugzilla/deprecated/DuplicateDetetionTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/com/eclipse/mylyn/bugzilla/deprecated/DuplicateDetetionTest.java
@@ -12,7 +12,6 @@ import junit.framework.TestCase;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
-import org.eclipse.mylyn.internal.bugzilla.ui.editor.NewBugzillaTaskEditor;
import org.eclipse.mylyn.internal.tasks.core.deprecated.AbstractLegacyDuplicateDetector;
import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
@@ -23,7 +22,6 @@ import org.eclipse.mylyn.tasks.ui.editors.TaskEditor;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
-
/**
* @author Jeff Pound
*/
@@ -95,7 +93,8 @@ public class DuplicateDetetionTest extends TestCase {
TaskEditor taskEditor = (TaskEditor) page.getActiveEditor();
NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance();
- assertEquals(stackTrace, AbstractLegacyDuplicateDetector.getStackTraceFromDescription(model.getDescription()).trim());
+ assertEquals(stackTrace, AbstractLegacyDuplicateDetector.getStackTraceFromDescription(model.getDescription())
+ .trim());
editor.markDirty(false);
editor.close();
@@ -124,7 +123,8 @@ public class DuplicateDetetionTest extends TestCase {
TaskEditor taskEditor = (TaskEditor) page.getActiveEditor();
NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance();
- assertEquals(stackTrace, AbstractLegacyDuplicateDetector.getStackTraceFromDescription(model.getDescription()).trim());
+ assertEquals(stackTrace, AbstractLegacyDuplicateDetector.getStackTraceFromDescription(model.getDescription())
+ .trim());
editor.markDirty(false);
editor.close();
@@ -154,7 +154,8 @@ public class DuplicateDetetionTest extends TestCase {
TaskEditor taskEditor = (TaskEditor) page.getActiveEditor();
NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance();
- assertEquals(stackTrace, AbstractLegacyDuplicateDetector.getStackTraceFromDescription(model.getDescription()).trim());
+ assertEquals(stackTrace, AbstractLegacyDuplicateDetector.getStackTraceFromDescription(model.getDescription())
+ .trim());
editor.markDirty(false);
editor.close();
@@ -180,7 +181,8 @@ public class DuplicateDetetionTest extends TestCase {
TaskEditor taskEditor = (TaskEditor) page.getActiveEditor();
NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance();
- assertEquals(stackTrace, AbstractLegacyDuplicateDetector.getStackTraceFromDescription(model.getDescription()).trim());
+ assertEquals(stackTrace, AbstractLegacyDuplicateDetector.getStackTraceFromDescription(model.getDescription())
+ .trim());
editor.markDirty(false);
editor.close();
@@ -204,7 +206,8 @@ public class DuplicateDetetionTest extends TestCase {
TaskEditor taskEditor = (TaskEditor) page.getActiveEditor();
NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance();
- assertEquals(stackTrace, AbstractLegacyDuplicateDetector.getStackTraceFromDescription(model.getDescription()).trim());
+ assertEquals(stackTrace, AbstractLegacyDuplicateDetector.getStackTraceFromDescription(model.getDescription())
+ .trim());
editor.markDirty(false);
editor.close();
@@ -231,7 +234,8 @@ public class DuplicateDetetionTest extends TestCase {
TaskEditor taskEditor = (TaskEditor) page.getActiveEditor();
NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance();
- assertEquals(stackTrace, AbstractLegacyDuplicateDetector.getStackTraceFromDescription(model.getDescription()).trim());
+ assertEquals(stackTrace, AbstractLegacyDuplicateDetector.getStackTraceFromDescription(model.getDescription())
+ .trim());
editor.markDirty(false);
editor.close();
@@ -256,7 +260,8 @@ public class DuplicateDetetionTest extends TestCase {
TaskEditor taskEditor = (TaskEditor) page.getActiveEditor();
NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance();
- assertEquals(stackTrace, AbstractLegacyDuplicateDetector.getStackTraceFromDescription(model.getDescription()).trim());
+ assertEquals(stackTrace, AbstractLegacyDuplicateDetector.getStackTraceFromDescription(model.getDescription())
+ .trim());
editor.markDirty(false);
editor.close();
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/com/eclipse/mylyn/bugzilla/deprecated/NewBugWizardTest.java b/org.eclipse.mylyn.bugzilla.tests/src/com/eclipse/mylyn/bugzilla/deprecated/NewBugWizardTest.java
index b7f3f4437..f1fbb126d 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/com/eclipse/mylyn/bugzilla/deprecated/NewBugWizardTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/com/eclipse/mylyn/bugzilla/deprecated/NewBugWizardTest.java
@@ -11,15 +11,15 @@ package com.eclipse.mylyn.bugzilla.deprecated;
import junit.framework.TestCase;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
-import org.eclipse.mylyn.internal.tasks.core.deprecated.AbstractLegacyRepositoryConnector;
-import org.eclipse.mylyn.internal.tasks.core.deprecated.AbstractTaskDataHandler;
-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
+import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.TaskRepository;
-
+import org.eclipse.mylyn.tasks.core.data.AbstractTaskDataHandler;
+import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
+import org.eclipse.mylyn.tasks.core.data.TaskData;
/**
* @author Mik Kersten
@@ -29,61 +29,66 @@ public class NewBugWizardTest extends TestCase {
public void testPlatformOptions() throws Exception {
- RepositoryTaskData newReport = new RepositoryTaskData(new BugzillaAttributeFactory(),
- BugzillaCorePlugin.CONNECTOR_KIND, IBugzillaConstants.TEST_BUGZILLA_220_URL, "1");
-
TaskRepository repository = new TaskRepository(BugzillaCorePlugin.CONNECTOR_KIND,
IBugzillaConstants.TEST_BUGZILLA_220_URL);
- AbstractLegacyRepositoryConnector connector = (AbstractLegacyRepositoryConnector) TasksUiPlugin.getRepositoryManager()
- .getRepositoryConnector(repository.getConnectorKind());
+ AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(
+ repository.getConnectorKind());
+
+ final TaskAttributeMapper attributeMapper = connector.getTaskDataHandler().getAttributeMapper(repository);
+
+ final TaskData taskData = new TaskData(attributeMapper, BugzillaCorePlugin.CONNECTOR_KIND,
+ repository.getRepositoryUrl(), "1");
+
assertNotNull(connector);
- AbstractTaskDataHandler taskDataHandler = connector.getLegacyTaskDataHandler();
+ AbstractTaskDataHandler taskDataHandler = connector.getTaskDataHandler();
assertNotNull(taskDataHandler);
- taskDataHandler.initializeTaskData(repository, newReport, null);
- BugzillaCorePlugin.getDefault().setPlatformOptions(newReport);
+
+ BugzillaCorePlugin.getDefault().setPlatformOptions(taskData);
String os = Platform.getOS();
if (os.equals("win32")) {
- assertEquals("Windows", newReport.getAttribute(BugzillaAttribute.OP_SYS.getKey()).getValue());
+ assertEquals("Windows", taskData.getRoot().getAttribute(BugzillaAttribute.OP_SYS.getKey()).getValue());
} else if (os.equals("solaris")) {
- assertEquals("Solaris", newReport.getAttribute(BugzillaAttribute.OP_SYS.getKey()).getValue());
+ assertEquals("Solaris", taskData.getRoot().getAttribute(BugzillaAttribute.OP_SYS.getKey()).getValue());
} else if (os.equals("qnx")) {
- assertEquals("QNX-Photon", newReport.getAttribute(BugzillaAttribute.OP_SYS.getKey()).getValue());
+ assertEquals("QNX-Photon", taskData.getRoot().getAttribute(BugzillaAttribute.OP_SYS.getKey()).getValue());
} else if (os.equals("macosx")) {
- assertEquals("Mac OS", newReport.getAttribute(BugzillaAttribute.OP_SYS.getKey()).getValue());
+ assertEquals("Mac OS", taskData.getRoot().getAttribute(BugzillaAttribute.OP_SYS.getKey()).getValue());
} else if (os.equals("linux")) {
- assertEquals("Linux", newReport.getAttribute(BugzillaAttribute.OP_SYS.getKey()).getValue());
+ assertEquals("Linux", taskData.getRoot().getAttribute(BugzillaAttribute.OP_SYS.getKey()).getValue());
} else if (os.equals("hpux")) {
- assertEquals("HP-UX", newReport.getAttribute(BugzillaAttribute.OP_SYS.getKey()).getValue());
+ assertEquals("HP-UX", taskData.getRoot().getAttribute(BugzillaAttribute.OP_SYS.getKey()).getValue());
} else if (os.equals("aix")) {
- assertEquals("AIX", newReport.getAttribute(BugzillaAttribute.OP_SYS.getKey()).getValue());
+ assertEquals("AIX", taskData.getRoot().getAttribute(BugzillaAttribute.OP_SYS.getKey()).getValue());
}
String platform = Platform.getOSArch();
if (platform.equals("x86")) {
if (os.equals("macosx")) {
- assertEquals("Macintosh", newReport.getAttribute(BugzillaAttribute.REP_PLATFORM.getKey())
+ assertEquals("Macintosh", taskData.getRoot()
+ .getAttribute(BugzillaAttribute.REP_PLATFORM.getKey())
.getValue());
} else {
- assertEquals("PC", newReport.getAttribute(BugzillaAttribute.REP_PLATFORM.getKey()).getValue());
+ assertEquals("PC", taskData.getRoot().getAttribute(BugzillaAttribute.REP_PLATFORM.getKey()).getValue());
}
} else if (platform.equals("x86_64")) {
- assertEquals("PC", newReport.getAttribute(BugzillaAttribute.REP_PLATFORM.getKey()).getValue());
+ assertEquals("PC", taskData.getRoot().getAttribute(BugzillaAttribute.REP_PLATFORM.getKey()).getValue());
} else if (platform.equals("ia64")) {
- assertEquals("PC", newReport.getAttribute(BugzillaAttribute.REP_PLATFORM.getKey()).getValue());
+ assertEquals("PC", taskData.getRoot().getAttribute(BugzillaAttribute.REP_PLATFORM.getKey()).getValue());
} else if (platform.equals("ia64_32")) {
- assertEquals("PC", newReport.getAttribute(BugzillaAttribute.REP_PLATFORM.getKey()).getValue());
+ assertEquals("PC", taskData.getRoot().getAttribute(BugzillaAttribute.REP_PLATFORM.getKey()).getValue());
} else if (platform.equals("sparc")) {
- assertEquals("Sun", newReport.getAttribute(BugzillaAttribute.REP_PLATFORM.getKey()).getValue());
+ assertEquals("Sun", taskData.getRoot().getAttribute(BugzillaAttribute.REP_PLATFORM.getKey()).getValue());
} else if (platform.equals("ppc")) {
if (os.equals("macosx")) {
- assertEquals("Macintosh", newReport.getAttribute(BugzillaAttribute.REP_PLATFORM.getKey())
+ assertEquals("Macintosh", taskData.getRoot()
+ .getAttribute(BugzillaAttribute.REP_PLATFORM.getKey())
.getValue());
} else {
- assertEquals("Power", newReport.getAttribute(BugzillaAttribute.REP_PLATFORM.getKey())
+ assertEquals("Power", taskData.getRoot()
+ .getAttribute(BugzillaAttribute.REP_PLATFORM.getKey())
.getValue());
}
}
}
-
}

Back to the top