Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrelves2006-11-28 18:12:57 -0500
committerrelves2006-11-28 18:12:57 -0500
commit764175789411dbaaee6f125d60c412b846d9a649 (patch)
tree3f5b1859f976895018a70766c8b7a165c0d1f1a0 /org.eclipse.mylyn.trac.tests
parent86fd512f03cb464919976a309df1331712162678 (diff)
downloadorg.eclipse.mylyn.tasks-764175789411dbaaee6f125d60c412b846d9a649.tar.gz
org.eclipse.mylyn.tasks-764175789411dbaaee6f125d60c412b846d9a649.tar.xz
org.eclipse.mylyn.tasks-764175789411dbaaee6f125d60c412b846d9a649.zip
NEW - bug 165498: Create unified abstract support for task submission to repository
https://bugs.eclipse.org/bugs/show_bug.cgi?id=165498
Diffstat (limited to 'org.eclipse.mylyn.trac.tests')
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java15
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracOfflineTaskHandlerTest.java10
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java10
3 files changed, 17 insertions, 18 deletions
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 d2501e5c2..c273741a9 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
@@ -29,7 +29,6 @@ import org.eclipse.mylar.internal.trac.core.TracRepositoryConnector;
import org.eclipse.mylar.internal.trac.core.TracTask;
import org.eclipse.mylar.internal.trac.core.ITracClient.Version;
import org.eclipse.mylar.tasks.core.AbstractRepositoryConnector;
-import org.eclipse.mylar.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylar.tasks.core.IAttachmentHandler;
import org.eclipse.mylar.tasks.core.TaskRepository;
import org.eclipse.mylar.tasks.core.TaskRepositoryManager;
@@ -87,12 +86,12 @@ 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 + "", null);
+ TracTask task = (TracTask) connector.createTaskFromExistingKey(repository, data.attachmentTicketId + "");
TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null);
assertTrue(task.getTaskData().getAttachments().size() > 0);
File file = File.createTempFile("attachment", null);
file.deleteOnExit();
- attachmentHandler.downloadAttachment(repository, AbstractRepositoryTask.getTaskId(task.getHandleIdentifier()), task.getTaskData().getAttachments().get(0), file);
+ attachmentHandler.downloadAttachment(repository, task.getTaskData().getAttachments().get(0), file);
byte[] result = new byte[6];
InputStream in = new FileInputStream(file);
@@ -107,7 +106,7 @@ public class TracAttachmentHandlerTest extends TestCase {
public void testUploadAttachmentXmlRpc() throws Exception {
init(Constants.TEST_TRAC_010_URL, Version.XML_RPC);
- TracTask task = (TracTask) connector.createTaskFromExistingKey(repository, data.attachmentTicketId + "", null);
+ TracTask task = (TracTask) connector.createTaskFromExistingKey(repository, data.attachmentTicketId + "");
File file = File.createTempFile("attachment", null);
file.deleteOnExit();
OutputStream out = new FileOutputStream(file);
@@ -125,25 +124,25 @@ public class TracAttachmentHandlerTest extends TestCase {
public void testCanUploadAttachmentXmlRpc() throws CoreException {
init(Constants.TEST_TRAC_010_URL, Version.XML_RPC);
- TracTask task = (TracTask) connector.createTaskFromExistingKey(repository, data.attachmentTicketId + "", null);
+ TracTask task = (TracTask) connector.createTaskFromExistingKey(repository, data.attachmentTicketId + "");
assertTrue(attachmentHandler.canUploadAttachment(repository, task));
}
public void testCanUploadAttachmentWeb() throws CoreException {
init(Constants.TEST_TRAC_010_URL, Version.TRAC_0_9);
- TracTask task = (TracTask) connector.createTaskFromExistingKey(repository, data.attachmentTicketId + "", null);
+ TracTask task = (TracTask) connector.createTaskFromExistingKey(repository, data.attachmentTicketId + "");
assertFalse(attachmentHandler.canUploadAttachment(repository, task));
}
public void testCanDownloadAttachmentXmlRpc() throws Exception {
init(Constants.TEST_TRAC_010_URL, Version.XML_RPC);
- TracTask task = (TracTask) connector.createTaskFromExistingKey(repository, data.attachmentTicketId + "", null);
+ TracTask task = (TracTask) connector.createTaskFromExistingKey(repository, data.attachmentTicketId + "");
assertTrue(attachmentHandler.canDownloadAttachment(repository, task));
}
public void testCanDownloadAttachmentWeb() throws Exception {
init(Constants.TEST_TRAC_010_URL, Version.TRAC_0_9);
- TracTask task = (TracTask) connector.createTaskFromExistingKey(repository, data.attachmentTicketId + "", null);
+ TracTask task = (TracTask) connector.createTaskFromExistingKey(repository, data.attachmentTicketId + "");
assertFalse(attachmentHandler.canDownloadAttachment(repository, task));
}
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 fc1bdb081..feed358a2 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
@@ -27,7 +27,7 @@ import org.eclipse.mylar.internal.trac.core.ITracClient.Version;
import org.eclipse.mylar.internal.trac.core.model.TracTicket;
import org.eclipse.mylar.internal.trac.core.model.TracTicket.Key;
import org.eclipse.mylar.tasks.core.AbstractRepositoryTask;
-import org.eclipse.mylar.tasks.core.IOfflineTaskHandler;
+import org.eclipse.mylar.tasks.core.ITaskDataHandler;
import org.eclipse.mylar.tasks.core.TaskRepository;
import org.eclipse.mylar.tasks.core.TaskRepositoryManager;
import org.eclipse.mylar.tasks.ui.TasksUiPlugin;
@@ -41,7 +41,7 @@ public class TracOfflineTaskHandlerTest extends TestCase {
private TracRepositoryConnector connector;
- private IOfflineTaskHandler offlineHandler;
+ private ITaskDataHandler offlineHandler;
private TaskRepository repository;
@@ -64,7 +64,7 @@ public class TracOfflineTaskHandlerTest extends TestCase {
connector = (TracRepositoryConnector) manager.getRepositoryConnector(TracCorePlugin.REPOSITORY_KIND);
TasksUiPlugin.getSynchronizationManager().setForceSyncExec(true);
- offlineHandler = connector.getOfflineTaskHandler();
+ offlineHandler = connector.getTaskDataHandler();
}
protected void init(String url, Version version) {
@@ -81,7 +81,7 @@ public class TracOfflineTaskHandlerTest extends TestCase {
public void testGetChangedSinceLastSyncWeb096() throws Exception {
init(Constants.TEST_TRAC_096_URL, Version.TRAC_0_9);
- TracTask task = (TracTask) connector.createTaskFromExistingKey(repository, data.offlineHandlerTicketId + "", null);
+ TracTask task = (TracTask) connector.createTaskFromExistingKey(repository, data.offlineHandlerTicketId + "");
Set<AbstractRepositoryTask> tasks = new HashSet<AbstractRepositoryTask>();
tasks.add(task);
@@ -98,7 +98,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, data.offlineHandlerTicketId + "", null);
+ TracTask task = (TracTask) connector.createTaskFromExistingKey(repository, data.offlineHandlerTicketId + "");
TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null);
int lastModified = Integer.parseInt(task.getTaskData().getLastModified());
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 8db8c341c..4a99a9b9e 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
@@ -133,20 +133,20 @@ public class TracRepositoryConnectorTest extends TestCase {
protected void createTaskFromExistingKey() throws CoreException {
String id = data.tickets.get(0).getId() + "";
- ITask task = connector.createTaskFromExistingKey(repository, id, null);
+ ITask task = connector.createTaskFromExistingKey(repository, id);
assertNotNull(task);
assertEquals(TracTask.class, task.getClass());
assertTrue(task.getSummary().contains("summary1"));
assertEquals(repository.getUrl() + ITracClient.TICKET_URL + id, task.getUrl());
try {
- task = connector.createTaskFromExistingKey(repository, "does not exist", null);
+ task = connector.createTaskFromExistingKey(repository, "does not exist");
fail("Expected CoreException");
} catch (CoreException e) {
}
try {
- task = connector.createTaskFromExistingKey(repository, Integer.MAX_VALUE + "", null);
+ task = connector.createTaskFromExistingKey(repository, Integer.MAX_VALUE + "");
fail("Expected CoreException");
} catch (CoreException e) {
}
@@ -276,7 +276,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 + "", null);
+ TracTask task = (TracTask) connector.createTaskFromExistingKey(repository, data.attachmentTicketId + "");
TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null);
//int size = task.getTaskData().getAttachments().size();
@@ -297,7 +297,7 @@ public class TracRepositoryConnectorTest extends TestCase {
public void testContext096() throws Exception {
init(Constants.TEST_TRAC_096_URL, Version.TRAC_0_9);
- TracTask task = (TracTask) connector.createTaskFromExistingKey(repository, data.attachmentTicketId + "", null);
+ TracTask task = (TracTask) connector.createTaskFromExistingKey(repository, data.attachmentTicketId + "");
File sourceContextFile = ContextCorePlugin.getContextManager().getFileForContext(task.getHandleIdentifier());
sourceContextFile.createNewFile();

Back to the top