Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2007-06-14 07:47:18 +0000
committermkersten2007-06-14 07:47:18 +0000
commit2b232a31ed6679c164c434902104ea0e05454b6c (patch)
tree8cfd6f2153905666d690b5a0e6c79076491c3b05 /org.eclipse.mylyn.bugzilla.tests
parentbf9efebdb10af08a97351dc057653b49c73a6585 (diff)
downloadorg.eclipse.mylyn.tasks-2b232a31ed6679c164c434902104ea0e05454b6c.tar.gz
org.eclipse.mylyn.tasks-2b232a31ed6679c164c434902104ea0e05454b6c.tar.xz
org.eclipse.mylyn.tasks-2b232a31ed6679c164c434902104ea0e05454b6c.zip
NEW - bug 166609: [api] improve task externalization API
https://bugs.eclipse.org/bugs/show_bug.cgi?id=166609
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.tests')
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java10
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryTaskHandleTest.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListStandaloneTest.java19
3 files changed, 14 insertions, 17 deletions
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java
index 00e766734..036f1af12 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java
@@ -100,8 +100,8 @@ public class BugzillaTaskListManagerTest extends TestCase {
// TaskList list = new TaskList();
// manager.setTaskList(list);
manager.readExistingOrCreateNewList();
- assertEquals(1, manager.getTaskList().getRootTasks().size());
- AbstractTask readTask = (AbstractTask) manager.getTaskList().getRootTasks().iterator()
+ assertEquals(1, manager.getTaskList().getDefaultCategory().getChildren().size());
+ AbstractTask readTask = (AbstractTask) manager.getTaskList().getDefaultCategory().getChildren().iterator()
.next();
assertEquals(repositoryTask.getHandleIdentifier(), readTask.getHandleIdentifier());
@@ -165,7 +165,7 @@ public class BugzillaTaskListManagerTest extends TestCase {
manager.setTaskListFile(originalFile);
Collection<AbstractTask> allTasks = manager.getTaskList().getAllTasks();
- Set<AbstractTask> allRootTasks = manager.getTaskList().getRootTasks();
+ Set<AbstractTask> allRootTasks = manager.getTaskList().getDefaultCategory().getChildren();
Set<AbstractTaskCategory> allCategories = manager.getTaskList().getCategories();
Set<AbstractTaskContainer> allRoots = manager.getTaskList().getRootElements();
assertEquals(0, allRootTasks.size());
@@ -177,7 +177,7 @@ public class BugzillaTaskListManagerTest extends TestCase {
// manager.setTaskList(list);
manager.readExistingOrCreateNewList();
- assertEquals(allRootTasks.size(), manager.getTaskList().getRootTasks().size());
+ assertEquals(allRootTasks.size(), manager.getTaskList().getDefaultCategory().getChildren());
assertEquals(allCategories, manager.getTaskList().getCategories());
assertEquals(allRoots.size(), manager.getTaskList().getRootElements().size());
assertEquals(allTasks.size(), manager.getTaskList().getAllTasks().size());
@@ -190,7 +190,7 @@ public class BugzillaTaskListManagerTest extends TestCase {
// manager.setTaskList(list);
manager.readExistingOrCreateNewList();
- assertEquals(allRootTasks.size(), manager.getTaskList().getRootTasks().size());
+ assertEquals(allRootTasks.size(), manager.getTaskList().getDefaultCategory().getChildren());
assertEquals(allCategories, manager.getTaskList().getCategories());
assertEquals(allRoots.size(), manager.getTaskList().getRootElements().size());
assertEquals(allTasks.size(), manager.getTaskList().getAllTasks().size());
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryTaskHandleTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryTaskHandleTest.java
index 3887c9cad..16d4775ba 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryTaskHandleTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryTaskHandleTest.java
@@ -62,7 +62,7 @@ public class RepositoryTaskHandleTest extends TestCase {
manager.resetTaskList();
manager.readExistingOrCreateNewList();
- BugzillaTask readReport = (BugzillaTask) manager.getTaskList().getRootTasks().iterator().next();
+ BugzillaTask readReport = (BugzillaTask) manager.getTaskList().getDefaultCategory().getChildren().iterator().next();
assertEquals(readReport.getSummary(), readReport.getSummary());
assertEquals(readReport.getRepositoryUrl(), readReport.getRepositoryUrl());
}
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListStandaloneTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListStandaloneTest.java
index 0be12a5dc..d96e82a62 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListStandaloneTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListStandaloneTest.java
@@ -43,12 +43,9 @@ public class TaskListStandaloneTest extends TestCase {
TasksUiPlugin.getRepositoryManager().clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath());
manager = TasksUiPlugin.getTaskListManager();
- // file = new File("tasklist" + TasksUiPlugin.FILE_EXTENSION);
- // file.deleteOnExit();
- // new TaskListManager(writer, file);
manager.resetTaskList();
- assertEquals("should be empty: " + manager.getTaskList().getRootTasks(), 0, manager.getTaskList()
- .getRootTasks().size());
+ assertEquals("should be empty: " + manager.getTaskList().getDefaultCategory().getChildren(), 0,
+ manager.getTaskList().getDefaultCategory().getChildren().size());
}
@Override
@@ -57,19 +54,19 @@ public class TaskListStandaloneTest extends TestCase {
manager.saveTaskList();
super.tearDown();
}
-
+
public void testDueDateExternalization() {
AbstractTask task = new LocalTask("1", "task 1");
Date dueDate = new Date();
task.setDueDate(dueDate);
manager.getTaskList().moveToContainer(manager.getTaskList().getDefaultCategory(), task);
assertEquals(1, manager.getTaskList().getAllTasks().size());
-
+
manager.saveTaskList();
manager.resetTaskList();
manager.readExistingOrCreateNewList();
assertEquals(1, manager.getTaskList().getAllTasks().size());
- Set<AbstractTask> readList = manager.getTaskList().getRootTasks();
+ Set<AbstractTask> readList = manager.getTaskList().getDefaultCategory().getChildren();
AbstractTask readTask = readList.iterator().next();
assertTrue(readTask.getSummary().equals("task 1"));
assertTrue(readTask.getDueDate().compareTo(dueDate) == 0);
@@ -112,9 +109,9 @@ public class TaskListStandaloneTest extends TestCase {
// assertEquals(0, manager.getTaskList().getRootTasks().size());
// manager.readOrCreateTaskList();
// assertNotNull(manager.getTaskList());
- assertEquals(1, manager.getTaskList().getRootTasks().size());
+ assertEquals(1, manager.getTaskList().getDefaultCategory().getChildren().size());
- Set<AbstractTask> readList = manager.getTaskList().getRootTasks();
+ Set<AbstractTask> readList = manager.getTaskList().getDefaultCategory().getChildren();
AbstractTask readTask = readList.iterator().next();
assertTrue(readTask.getSummary().equals("task 1"));
@@ -204,7 +201,7 @@ public class TaskListStandaloneTest extends TestCase {
manager.readExistingOrCreateNewList();
// ensure that task now gets loaded
- assertEquals(1, manager.getTaskList().getQueries().size());
+ assertEquals(1, manager.getTaskList().getQueries().size());
manager.getTaskListWriter().setDelegateExternalizers(originalExternalizers);
}

Back to the top