summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2012-01-25 11:39:25 (EST)
committer Steffen Pingel2012-01-25 11:39:25 (EST)
commite984dc4cd4ddea99f0916a899ca06743a6729a76 (patch)
tree5fa032ea910350ed4946ccfb6dd15a566c4197e6
parent1bf05488095c5e08f24693df9795f17ff529d19c (diff)
downloadorg.eclipse.mylyn.tasks-e984dc4cd4ddea99f0916a899ca06743a6729a76.zip
org.eclipse.mylyn.tasks-e984dc4cd4ddea99f0916a899ca06743a6729a76.tar.gz
org.eclipse.mylyn.tasks-e984dc4cd4ddea99f0916a899ca06743a6729a76.tar.bz2
NEW - bug 369697: fix test failures on Java 1.7
https://bugs.eclipse.org/bugs/show_bug.cgi?id=369697 Change-Id: I68b51f8bc733acf73a1a8b85f555c4fbac69a29d
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStore.java3
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java3
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java15
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskWorkingSetTest.java2
4 files changed, 18 insertions, 5 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStore.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStore.java
index 66dd96a..20ec91a 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStore.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStore.java
@@ -136,7 +136,8 @@ public class TaskDataStore {
return readStateInternal(file, false);
} catch (SAXException e) {
// bug 268456: if reading fails, try again using a different XML version
- if (e.getMessage() != null && e.getMessage().contains("invalid XML character")) { //$NON-NLS-1$
+ if (e.getMessage() != null
+ && (e.getMessage().contains("invalid XML character") || e.getMessage().contains("Character reference \"&#"))) { //$NON-NLS-1$ //$NON-NLS-2$
return readStateInternal(file, true);
} else {
throw e;
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java
index 7656462..7f36e08 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java
@@ -39,11 +39,12 @@ import org.eclipse.mylyn.tasks.tests.ui.editor.TaskUrlHyperlinkDetectorTest;
/**
* @author Mik Kersten
* @author Shawn Minto
+ * @author Steffen Pingel
*/
public class AllTasksTests {
public static Test suite() {
- TestSuite suite = new TestSuite("Test for org.eclipse.mylyn.tasks.tests");
+ TestSuite suite = new TestSuite(AllTasksTests.class.getName());
suite.addTestSuite(TasksUiUtilTest.class);
suite.addTestSuite(TaskListUiTest.class);
suite.addTestSuite(TaskRepositoryTest.class);
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java
index 33b0591..f29dad8 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java
@@ -17,6 +17,7 @@ import org.eclipse.mylyn.commons.ui.ClipboardCopier;
import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager;
import org.eclipse.mylyn.internal.tasks.ui.actions.CopyTaskDetailsAction;
import org.eclipse.mylyn.internal.tasks.ui.actions.CopyTaskDetailsAction.Mode;
+import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryConnector;
import org.eclipse.mylyn.tasks.tests.connector.MockTask;
import org.eclipse.mylyn.tasks.ui.TasksUi;
@@ -75,9 +76,17 @@ public class CopyDetailsActionTest extends TestCase {
return "http://321.com";
}
};
- ((TaskRepositoryManager) TasksUi.getRepositoryManager()).addRepositoryConnector(connector);
- assertEquals("321: s321" + ClipboardCopier.LINE_SEPARATOR + "http://321.com",
- CopyTaskDetailsAction.getTextForTask(task, Mode.SUMMARY_URL));
+ AbstractRepositoryConnector oldConnector = TasksUi.getRepositoryManager().getRepositoryConnector(
+ MockRepositoryConnector.CONNECTOR_KIND);
+ try {
+ ((TaskRepositoryManager) TasksUi.getRepositoryManager()).addRepositoryConnector(connector);
+ assertEquals("321: s321" + ClipboardCopier.LINE_SEPARATOR + "http://321.com",
+ CopyTaskDetailsAction.getTextForTask(task, Mode.SUMMARY_URL));
+ } finally {
+ if (oldConnector != null) {
+ ((TaskRepositoryManager) TasksUi.getRepositoryManager()).addRepositoryConnector(oldConnector);
+ }
+ }
}
}
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskWorkingSetTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskWorkingSetTest.java
index 0336b2a..0e92a64 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskWorkingSetTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskWorkingSetTest.java
@@ -30,6 +30,7 @@ import org.eclipse.mylyn.internal.tasks.core.TaskList;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.workingsets.TaskWorkingSetUpdater;
import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryQuery;
+import org.eclipse.mylyn.tests.util.TestFixture;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.IWorkingSetManager;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
@@ -52,6 +53,7 @@ public class TaskWorkingSetTest extends TestCase {
protected void setUp() throws Exception {
workingSetManager = Workbench.getInstance().getWorkingSetManager();
root = ResourcesPlugin.getWorkspace().getRoot();
+ TestFixture.resetTaskList();
}
@Override