Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2006-08-25 03:29:54 -0400
committermkersten2006-08-25 03:29:54 -0400
commit0e9216c5160dcb4bbfc03d2e326a3e5f9aa0e1cf (patch)
treef217ab836aa1c1f264a341f0e6388a9fcc83b33d /org.eclipse.mylyn.trac.tests
parentf032ec390866831a55500bfb87d329a2100ea929 (diff)
downloadorg.eclipse.mylyn.tasks-0e9216c5160dcb4bbfc03d2e326a3e5f9aa0e1cf.tar.gz
org.eclipse.mylyn.tasks-0e9216c5160dcb4bbfc03d2e326a3e5f9aa0e1cf.tar.xz
org.eclipse.mylyn.tasks-0e9216c5160dcb4bbfc03d2e326a3e5f9aa0e1cf.zip
Progress on: 149981: extract tasks framework from mylar.tasklist
https://bugs.eclipse.org/bugs/show_bug.cgi?id=149981
Diffstat (limited to 'org.eclipse.mylyn.trac.tests')
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/RepositorySearchQueryTest.java12
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java6
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracOfflineTaskHandlerTest.java4
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java14
4 files changed, 19 insertions, 17 deletions
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 e1eb07411..50386bc03 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
@@ -18,7 +18,6 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.mylar.core.core.tests.support.MylarTestUtils;
import org.eclipse.mylar.core.core.tests.support.MylarTestUtils.Credentials;
import org.eclipse.mylar.core.core.tests.support.MylarTestUtils.PrivilegeLevel;
-import org.eclipse.mylar.internal.trac.TracRepositoryConnector;
import org.eclipse.mylar.internal.trac.TracRepositoryQuery;
import org.eclipse.mylar.internal.trac.TracUiPlugin;
import org.eclipse.mylar.internal.trac.core.ITracClient;
@@ -39,8 +38,11 @@ import org.eclipse.mylar.trac.tests.support.XmlRpcServer.TestData;
public class RepositorySearchQueryTest extends TestCase {
private TestData data;
+
private TaskRepositoryManager manager;
- private TracRepositoryConnector connector;
+
+// private TracRepositoryConnector connector;
+
private TaskRepository repository;
public RepositorySearchQueryTest() {
@@ -53,8 +55,8 @@ public class RepositorySearchQueryTest extends TestCase {
manager = TasksUiPlugin.getRepositoryManager();
manager.clearRepositories();
- connector = (TracRepositoryConnector) manager.getRepositoryConnector(TracUiPlugin.REPOSITORY_KIND);
- connector.setForceSyncExec(true);
+// connector = (TracRepositoryConnector) manager.getRepositoryConnector(TracUiPlugin.REPOSITORY_KIND);
+ TasksUiPlugin.getSynchronizationManager().setForceSyncExec(true);
}
protected void init(String url, Version version) {
@@ -70,7 +72,7 @@ public class RepositorySearchQueryTest extends TestCase {
}
public void testSearch() {
- init(Constants.TEST_TRAC_096_URL, Version.TRAC_0_9);
+ init(Constants.TEST_TRAC_096_URL, Version.TRAC_0_9);
TracSearch search = new TracSearch();
String queryUrl = repository.getUrl() + ITracClient.QUERY_URL + search.toUrl();
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java
index 6d5c2d1c7..b8fe42a5d 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java
@@ -28,9 +28,9 @@ import org.eclipse.mylar.internal.trac.TracTask;
import org.eclipse.mylar.internal.trac.TracUiPlugin;
import org.eclipse.mylar.internal.trac.core.ITracClient;
import org.eclipse.mylar.internal.trac.core.ITracClient.Version;
+import org.eclipse.mylar.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylar.tasks.core.IAttachmentHandler;
import org.eclipse.mylar.tasks.core.TaskRepository;
-import org.eclipse.mylar.tasks.ui.AbstractRepositoryConnector;
import org.eclipse.mylar.tasks.ui.TaskRepositoryManager;
import org.eclipse.mylar.tasks.ui.TasksUiPlugin;
import org.eclipse.mylar.trac.tests.support.TestFixture;
@@ -82,7 +82,7 @@ public class TracAttachmentHandlerTest extends TestCase {
AbstractRepositoryConnector abstractConnector = manager.getRepositoryConnector(kind);
connector = (TracRepositoryConnector) abstractConnector;
- connector.setForceSyncExec(true);
+ TasksUiPlugin.getSynchronizationManager().setForceSyncExec(true);
attachmentHandler = connector.getAttachmentHandler();
}
@@ -90,7 +90,7 @@ public class TracAttachmentHandlerTest extends TestCase {
public void testDownloadAttachmentXmlRpc() throws Exception {
init(Constants.TEST_TRAC_010_URL, Version.XML_RPC);
TracTask task = (TracTask) connector.createTaskFromExistingKey(repository, data.attachmentTicketId + "");
- connector.synchronize(task, true, null);
+ TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null);
assertTrue(task.getTaskData().getAttachments().size() > 0);
File file = File.createTempFile("attachment", null);
file.deleteOnExit();
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracOfflineTaskHandlerTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracOfflineTaskHandlerTest.java
index 76dbae188..ae6f68329 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracOfflineTaskHandlerTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracOfflineTaskHandlerTest.java
@@ -56,7 +56,7 @@ public class TracOfflineTaskHandlerTest extends TestCase {
manager.clearRepositories();
connector = (TracRepositoryConnector) manager.getRepositoryConnector(TracUiPlugin.REPOSITORY_KIND);
- connector.setForceSyncExec(true);
+ TasksUiPlugin.getSynchronizationManager().setForceSyncExec(true);
offlineHandler = connector.getOfflineTaskHandler();
}
@@ -93,7 +93,7 @@ public class TracOfflineTaskHandlerTest extends TestCase {
public void testGetChangedSinceLastSyncXmlRpc010() throws Exception {
init(Constants.TEST_TRAC_010_URL, Version.XML_RPC);
TracTask task = (TracTask) connector.createTaskFromExistingKey(repository, "1");
- connector.synchronize(task, true, null);
+ TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null);
Set<AbstractRepositoryTask> tasks = new HashSet<AbstractRepositoryTask>();
tasks.add(task);
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 2336698d7..ac8b1e88f 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,12 +42,12 @@ import org.eclipse.mylar.internal.trac.model.TracVersion;
import org.eclipse.mylar.internal.trac.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.AbstractRepositoryConnector;
import org.eclipse.mylar.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylar.tasks.core.ITask;
import org.eclipse.mylar.tasks.core.RepositoryAttachment;
import org.eclipse.mylar.tasks.core.TaskList;
import org.eclipse.mylar.tasks.core.TaskRepository;
-import org.eclipse.mylar.tasks.ui.AbstractRepositoryConnector;
import org.eclipse.mylar.tasks.ui.TaskRepositoryManager;
import org.eclipse.mylar.tasks.ui.TasksUiPlugin;
import org.eclipse.mylar.trac.tests.support.TestFixture;
@@ -103,7 +103,7 @@ public class TracRepositoryConnectorTest extends TestCase {
assertEquals(abstractConnector.getRepositoryType(), kind);
connector = (TracRepositoryConnector) abstractConnector;
- connector.setForceSyncExec(true);
+ TasksUiPlugin.getSynchronizationManager().setForceSyncExec(true);
}
public void testGetRepositoryUrlFromTaskUrl() {
@@ -258,7 +258,7 @@ public class TracRepositoryConnectorTest extends TestCase {
public void testContext010() throws Exception {
init(Constants.TEST_TRAC_010_URL, Version.XML_RPC);
TracTask task = (TracTask) connector.createTaskFromExistingKey(repository, data.attachmentTicketId + "");
- connector.synchronize(task, true, null);
+ TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null);
int size = task.getTaskData().getAttachments().size();
@@ -266,13 +266,13 @@ public class TracRepositoryConnectorTest extends TestCase {
sourceContextFile.createNewFile();
sourceContextFile.deleteOnExit();
- assertTrue(connector.attachContext(repository, task, ""));
+ assertTrue(connector.attachContext(repository, task, "", TasksUiPlugin.getDefault().getProxySettings()));
- connector.synchronize(task, true, null);
+ TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null);
assertEquals(size + 1, task.getTaskData().getAttachments().size());
RepositoryAttachment attachment = task.getTaskData().getAttachments().get(size);
- assertTrue(connector.retrieveContext(repository, task, attachment));
+ assertTrue(connector.retrieveContext(repository, task, attachment, TasksUiPlugin.getDefault().getProxySettings(), TasksUiPlugin.getDefault().getDataDirectory()));
}
public void testContext096() throws Exception {
@@ -284,7 +284,7 @@ public class TracRepositoryConnectorTest extends TestCase {
sourceContextFile.deleteOnExit();
try {
- connector.attachContext(repository, task, "");
+ connector.attachContext(repository, task, "", TasksUiPlugin.getDefault().getProxySettings());
fail("expected CoreException"); // operation should not be supported
} catch (CoreException e) {
}

Back to the top