Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.mylyn.tasks.tests')
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskActivityTimingTest.java8
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java24
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskTestUtil.java6
3 files changed, 19 insertions, 19 deletions
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskActivityTimingTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskActivityTimingTest.java
index 01d17a45c..1b621bc77 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskActivityTimingTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskActivityTimingTest.java
@@ -652,7 +652,7 @@ public class TaskActivityTimingTest extends TestCase {
- mockContext.getInteractionHistory().get(0).getDate().getTime());
}
- public void testCollapsedExternalization() {
+ public void testCollapsedExternalization() throws Exception {
Calendar startTime1 = Calendar.getInstance();
Calendar endTime1 = Calendar.getInstance();
@@ -690,7 +690,7 @@ public class TaskActivityTimingTest extends TestCase {
TasksUiPlugin.getTaskActivityManager().deactivateActiveTask();
assertEquals(4, ContextCorePlugin.getContextManager().getActivityMetaContext().getInteractionHistory().size());
- TaskTestUtil.saveTaskList();
+ TaskTestUtil.saveNow();
ContextCorePlugin.getContextManager().saveActivityMetaContext();
ContextCorePlugin.getContextManager().getActivityMetaContext().reset();
assertEquals(0, ContextCorePlugin.getContextManager().getActivityMetaContext().getInteractionHistory().size());
@@ -833,7 +833,7 @@ public class TaskActivityTimingTest extends TestCase {
assertEquals(expectedTotalTime, TasksUiPlugin.getTaskActivityManager().getElapsedTime(task1));
}
- public void testElapsedSameAfterRead() {
+ public void testElapsedSameAfterRead() throws Exception {
// test that granularity of elapsed time map is retained after
// being re-read from disk
@@ -901,7 +901,7 @@ public class TaskActivityTimingTest extends TestCase {
TasksUi.getTaskActivityManager().deactivateActiveTask();
assertEquals(4, ContextCorePlugin.getContextManager().getActivityMetaContext().getInteractionHistory().size());
- TaskTestUtil.saveTaskList();
+ TaskTestUtil.saveNow();
ContextCorePlugin.getContextManager().saveActivityMetaContext();
ContextCorePlugin.getContextManager().getActivityMetaContext().reset();
assertEquals(0, ContextCorePlugin.getContextManager().getActivityMetaContext().getInteractionHistory().size());
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java
index 0dab9eccc..e612666cb 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java
@@ -222,17 +222,17 @@ public class TaskRepositoryManagerTest extends TestCase {
assertNotNull(manager.getRepositoryConnector(connector.getConnectorKind()));
}
- public void testRepositoryPersistance() throws MalformedURLException {
+ public void testRepositoryPersistance() throws Exception {
TaskRepository repository1 = new TaskRepository("bugzilla", "http://bugzilla");
TaskRepository repository2 = new TaskRepository("jira", "http://jira");
TaskRepository repository3 = new TaskRepository("local", "http://local");
manager.addRepository(repository3);
manager.addRepository(repository1);
manager.addRepository(repository2);
- TasksUiPlugin.getDefault();
+ TaskTestUtil.saveNow();
+
TasksUiPlugin.getExternalizationManager().load();
//manager.readRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath());
-
if (manager.getRepositoryConnector("bugzilla") != null) {
assertTrue(manager.getAllRepositories().contains(repository2));
}
@@ -242,7 +242,7 @@ public class TaskRepositoryManagerTest extends TestCase {
assertTrue(manager.getAllRepositories().contains(repository3));
}
- public void testRepositoryAttributePersistance() throws MalformedURLException {
+ public void testRepositoryAttributePersistance() throws Exception {
assertEquals("", TasksUiPlugin.getDefault().getPreferenceStore().getString(
TaskRepositoryManager.PREF_REPOSITORIES));
@@ -258,7 +258,8 @@ public class TaskRepositoryManagerTest extends TestCase {
repository1.setTimeZoneId(fakeTimeZone);
repository1.setSynchronizationTimeStamp(dateString);
manager.addRepository(repository1);
- TasksUiPlugin.getDefault();
+ TaskTestUtil.saveNow();
+
TasksUiPlugin.getExternalizationManager().load();
//manager.readRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath());
TaskRepository temp = manager.getRepository(repository1.getConnectorKind(), repository1.getRepositoryUrl());
@@ -303,33 +304,32 @@ public class TaskRepositoryManagerTest extends TestCase {
// causing this test to fail.
AbstractRepositoryConnector connector = new MockRepositoryConnector();
manager.addRepositoryConnector(connector);
-
TaskRepository repository = new TaskRepository(MockRepositoryConnector.REPOSITORY_KIND,
"http://mylyn.eclipse.org/");
repository.setProperty("owner", "euxx");
manager.addRepository(repository);
- TasksUiPlugin.getDefault();
+ TaskTestUtil.saveNow();
+
TasksUiPlugin.getExternalizationManager().load();
//manager.readRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath());
-
TaskRepository temp = manager.getRepository(repository.getConnectorKind(), repository.getRepositoryUrl());
assertNotNull(temp);
assertEquals("euxx", temp.getProperty("owner"));
}
- public void testRepositoryPersistanceSameUrl() throws MalformedURLException {
+ public void testRepositoryPersistanceSameUrl() throws Exception {
TaskRepository repository1 = new TaskRepository("local", "http://repository");
TaskRepository repository2 = new TaskRepository("web", "http://repository");
manager.addRepository(repository1);
manager.addRepository(repository2);
assertEquals(2, manager.getAllRepositories().size());
-
List<TaskRepository> repositoryList = new ArrayList<TaskRepository>();
repositoryList.add(repository2);
repositoryList.add(repository1);
- //manager.readRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath());
- TasksUiPlugin.getDefault();
+ TaskTestUtil.saveNow();
+
TasksUiPlugin.getExternalizationManager().load();
+ //manager.readRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath());
assertEquals("got: " + manager.getAllRepositories(), 2, manager.getAllRepositories().size());
}
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskTestUtil.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskTestUtil.java
index a5e276593..6f7c1527b 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskTestUtil.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskTestUtil.java
@@ -89,13 +89,13 @@ public class TaskTestUtil {
*/
public static void saveAndReadTasklist() throws Exception {
TasksUiPlugin.getTaskList().notifyElementsChanged(null);
- saveTaskList();
+ saveNow();
TaskTestUtil.resetTaskList();
TasksUiPlugin.getDefault().initializeDataSources();
}
- public static void saveTaskList() {
- TasksUiPlugin.getExternalizationManager().requestSave();
+ public static void saveNow() throws InterruptedException {
+ TasksUiPlugin.getExternalizationManager().saveNow();
}
public static TaskRepository createMockRepository() {

Back to the top