Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2008-06-30 22:57:24 +0000
committerspingel2008-06-30 22:57:24 +0000
commit74700c8c68cdcc2af9fd7368103b860b21efae3d (patch)
treea91ce7a24cf4b8bc28336d83ab6339482008c8c0 /org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac
parent69d2417b31db270dd4526a7c7322d8a927cbb586 (diff)
downloadorg.eclipse.mylyn.tasks-74700c8c68cdcc2af9fd7368103b860b21efae3d.tar.gz
org.eclipse.mylyn.tasks-74700c8c68cdcc2af9fd7368103b860b21efae3d.tar.xz
org.eclipse.mylyn.tasks-74700c8c68cdcc2af9fd7368103b860b21efae3d.zip
RESOLVED - bug 238751: TRAC closed (fixed) tasks are not displayed as complete (green) by Mylyn
https://bugs.eclipse.org/bugs/show_bug.cgi?id=238751
Diffstat (limited to 'org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac')
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java29
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/AbstractTracClientSearchTest.java21
2 files changed, 48 insertions, 2 deletions
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 49736f899..012058b84 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
@@ -13,6 +13,7 @@ import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
+import java.util.Date;
import java.util.List;
import junit.framework.TestCase;
@@ -322,7 +323,7 @@ public class TracRepositoryConnectorTest extends TestCase {
ticket.putBuiltinValue(Key.SUMMARY, "mysummary");
ticket.putBuiltinValue(Key.TYPE, "mytype");
- TracTaskDataHandler taskDataHandler = (TracTaskDataHandler) connector.getTaskDataHandler();
+ TracTaskDataHandler taskDataHandler = connector.getTaskDataHandler();
ITracClient client = connector.getClientManager().getTracClient(repository);
TaskData taskData = taskDataHandler.createTaskDataFromTicket(client, repository, ticket, null);
ITask task = TasksUi.getRepositoryModel().createTask(repository, taskData.getTaskId());
@@ -341,7 +342,7 @@ public class TracRepositoryConnectorTest extends TestCase {
TracTicket ticket = new TracTicket(456);
ticket.putBuiltinValue(Key.SUMMARY, "mysummary");
- TracTaskDataHandler taskDataHandler = (TracTaskDataHandler) connector.getTaskDataHandler();
+ TracTaskDataHandler taskDataHandler = connector.getTaskDataHandler();
ITracClient client = connector.getClientManager().getTracClient(repository);
TaskData taskData = taskDataHandler.createTaskDataFromTicket(client, repository, ticket, null);
ITask task = TasksUi.getRepositoryModel().createTask(repository, taskData.getTaskId());
@@ -354,4 +355,28 @@ public class TracRepositoryConnectorTest extends TestCase {
assertEquals(AbstractTask.DEFAULT_TASK_KIND, task.getTaskKind());
}
+ public void testUpdateTaskFromTaskDataClosed() throws Exception {
+ init(TracTestConstants.TEST_TRAC_010_URL, Version.TRAC_0_9);
+ TracTaskDataHandler taskDataHandler = connector.getTaskDataHandler();
+ ITracClient client = connector.getClientManager().getTracClient(repository);
+ ITask task = TasksUi.getRepositoryModel().createTask(repository, "1");
+
+ TracTicket ticket = new TracTicket(123);
+ ticket.putBuiltinValue(Key.STATUS, "resolved");
+ TaskData taskData = taskDataHandler.createTaskDataFromTicket(client, repository, ticket, null);
+ connector.updateTaskFromTaskData(repository, task, taskData);
+ assertEquals(null, task.getCompletionDate());
+
+ ticket.putBuiltinValue(Key.STATUS, "closed");
+ taskData = taskDataHandler.createTaskDataFromTicket(client, repository, ticket, null);
+ connector.updateTaskFromTaskData(repository, task, taskData);
+ assertEquals(new Date(0), task.getCompletionDate());
+
+ ticket.putBuiltinValue(Key.STATUS, "closed");
+ ticket.putBuiltinValue(Key.CHANGE_TIME, "123");
+ taskData = taskDataHandler.createTaskDataFromTicket(client, repository, ticket, null);
+ connector.updateTaskFromTaskData(repository, task, taskData);
+ assertEquals(new Date(123 * 1000), task.getCompletionDate());
+ }
+
} \ No newline at end of file
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/AbstractTracClientSearchTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/AbstractTracClientSearchTest.java
index aadf40b49..adbff997b 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/AbstractTracClientSearchTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/client/AbstractTracClientSearchTest.java
@@ -246,4 +246,25 @@ public abstract class AbstractTracClientSearchTest extends AbstractTracClientTes
assertEquals("summary1", result.get(0).getValue(Key.SUMMARY));
}
+ public void testStatusClosed096() throws Exception {
+ connect096();
+ statusClosed();
+ }
+
+ public void testStatusClosed010() throws Exception {
+ connect010();
+ statusClosed();
+ }
+
+ public void testStatusClosed011() throws Exception {
+ connect011();
+ statusClosed();
+ }
+
+ private void statusClosed() throws Exception {
+ TracTicket ticket = repository.getTicket(data.offlineHandlerTicketId, null);
+ assertEquals("closed", ticket.getValue(Key.STATUS));
+ assertEquals("fixed", ticket.getValue(Key.RESOLUTION));
+ }
+
}

Back to the top