Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrelves2006-09-10 20:22:30 -0400
committerrelves2006-09-10 20:22:30 -0400
commit580e36be035f63f453c1772044ae7a3b75030226 (patch)
treeace35e7361db03b75e7507b85f1535f192cc4093 /org.eclipse.mylyn.trac.tests
parent9b46ff0d517c0c8e053c06fd707fb11e30569a7b (diff)
downloadorg.eclipse.mylyn.tasks-580e36be035f63f453c1772044ae7a3b75030226.tar.gz
org.eclipse.mylyn.tasks-580e36be035f63f453c1772044ae7a3b75030226.tar.xz
org.eclipse.mylyn.tasks-580e36be035f63f453c1772044ae7a3b75030226.zip
Progress on: 155279: Split search into headless and ui
https://bugs.eclipse.org/bugs/show_bug.cgi?id=155279
Diffstat (limited to 'org.eclipse.mylyn.trac.tests')
-rw-r--r--org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/RepositorySearchQueryTest.java20
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java4
3 files changed, 12 insertions, 15 deletions
diff --git a/org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF b/org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF
index 2fcd0e50e..9d869a7d4 100644
--- a/org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.trac.tests/META-INF/MANIFEST.MF
@@ -12,7 +12,8 @@ Require-Bundle: org.junit,
org.eclipse.mylar.tasks.core,
org.eclipse.mylar.core.tests,
org.eclipse.mylar.trac.ui,
- org.eclipse.mylar.trac.core
+ org.eclipse.mylar.trac.core,
+ org.eclipse.search
Export-Package: org.eclipse.mylar.trac.tests
Bundle-Activator: org.eclipse.mylar.trac.tests.TracTestPlugin
Eclipse-LazyStart: true
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/RepositorySearchQueryTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/RepositorySearchQueryTest.java
index a228046f6..7feac3b10 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/RepositorySearchQueryTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/RepositorySearchQueryTest.java
@@ -13,19 +13,17 @@ package org.eclipse.mylar.trac.tests;
import junit.framework.TestCase;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.mylar.context.tests.support.MylarTestUtils;
import org.eclipse.mylar.context.tests.support.MylarTestUtils.Credentials;
import org.eclipse.mylar.context.tests.support.MylarTestUtils.PrivilegeLevel;
+import org.eclipse.mylar.internal.tasks.ui.search.SearchHitCollector;
import org.eclipse.mylar.internal.trac.core.ITracClient;
import org.eclipse.mylar.internal.trac.core.TracCorePlugin;
import org.eclipse.mylar.internal.trac.core.TracRepositoryQuery;
import org.eclipse.mylar.internal.trac.core.ITracClient.Version;
import org.eclipse.mylar.internal.trac.core.model.TracSearch;
-import org.eclipse.mylar.internal.trac.ui.search.RepositorySearchQuery;
import org.eclipse.mylar.tasks.core.AbstractQueryHit;
-import org.eclipse.mylar.tasks.core.AbstractQueryHitCollector;
import org.eclipse.mylar.tasks.core.TaskRepository;
import org.eclipse.mylar.tasks.core.TaskRepositoryManager;
import org.eclipse.mylar.tasks.ui.TasksUiPlugin;
@@ -78,18 +76,16 @@ public class RepositorySearchQueryTest extends TestCase {
String queryUrl = repository.getUrl() + ITracClient.QUERY_URL + search.toUrl();
TracRepositoryQuery query = new TracRepositoryQuery(repository.getUrl(), queryUrl, "description", null);
- final int count[] = new int[1];
- RepositorySearchQuery searchQuery = new RepositorySearchQuery(repository, query);
- searchQuery.setCollector(new AbstractQueryHitCollector(TasksUiPlugin.getTaskListManager().getTaskList()) {
+ SearchHitCollector collector = new SearchHitCollector(TasksUiPlugin.getTaskListManager()
+ .getTaskList(), repository, query, null) {
@Override
public void addMatch(AbstractQueryHit hit) {
- assertEquals(Constants.TEST_TRAC_096_URL, hit.getRepositoryUrl());
- count[0]++;
+ super.addMatch(hit);
+ assertEquals(Constants.TEST_TRAC_096_URL, hit.getRepositoryUrl());
}
- });
- IStatus status = searchQuery.run(new NullProgressMonitor());
- assertTrue(status.isOK());
- assertEquals(data.tickets.size(), count[0]);
+ };
+ collector.run(new NullProgressMonitor());
+ assertEquals(data.tickets.size(), collector.getHits().size());
}
}
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java
index f78bce72d..087a9fb21 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java
@@ -42,7 +42,7 @@ import org.eclipse.mylar.internal.trac.core.model.TracVersion;
import org.eclipse.mylar.internal.trac.core.model.TracTicket.Key;
import org.eclipse.mylar.internal.trac.ui.wizard.TracRepositorySettingsPage;
import org.eclipse.mylar.tasks.core.AbstractQueryHit;
-import org.eclipse.mylar.tasks.core.AbstractQueryHitCollector;
+import org.eclipse.mylar.tasks.core.QueryHitCollector;
import org.eclipse.mylar.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylar.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylar.tasks.core.ITask;
@@ -193,7 +193,7 @@ public class TracRepositoryConnectorTest extends TestCase {
//MultiStatus queryStatus = new MultiStatus(TracUiPlugin.PLUGIN_ID, IStatus.OK, "Query result", null);
final List<AbstractQueryHit> result = new ArrayList<AbstractQueryHit>();
- AbstractQueryHitCollector hitCollector = new AbstractQueryHitCollector(TasksUiPlugin.getTaskListManager().getTaskList()) {
+ QueryHitCollector hitCollector = new QueryHitCollector(TasksUiPlugin.getTaskListManager().getTaskList()) {
@Override
public void addMatch(AbstractQueryHit hit) {

Back to the top