Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2008-09-17 19:24:17 -0400
committerspingel2008-09-17 19:24:17 -0400
commit7bb6f24d0bc2f860270d2858237feb9c4f7f6e06 (patch)
tree3acae6f502bfe5ce5873c654dd29f29697e9a276
parent23a6de036dc41c6bca912084954a857e29272999 (diff)
downloadorg.eclipse.mylyn.tasks-7bb6f24d0bc2f860270d2858237feb9c4f7f6e06.tar.gz
org.eclipse.mylyn.tasks-7bb6f24d0bc2f860270d2858237feb9c4f7f6e06.tar.xz
org.eclipse.mylyn.tasks-7bb6f24d0bc2f860270d2858237feb9c4f7f6e06.zip
NEW - bug 237552: [api] remove deprecated classes
https://bugs.eclipse.org/bugs/show_bug.cgi?id=237552
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/NewTaskFromSelectionActionTest.java15
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/web/HtmlDecodeEntityTest.java36
2 files changed, 16 insertions, 35 deletions
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/NewTaskFromSelectionActionTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/NewTaskFromSelectionActionTest.java
index 0060db199..2a91bc510 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/NewTaskFromSelectionActionTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/NewTaskFromSelectionActionTest.java
@@ -30,13 +30,14 @@ import org.eclipse.mylyn.tasks.tests.connector.MockTask;
*/
public class NewTaskFromSelectionActionTest extends TestCase {
- public void testNoSelection() throws Exception {
- NewTaskFromSelectionAction action = new NewTaskFromSelectionAction();
- assertNull(action.getTaskSelection());
- action.run();
- action.selectionChanged(null);
- assertNull(action.getTaskSelection());
- }
+ // FIXME 3.1 causes display of modal dialog
+// public void testNoSelection() throws Exception {
+// NewTaskFromSelectionAction action = new NewTaskFromSelectionAction();
+// assertNull(action.getTaskSelection());
+// action.run();
+// action.selectionChanged(null);
+// assertNull(action.getTaskSelection());
+// }
public void testComment() throws Exception {
TaskRepository taskRepository = new TaskRepository(MockRepositoryConnector.REPOSITORY_KIND,
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/web/HtmlDecodeEntityTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/web/HtmlDecodeEntityTest.java
index 35a79c36e..50336a9cb 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/web/HtmlDecodeEntityTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/web/HtmlDecodeEntityTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (c) 2004, 2008 Tasktop Technologies and others.
+ * Copyright (c) 2004, 2008 George Lindholm 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
@@ -12,23 +12,16 @@
package org.eclipse.mylyn.tasks.tests.web;
-import java.util.ArrayList;
-import java.util.List;
-
import junit.framework.TestCase;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
-import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
-import org.eclipse.mylyn.internal.tasks.core.deprecated.ITaskFactory;
-import org.eclipse.mylyn.internal.tasks.core.deprecated.QueryHitCollector;
-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData;
import org.eclipse.mylyn.internal.web.tasks.WebRepositoryConnector;
import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.mylyn.tasks.core.data.TaskDataCollector;
+import org.eclipse.mylyn.tasks.core.data.TaskMapper;
+import org.eclipse.mylyn.tasks.tests.util.TestTaskDataCollector;
/**
* @author George Lindholm
@@ -40,20 +33,7 @@ public class HtmlDecodeEntityTest extends TestCase {
private final TaskRepository repository = new TaskRepository("localhost", "file:///tmp/a");
- private final List<RepositoryTaskData> queryHits = new ArrayList<RepositoryTaskData>();
-
- private final ITaskFactory taskFactory = new ITaskFactory() {
- public AbstractTask createTask(RepositoryTaskData taskData, IProgressMonitor monitor) throws CoreException {
- return null;
- }
- };
-
- private final TaskDataCollector resultCollector = new QueryHitCollector(taskFactory) {
- @Override
- public void accept(RepositoryTaskData hit) {
- queryHits.add(hit);
- }
- };
+ private final TestTaskDataCollector collector = new TestTaskDataCollector();
public void testEntities() {
assertQuery("1:A quote &quot;", "(\\d+?):(.+)", "A quote \""); // Simple quote
@@ -70,10 +50,10 @@ public class HtmlDecodeEntityTest extends TestCase {
}
private void assertQuery(final String entity, final String regex, final String expected) {
- queryHits.clear();
- IStatus status = WebRepositoryConnector.performQuery(entity, regex, "", monitor, resultCollector, repository);
- assertTrue(status == Status.OK_STATUS);
- assertEquals(queryHits.get(0).getSummary(), expected);
+ collector.results.clear();
+ IStatus status = WebRepositoryConnector.performQuery(entity, regex, "", monitor, collector, repository);
+ assertEquals(Status.OK_STATUS, status);
+ assertEquals(expected, new TaskMapper(collector.results.get(0)).getSummary());
}
}

Back to the top