Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2005-06-29 22:46:52 +0000
committermkersten2005-06-29 22:46:52 +0000
commit511f3d313ba97192aa52383783b65536be59e780 (patch)
treeb628fd9940b3113ab714bd3f601d25d8f44379a8 /org.eclipse.mylyn.tasks.tests
parent33af02ad21255c099d31a324f5b60098b8d2e80b (diff)
downloadorg.eclipse.mylyn.tasks-511f3d313ba97192aa52383783b65536be59e780.tar.gz
org.eclipse.mylyn.tasks-511f3d313ba97192aa52383783b65536be59e780.tar.xz
org.eclipse.mylyn.tasks-511f3d313ba97192aa52383783b65536be59e780.zip
Ken's patch for: Bugzilla Bug 101911
Support bugzilla queries
Diffstat (limited to 'org.eclipse.mylyn.tasks.tests')
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/bugzilla/tests/BugzillaSearchPluginTest.java6
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java12
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListUiTest.java28
3 files changed, 23 insertions, 23 deletions
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/bugzilla/tests/BugzillaSearchPluginTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/bugzilla/tests/BugzillaSearchPluginTest.java
index 01eac4a6a..566486648 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/bugzilla/tests/BugzillaSearchPluginTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/bugzilla/tests/BugzillaSearchPluginTest.java
@@ -24,7 +24,7 @@ import org.eclipse.mylar.core.search.IActiveSearchListener;
import org.eclipse.mylar.core.tests.support.WorkspaceSetupHelper;
import org.eclipse.mylar.core.tests.support.search.SearchPluginTestHelper;
import org.eclipse.mylar.tasks.BugzillaTask;
-import org.eclipse.mylar.tasks.Category;
+import org.eclipse.mylar.tasks.TaskCategory;
import org.eclipse.mylar.tasks.MylarTasksPlugin;
import org.eclipse.mylar.tasks.TaskList;
import org.eclipse.mylar.tasks.BugzillaTask.BugTaskState;
@@ -214,7 +214,7 @@ public class BugzillaSearchPluginTest extends TestCase{
TaskList t = MylarTasksPlugin.getTaskListManager().createNewTaskList();
MylarTasksPlugin.getTaskListManager().setTaskList(t);
- Category cat = new Category("Testing Category");
+ TaskCategory cat = new TaskCategory("Testing Category");
t.addCategory(cat);
BugzillaTask bugTask1 = new BugzillaTask(bugPrefix +94185, "<bugzilla info>");
cat.addTask(bugTask1);
@@ -276,7 +276,7 @@ public class BugzillaSearchPluginTest extends TestCase{
TaskList t = MylarTasksPlugin.getTaskListManager().createNewTaskList();
MylarTasksPlugin.getTaskListManager().setTaskList(t);
- Category cat = new Category("Testing Category");
+ TaskCategory cat = new TaskCategory("Testing Category");
t.addCategory(cat);
BugzillaTask bugTask1 = new BugzillaTask(bugPrefix + 94185, "<bugzilla info>");
cat.addTask(bugTask1);
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java
index 492df5ec5..7d5babeaa 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java
@@ -18,7 +18,7 @@ import java.io.File;
import junit.framework.TestCase;
-import org.eclipse.mylar.tasks.Category;
+import org.eclipse.mylar.tasks.TaskCategory;
import org.eclipse.mylar.tasks.ITask;
import org.eclipse.mylar.tasks.MylarTasksPlugin;
import org.eclipse.mylar.tasks.Task;
@@ -44,7 +44,7 @@ public class TaskListManagerTest extends TestCase {
Task task2 = new Task(MylarTasksPlugin.getTaskListManager().genUniqueTaskId(), "task 2");
tlist.addRootTask(task2);
- Category cat1 = new Category("Category 1");
+ TaskCategory cat1 = new TaskCategory("Category 1");
tlist.addCategory(cat1);
Task task3 = new Task(MylarTasksPlugin.getTaskListManager().genUniqueTaskId(), "task 3");
cat1.addTask(task3);
@@ -54,7 +54,7 @@ public class TaskListManagerTest extends TestCase {
Task task4 = new Task(MylarTasksPlugin.getTaskListManager().genUniqueTaskId(), "task 4");
cat1.addTask(task4);
- Category cat2 = new Category("Category 2");
+ TaskCategory cat2 = new TaskCategory("Category 2");
tlist.addCategory(cat2);
Task task5 = new Task(MylarTasksPlugin.getTaskListManager().genUniqueTaskId(), "task 5");
cat2.addTask(task5);
@@ -80,12 +80,12 @@ public class TaskListManagerTest extends TestCase {
assertTrue(list.get(0).getChildren().get(0).getLabel().equals("sub 1"));
assertTrue(list.get(1).getLabel().equals("task 2"));
- List<Category> clist = manager.getTaskList().getCategories();
- list = clist.get(0).getTasks();
+ List<TaskCategory> clist = manager.getTaskList().getTaskCategories();
+ list = clist.get(0).getChildren();
assertTrue(list.get(0).getLabel().equals("task 3"));
assertTrue(list.get(0).getChildren().get(0).getLabel().equals("sub 2"));
assertTrue(list.get(1).getLabel().equals("task 4"));
- list = clist.get(1).getTasks();
+ list = clist.get(1).getChildren();
assertTrue(list.get(0).getLabel().equals("task 5"));
assertTrue(list.get(1).getLabel().equals("task 6"));
return true;
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 254914ffa..d68da958b 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
@@ -19,7 +19,7 @@ import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.mylar.tasks.Category;
+import org.eclipse.mylar.tasks.TaskCategory;
import org.eclipse.mylar.tasks.ITask;
import org.eclipse.mylar.tasks.MylarTasksPlugin;
import org.eclipse.mylar.tasks.Task;
@@ -37,7 +37,7 @@ import org.eclipse.ui.PartInitException;
*/
public class TaskListUiTest extends TestCase {
private TaskList tlist = null;
- private Category cat1 = null;
+ private TaskCategory cat1 = null;
private Task cat1task1 = null;
private Task cat1task2 = null;
private Task cat1task3 = null;
@@ -45,7 +45,7 @@ public class TaskListUiTest extends TestCase {
private Task cat1task5 = null;
private Task cat1task1sub1 = null;
- private Category cat2 = null;
+ private TaskCategory cat2 = null;
private Task cat2task1 = null;
private Task cat2task2 = null;
private Task cat2task3 = null;
@@ -63,7 +63,7 @@ public class TaskListUiTest extends TestCase {
File file = new File("foo" + MylarTasksPlugin.FILE_EXTENSION);
TaskListManager manager = new TaskListManager(file);
tlist = manager.createNewTaskList();
- cat1 = new Category("First Category");
+ cat1 = new TaskCategory("First Category");
cat1task1 = new Task(MylarTasksPlugin.getTaskListManager().genUniqueTaskId(), "task 1");
cat1task1.setPriority("P1");
@@ -100,9 +100,9 @@ public class TaskListUiTest extends TestCase {
cat1.addTask(cat1task5);
tlist.addCategory(cat1);
- assertEquals(cat1.getTasks().size(), 5);
+ assertEquals(cat1.getChildren().size(), 5);
- cat2 = new Category("Second Category");
+ cat2 = new TaskCategory("Second Category");
cat2task1 = new Task(MylarTasksPlugin.getTaskListManager().genUniqueTaskId(), "task 1");
cat2task1.setPriority("P1");
@@ -191,7 +191,7 @@ public class TaskListUiTest extends TestCase {
assertTrue(items.length == 2);
int count = 0;
for (int i = 0; i < items.length; i++) {
- assertTrue(items[i].getData() instanceof Category);
+ assertTrue(items[i].getData() instanceof TaskCategory);
TreeItem[] sub = items[i].getItems();
for (int j = 0; j < sub.length; j++) {
assertTrue(sub[j].getData() instanceof ITask);
@@ -213,7 +213,7 @@ public class TaskListUiTest extends TestCase {
int p2Count = 0;
int p5Count = 0;
for (int i = 0; i < items.length; i++) {
- assertTrue(items[i].getData() instanceof Category);
+ assertTrue(items[i].getData() instanceof TaskCategory);
TreeItem[] sub = items[i].getItems();
for (int j = 0; j < sub.length; j++) {
assertTrue(sub[j].getData() instanceof ITask);
@@ -241,21 +241,21 @@ public class TaskListUiTest extends TestCase {
return tlist.getRoots().toArray();
}
public Object getParent(Object child) {
- if (child instanceof Category) {
+ if (child instanceof TaskCategory) {
return ((Task)child).getCategory();
}
return null;
}
public Object [] getChildren(Object parent) {
- if (parent instanceof Category) {
- return ((Category)parent).getTasks().toArray();
+ if (parent instanceof TaskCategory) {
+ return ((TaskCategory)parent).getChildren().toArray();
}
return new Object[0];
}
public boolean hasChildren(Object parent) {
- if (parent instanceof Category) {
- Category cat = (Category)parent;
- return cat.getTasks() != null && cat.getTasks().size() > 0;
+ if (parent instanceof TaskCategory) {
+ TaskCategory cat = (TaskCategory)parent;
+ return cat.getChildren() != null && cat.getChildren().size() > 0;
}
return false;
}

Back to the top