Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2011-08-28 21:58:12 +0000
committerSteffen Pingel2011-08-28 21:58:12 +0000
commit10f5d7510ce301f41ea71f1ff7db9a05375708d6 (patch)
treef0890f3c88d588eb44e096e9b6d6eff9b69ea939 /org.eclipse.mylyn.tasks.tests
parentb30ead21543b16e9e1822dd182fc39734a3d196d (diff)
downloadorg.eclipse.mylyn.tasks-10f5d7510ce301f41ea71f1ff7db9a05375708d6.tar.gz
org.eclipse.mylyn.tasks-10f5d7510ce301f41ea71f1ff7db9a05375708d6.tar.xz
org.eclipse.mylyn.tasks-10f5d7510ce301f41ea71f1ff7db9a05375708d6.zip
REOPENED - bug 351100: fix failing tests for Mylyn 3.7
https://bugs.eclipse.org/bugs/show_bug.cgi?id=351100
Diffstat (limited to 'org.eclipse.mylyn.tasks.tests')
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataImportTest.java15
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListExternalizationTest.java4
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TasksUiUtilTest.java15
3 files changed, 28 insertions, 6 deletions
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataImportTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataImportTest.java
index 7eb4436a1..7bb688077 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataImportTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataImportTest.java
@@ -25,6 +25,7 @@ import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.wizards.TaskDataImportWizard;
import org.eclipse.mylyn.internal.tasks.ui.wizards.TaskDataImportWizardPage;
import org.eclipse.mylyn.internal.tasks.ui.workingsets.TaskWorkingSetUpdater;
+import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.IWorkingSetManager;
@@ -124,7 +125,12 @@ public class TaskDataImportTest extends TestCase {
// historyContext = ContextCorePlugin.getContextManager().getActivityMetaContext();
// assertNotNull(historyContext);
// assertTrue(historyContext.getInteractionHistory().size() > 0);
- assertTrue(TasksUiPlugin.getRepositoryManager().getAllRepositories().size() > 2);
+ if (TasksUi.getRepositoryConnector("bugzilla") != null) {
+ assertEquals(3, TasksUiPlugin.getRepositoryManager().getAllRepositories().size());
+ } else {
+ // Bugzilla repositories are not imported if connector is not available
+ assertEquals(1, TasksUiPlugin.getRepositoryManager().getAllRepositories().size());
+ }
}
public void testImportOverwritesAllTasks() {
@@ -151,7 +157,12 @@ public class TaskDataImportTest extends TestCase {
// historyContext = ContextCorePlugin.getContextManager().getActivityMetaContext();
// assertNotNull(historyContext);
// assertTrue(historyContext.getInteractionHistory().size() > 0);
- assertTrue(TasksUiPlugin.getRepositoryManager().getAllRepositories().size() > 2);
+ if (TasksUi.getRepositoryConnector("bugzilla") != null) {
+ assertEquals(3, TasksUiPlugin.getRepositoryManager().getAllRepositories().size());
+ } else {
+ // Bugzilla repositories are not imported if connector is not available
+ assertEquals(1, TasksUiPlugin.getRepositoryManager().getAllRepositories().size());
+ }
}
public void testImportBackupWithOldTaskList() {
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListExternalizationTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListExternalizationTest.java
index df5de0c2a..9de4ce2ae 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListExternalizationTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListExternalizationTest.java
@@ -497,11 +497,11 @@ public class TaskListExternalizationTest extends TestCase {
public void testRepositoryUrlHandles() throws Exception {
String taskId = "123";
- String repositoryUrl = "http://bugs.eclipse.org";
+ String repositoryUrl = "http://mock.eclipse.org";
TaskRepository repository = new TaskRepository(MockRepositoryConnector.CONNECTOR_KIND, repositoryUrl);
TasksUiPlugin.getRepositoryManager().addRepository(repository);
- ITask bugTask = new TaskTask("bugzilla", repositoryUrl, taskId);
+ ITask bugTask = new TaskTask("mock", repositoryUrl, taskId);
bugTask.setSummary("Summary");
assertEquals(repositoryUrl, bugTask.getRepositoryUrl());
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TasksUiUtilTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TasksUiUtilTest.java
index 09acb6f74..2ac2b7c9a 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TasksUiUtilTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TasksUiUtilTest.java
@@ -16,6 +16,7 @@ import java.util.Date;
import junit.framework.TestCase;
+import org.eclipse.mylyn.internal.provisional.commons.ui.PlatformUiUtil;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
import org.eclipse.mylyn.internal.tasks.core.TaskCategory;
import org.eclipse.mylyn.internal.tasks.core.TaskList;
@@ -92,6 +93,9 @@ public class TasksUiUtilTest extends TestCase {
// }
public void testOpenTaskFromString() {
+ if (!PlatformUiUtil.hasInternalBrowser()) {
+ return;
+ }
TasksUiUtil.openTask((String) null);
assertEquals(1, activePage.getEditorReferences().length);
IEditorPart editor = activePage.getEditorReferences()[0].getEditor(true);
@@ -99,6 +103,10 @@ public class TasksUiUtilTest extends TestCase {
}
public void testOpenUrl() {
+ if (!PlatformUiUtil.hasInternalBrowser()) {
+ return;
+ }
+
TasksUiUtil.openUrl(null);
assertEquals(1, activePage.getEditorReferences().length);
IEditorPart editor = activePage.getEditorReferences()[0].getEditor(true);
@@ -120,8 +128,11 @@ public class TasksUiUtilTest extends TestCase {
assertEquals("http://eclipse.org/mylyn", ((WebBrowserEditorInput) editor2.getEditorInput()).getURL().toString());
}
- public void testFlagNoRichEditor() throws SecurityException, NoSuchFieldException, IllegalArgumentException,
- IllegalAccessException {
+ public void testFlagNoRichEditor() throws Exception {
+ if (!PlatformUiUtil.hasInternalBrowser()) {
+ return;
+ }
+
TasksUiUtil.openUrl(null);
assertEquals(1, activePage.getEditorReferences().length);
IEditorPart editor = activePage.getEditorReferences()[0].getEditor(true);

Back to the top