Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/tests/TaskListContentProviderTest.java')
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/tests/TaskListContentProviderTest.java55
1 files changed, 55 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/tests/TaskListContentProviderTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/tests/TaskListContentProviderTest.java
new file mode 100644
index 000000000..f0403d41a
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasklist/tests/TaskListContentProviderTest.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2004 - 2006 Mylar committers and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.mylar.tasklist.tests;
+
+import org.eclipse.mylar.internal.tasklist.ui.views.TaskListContentProvider;
+import org.eclipse.mylar.internal.tasklist.ui.views.TaskListView;
+import org.eclipse.mylar.provisional.tasklist.Task;
+
+import junit.framework.TestCase;
+
+/**
+ * @author Felix Schwarz
+ */
+public class TaskListContentProviderTest extends TestCase {
+
+ private TaskListContentProvider provider;
+
+ private TaskListView view;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ TaskListView.openInActivePerspective();
+ view = TaskListView.getFromActivePerspective();
+ provider = (TaskListContentProvider) view.getViewer().getContentProvider();
+ view.clearFilters(true);
+ view.addFilter(view.getCompleteFilter());
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ view.clearFilters(true);
+ super.tearDown();
+ }
+
+ public void testHasChildren() {
+
+ Task parent = new Task("parent", "parent label", true);
+ Task completedChild = new Task("completed child", "completed child label", true);
+ completedChild.setCompleted(true);
+ parent.addSubTask(completedChild);
+ assertFalse(provider.hasChildren(parent));
+
+ Task incompleteChild = new Task("incomplete child", "incomplete child label", true);
+ incompleteChild.setCompleted(false);
+ parent.addSubTask(incompleteChild);
+ assertTrue(provider.hasChildren(parent));
+ }
+}

Back to the top