Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2005-07-20 17:08:38 +0000
committermkersten2005-07-20 17:08:38 +0000
commitecf292179e351767b769b55486300acee935084c (patch)
treef67b5c7311997030e1bf68a90071502a7c1f3620 /org.eclipse.mylyn.tasks.tests
parent1051f15709456250ebba01bb32c8fa2aaa0b9de0 (diff)
downloadorg.eclipse.mylyn.tasks-ecf292179e351767b769b55486300acee935084c.tar.gz
org.eclipse.mylyn.tasks-ecf292179e351767b769b55486300acee935084c.tar.xz
org.eclipse.mylyn.tasks-ecf292179e351767b769b55486300acee935084c.zip
Patch for Bugzilla Bug 103092
improve category filtering and sorting
Diffstat (limited to 'org.eclipse.mylyn.tasks.tests')
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListUiTest.java35
1 files changed, 17 insertions, 18 deletions
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListUiTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListUiTest.java
index 8b4fbb0a2..3f9d70a05 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListUiTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListUiTest.java
@@ -25,8 +25,8 @@ import org.eclipse.mylar.tasks.Task;
import org.eclipse.mylar.tasks.TaskListManager;
import org.eclipse.mylar.tasks.internal.TaskCategory;
import org.eclipse.mylar.tasks.internal.TaskList;
+import org.eclipse.mylar.tasks.internal.TaskPriorityFilter;
import org.eclipse.mylar.tasks.ui.views.TaskListView;
-import org.eclipse.mylar.tasks.ui.views.TaskListView.PriorityFilter;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.ui.PartInitException;
@@ -149,25 +149,26 @@ public class TaskListUiTest extends TestCase {
TreeViewer viewer = TaskListView.getDefault().getViewer();
viewer.setContentProvider(new ContentProvider());
viewer.refresh();
- viewer.addFilter(TaskListView.getDefault().getCompleteFilter());
+ MylarTasksPlugin.getTaskListManager().getTaskList().addFilter(TaskListView.getDefault().getCompleteFilter());
viewer.refresh();
viewer.expandAll();
TreeItem[] items = viewer.getTree().getItems();
assertTrue(checkFilter(CHECK_COMPLETE_FILTER, items));
- // check complete tasks
+ MylarTasksPlugin.getTaskListManager().getTaskList().removeFilter(TaskListView.getDefault().getCompleteFilter());
- viewer.removeFilter(TaskListView.getDefault().getCompleteFilter());
- viewer.addFilter(TaskListView.getDefault().getInCompleteFilter());
- viewer.refresh();
- viewer.expandAll();
- items = viewer.getTree().getItems();
- assertTrue(checkFilter(CHECK_INCOMPLETE_FILTER, items));
+
+// MylarTasksPlugin.getTaskListManager().getTaskList().addFilter(TaskListView.getDefault().getInCompleteFilter());
+// viewer.refresh();
+// viewer.expandAll();
+// items = viewer.getTree().getItems();
+// assertTrue(checkFilter(CHECK_INCOMPLETE_FILTER, items));
+// MylarTasksPlugin.getTaskListManager().getTaskList().removeFilter(TaskListView.getDefault().getInCompleteFilter());
// check incomplte tasks
- viewer.removeFilter(TaskListView.getDefault().getInCompleteFilter());
- PriorityFilter filter = TaskListView.getDefault().getPriorityFilter();
+
+ TaskPriorityFilter filter = (TaskPriorityFilter)TaskListView.getDefault().getPriorityFilter();
filter.displayPrioritiesAbove("P2");
- viewer.addFilter(filter);
+ MylarTasksPlugin.getTaskListManager().getTaskList().addFilter(filter);
viewer.refresh();
viewer.expandAll();
items = viewer.getTree().getItems();
@@ -223,8 +224,9 @@ public class TaskListUiTest extends TestCase {
p1Count++;
}
}
- }
- assertTrue(p2Count == 2 && p1Count == 2);
+ }
+ assertEquals(2, p1Count);
+ assertEquals(2, p2Count);
return true;
}
@@ -245,10 +247,7 @@ public class TaskListUiTest extends TestCase {
return null;
}
public Object [] getChildren(Object parent) {
- if (parent instanceof TaskCategory) {
- return ((TaskCategory)parent).getChildren().toArray();
- }
- return new Object[0];
+ return MylarTasksPlugin.getTaskListManager().getTaskList().getFilteredChildrenFor(parent).toArray();
}
public boolean hasChildren(Object parent) {
if (parent instanceof TaskCategory) {

Back to the top