Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2012-02-02 12:32:08 +0000
committerSteffen Pingel2012-02-02 12:33:26 +0000
commit577ed16ff5b578b79b5d65f864f63b683c9a7af2 (patch)
treea7ce2da5f963d4b8b2b55baad9a007420202e050
parentea3338f822dc6f8d50cb16a79c051aceb9894069 (diff)
downloadorg.eclipse.mylyn.tasks-577ed16ff5b578b79b5d65f864f63b683c9a7af2.tar.gz
org.eclipse.mylyn.tasks-577ed16ff5b578b79b5d65f864f63b683c9a7af2.tar.xz
org.eclipse.mylyn.tasks-577ed16ff5b578b79b5d65f864f63b683c9a7af2.zip
REOPENED - bug 369697: fix test failures on Java 1.7
https://bugs.eclipse.org/bugs/show_bug.cgi?id=369697
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracRepositoryConnectorTest.java12
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerXmlRpcTest.java2
2 files changed, 10 insertions, 4 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 ce919e4e6..666e9ebdc 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
@@ -258,15 +258,19 @@ public class TracRepositoryConnectorTest extends TestCase {
}
public void testUpdateTaskFromTaskDataSummaryOnly() throws Exception {
- TracTicket ticket = new TracTicket(456);
- ticket.putBuiltinValue(Key.SUMMARY, "mysummary");
-
TracTaskDataHandler taskDataHandler = connector.getTaskDataHandler();
ITracClient client = connector.getClientManager().getTracClient(repository);
assertEquals(client.getAccessMode().name(), repository.getVersion());
+
+ // prepare task data
+ TracTicket ticket = new TracTicket(456);
+ ticket.putBuiltinValue(Key.SUMMARY, "mysummary");
TaskData taskData = taskDataHandler.createTaskDataFromTicket(client, repository, ticket, null);
+
ITask task = TasksUi.getRepositoryModel().createTask(repository, taskData.getTaskId());
+ task.setPriority("P1");
+ // create task from task data
connector.updateTaskFromTaskData(repository, task, taskData);
assertEquals(repository.getRepositoryUrl() + ITracClient.TICKET_URL + "456", task.getUrl());
assertEquals("456", task.getTaskKey());
@@ -303,4 +307,4 @@ public class TracRepositoryConnectorTest extends TestCase {
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/core/TracTaskDataHandlerXmlRpcTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerXmlRpcTest.java
index e4c75bf1a..fa430809e 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerXmlRpcTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerXmlRpcTest.java
@@ -93,6 +93,8 @@ public class TracTaskDataHandlerXmlRpcTest extends TestCase {
public void testMarkStaleTasks() throws Exception {
SynchronizationSession session;
+ // sleep for one second to ensure that the created ticket has a unique time stamp
+ Thread.sleep(1000);
TracTicket ticket = TracTestUtil.createTicket(client, "markStaleTasks");
ITask task = TracTestUtil.createTask(repository, ticket.getId() + "");
long lastModified = TracUtil.toTracTime(task.getModificationDate());

Back to the top