Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2006-08-23 22:40:07 -0400
committermkersten2006-08-23 22:40:07 -0400
commit6bad250a5c2747af6ebb062dfaa7b1eb00b9aa0b (patch)
tree8e01a39ebb13257b85ae6649c23b953d516c7359 /org.eclipse.mylyn.trac.tests
parent1f556f2beda8fbf5fb3bf6589b9287373f08ef23 (diff)
downloadorg.eclipse.mylyn.tasks-6bad250a5c2747af6ebb062dfaa7b1eb00b9aa0b.tar.gz
org.eclipse.mylyn.tasks-6bad250a5c2747af6ebb062dfaa7b1eb00b9aa0b.tar.xz
org.eclipse.mylyn.tasks-6bad250a5c2747af6ebb062dfaa7b1eb00b9aa0b.zip
Completed: 154798: externalizer fails if Trac repository url is changed and a query exists
https://bugs.eclipse.org/bugs/show_bug.cgi?id=154798
Diffstat (limited to 'org.eclipse.mylyn.trac.tests')
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryQueryTest.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryQueryTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryQueryTest.java
index 55dda282d..594409cb7 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryQueryTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryQueryTest.java
@@ -17,12 +17,37 @@ import java.util.List;
import junit.framework.TestCase;
import org.eclipse.mylar.internal.trac.TracRepositoryQuery;
+import org.eclipse.mylar.internal.trac.TracUiPlugin;
import org.eclipse.mylar.internal.trac.core.ITracClient;
import org.eclipse.mylar.internal.trac.model.TracSearch;
import org.eclipse.mylar.internal.trac.model.TracSearchFilter;
+import org.eclipse.mylar.tasks.core.TaskRepository;
+import org.eclipse.mylar.tasks.ui.TaskRepositoryManager;
+import org.eclipse.mylar.tasks.ui.TasksUiPlugin;
public class TracRepositoryQueryTest extends TestCase {
+ public void testChangeRepositoryUrl() {
+ TaskRepositoryManager manager = TasksUiPlugin.getRepositoryManager();
+ manager.clearRepositories();
+
+ TaskRepository repository = new TaskRepository(TracUiPlugin.REPOSITORY_KIND, Constants.TEST_TRAC_096_URL);
+ manager.addRepository(repository);
+
+ TracSearch search = new TracSearch();
+ String queryUrl = repository.getUrl() + ITracClient.QUERY_URL + search.toUrl();
+ TracRepositoryQuery query = new TracRepositoryQuery(repository.getUrl(), queryUrl, "description", null);
+ TasksUiPlugin.getTaskListManager().getTaskList().addQuery(query);
+
+ String oldUrl = repository.getUrl();
+ String newUrl = Constants.TEST_TRAC_010_URL;
+ TasksUiPlugin.getTaskListManager().refactorRepositoryUrl(oldUrl, newUrl);
+ repository.setUrl(newUrl);
+
+ assertEquals(newUrl, query.getRepositoryUrl());
+ assertEquals(newUrl + ITracClient.QUERY_URL + search.toUrl(), query.getUrl());
+ }
+
public void testGetFilterList() {
String repositoryUrl = "https://foo.bar/repo";
String parameterUrl = "&status=new&status=assigned&status=reopened&milestone=0.1";

Back to the top