Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Muskalla2012-11-12 20:57:11 +0000
committerSteffen Pingel2012-11-13 10:48:51 +0000
commit6d030db9f368c33e3dcc5182bacb9f42b62d97e8 (patch)
treeb0e9282b7bf6202616e874fac20cfbf86e7c86aa /org.eclipse.mylyn.trac.tests/src/org
parent107375ddaf942a0500a8e68b60a0dccd88ae975a (diff)
downloadorg.eclipse.mylyn.tasks-6d030db9f368c33e3dcc5182bacb9f42b62d97e8.tar.gz
org.eclipse.mylyn.tasks-6d030db9f368c33e3dcc5182bacb9f42b62d97e8.tar.xz
org.eclipse.mylyn.tasks-6d030db9f368c33e3dcc5182bacb9f42b62d97e8.zip
Implement deleteTask API for Trac
For API consumers, it is helpful to have an API to delete exisiting tasks (eg. for cleanup). Given Mylyn already provides the API, this change simply implements this behavior for Trac Change-Id: I262b2910c8ecd8ffcd835c4531c06663c5c0f7e2
Diffstat (limited to 'org.eclipse.mylyn.trac.tests/src/org')
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorTest.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorTest.java
index bdeaec988..8804f5db8 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorTest.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Steffen Pingel - initial API and implementation
+ * Benjamin Muskalla (Tasktop Technologies) - support for deleting tasks
*******************************************************************************/
package org.eclipse.mylyn.trac.tests.core;
@@ -316,4 +317,18 @@ public class TracRepositoryConnectorTest extends TestCase {
assertEquals(new Date(123 * 1000), task.getCompletionDate());
}
+ public void testDeleteNewTask() throws Exception {
+ ITracClient client = connector.getClientManager().getTracClient(repository);
+ TracTicket ticket = TracTestUtil.createTicket(client, "testDeleteNewTask");
+ String taskId = String.valueOf(ticket.getId());
+ ITask task = TracTestUtil.createTask(repository, taskId);
+ assertTrue(connector.canDeleteTask(repository, task));
+ connector.deleteTask(repository, task, null);
+ try {
+ connector.getTaskData(repository, taskId, null);
+ fail("Task should be gone");
+ } catch (CoreException e) {
+ assertTrue(e.getMessage().contains("does not exist"));
+ }
+ }
}

Back to the top