Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaxsun McCarthy Huggan2016-06-15 22:32:14 +0000
committerGerrit Code Review @ Eclipse.org2016-08-17 00:09:19 +0000
commit10d73213c4d6b5318b0606db516014fbc8de7dd0 (patch)
tree1fe577adbef1419caa893f804e4e00d5f51e30c7 /org.eclipse.mylyn.tasks.tests
parentf4f9a57fc83f397ab4b7c4704cd8e69003e94a6e (diff)
downloadorg.eclipse.mylyn.tasks-10d73213c4d6b5318b0606db516014fbc8de7dd0.tar.gz
org.eclipse.mylyn.tasks-10d73213c4d6b5318b0606db516014fbc8de7dd0.tar.xz
org.eclipse.mylyn.tasks-10d73213c4d6b5318b0606db516014fbc8de7dd0.zip
319889: Support sorting of scheduled presentation
The TaskComparator now maintains a list of sort criteria per presentation. The criteria will always be configured for the active presentation. The migration of old sorting mementos was removed. Change-Id: I5d9b594e4efda7b35ccdca2b19fb824a6590d5f1 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=319889
Diffstat (limited to 'org.eclipse.mylyn.tasks.tests')
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListSorterTest.java41
1 files changed, 0 insertions, 41 deletions
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListSorterTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListSorterTest.java
index f0749de36..58dfa29e9 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListSorterTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListSorterTest.java
@@ -35,13 +35,10 @@ import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.util.SortCriterion;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListInterestSorter;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListSorter;
-import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.tests.connector.MockTask;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.XMLMemento;
import junit.framework.TestCase;
@@ -53,44 +50,6 @@ import junit.framework.TestCase;
*/
public class TaskListSorterTest extends TestCase {
- private static final String MEMENTO_KEY_SORT_DIRECTION = "sortDirection"; //$NON-NLS-1$
-
- private static final String MEMENTO_KEY_SORT_INDEX = "sortIndex"; //$NON-NLS-1$
-
- private static final String MEMENTO_KEY_SORTER = "sorter"; //$NON-NLS-1$
-
- private static final String MEMENTO_KEY_SORTER2 = "sorter2"; //$NON-NLS-1$
-
- public void testPreferenceMigration() throws Exception {
- final TaskListSorter sorter = new TaskListSorter();
- TaskListView view = new TaskListView();
- XMLMemento memento = XMLMemento.createWriteRoot(MEMENTO_KEY_SORT_INDEX);
- IMemento child = memento.createChild(MEMENTO_KEY_SORTER);
- child.putInteger(MEMENTO_KEY_SORT_INDEX, 0);
- child.putInteger(MEMENTO_KEY_SORT_DIRECTION, 1);
- child = memento.createChild(MEMENTO_KEY_SORTER2);
- child.putInteger(MEMENTO_KEY_SORT_INDEX, 1);
- child.putInteger(MEMENTO_KEY_SORT_DIRECTION, -1);
- view.migrateSorterState(sorter, memento);
- assertEquals(SortCriterion.SortKey.PRIORITY, sorter.getTaskComparator().getSortCriterion(0).getKey());
- assertEquals(1, sorter.getTaskComparator().getSortCriterion(0).getDirection());
- assertEquals(SortCriterion.SortKey.SUMMARY, sorter.getTaskComparator().getSortCriterion(1).getKey());
- assertEquals(-1, sorter.getTaskComparator().getSortCriterion(1).getDirection());
-
- memento = XMLMemento.createWriteRoot(MEMENTO_KEY_SORT_INDEX);
- child = memento.createChild(MEMENTO_KEY_SORTER);
- child.putInteger(MEMENTO_KEY_SORT_INDEX, 3);
- child.putInteger(MEMENTO_KEY_SORT_DIRECTION, -1);
- child = memento.createChild(MEMENTO_KEY_SORTER2);
- child.putInteger(MEMENTO_KEY_SORT_INDEX, 2);
- child.putInteger(MEMENTO_KEY_SORT_DIRECTION, -1);
- view.migrateSorterState(sorter, memento);
- assertEquals(SortCriterion.SortKey.TASK_ID, sorter.getTaskComparator().getSortCriterion(0).getKey());
- assertEquals(-1, sorter.getTaskComparator().getSortCriterion(0).getDirection());
- assertEquals(SortCriterion.SortKey.DATE_CREATED, sorter.getTaskComparator().getSortCriterion(1).getKey());
- assertEquals(-1, sorter.getTaskComparator().getSortCriterion(1).getDirection());
- }
-
public void testSortWithError() {
final TaskListSorter sorter = new TaskListSorter();
ITask task1 = new LocalTask("1", null);

Back to the top