Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2006-08-30 17:40:51 -0400
committerspingel2006-08-30 17:40:51 -0400
commita9a85176253ae5a0e2e9dee4b54b7fb2ad2d223f (patch)
treee966d0bacad0ed7b81a32c5a50ee5847424fdfe2 /org.eclipse.mylyn.trac.tests
parent2b248f90ef785ba9e258893a187794d113aef5a4 (diff)
downloadorg.eclipse.mylyn.tasks-a9a85176253ae5a0e2e9dee4b54b7fb2ad2d223f.tar.gz
org.eclipse.mylyn.tasks-a9a85176253ae5a0e2e9dee4b54b7fb2ad2d223f.tar.xz
org.eclipse.mylyn.tasks-a9a85176253ae5a0e2e9dee4b54b7fb2ad2d223f.zip
Progress on: 155261: Trac tasks are wrongly marked to have incoming changes
https://bugs.eclipse.org/bugs/show_bug.cgi?id=155261
Diffstat (limited to 'org.eclipse.mylyn.trac.tests')
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracOfflineTaskHandlerTest.java48
1 files changed, 25 insertions, 23 deletions
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 b28748999..434713d7c 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
@@ -22,6 +22,8 @@ import org.eclipse.mylar.core.core.tests.support.MylarTestUtils.PrivilegeLevel;
import org.eclipse.mylar.internal.trac.core.ITracClient;
import org.eclipse.mylar.internal.trac.core.TracCorePlugin;
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.internal.trac.ui.TracRepositoryConnector;
import org.eclipse.mylar.internal.trac.ui.TracTask;
import org.eclipse.mylar.tasks.core.AbstractRepositoryTask;
@@ -97,7 +99,7 @@ public class TracOfflineTaskHandlerTest extends TestCase {
init(Constants.TEST_TRAC_010_URL, Version.XML_RPC);
TracTask task = (TracTask) connector.createTaskFromExistingKey(repository, data.offlineHandlerTicketId + "");
TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null);
-// int lastModified = Integer.parseInt(task.getTaskData().getLastModified());
+ int lastModified = Integer.parseInt(task.getTaskData().getLastModified());
Set<AbstractRepositoryTask> tasks = new HashSet<AbstractRepositoryTask>();
tasks.add(task);
@@ -107,28 +109,28 @@ public class TracOfflineTaskHandlerTest extends TestCase {
assertEquals(tasks, result);
// always returns the ticket because time comparison mode is >=
-// repository.setSyncTimeStamp(lastModified + "");
-// result = offlineHandler.getChangedSinceLastSync(repository, tasks);
-// assertEquals(tasks, result);
-//
-// repository.setSyncTimeStamp((lastModified + 1) + "");
-// result = offlineHandler.getChangedSinceLastSync(repository, tasks);
-// assertTrue(result.isEmpty());
-//
-// // change ticket making sure it gets a new change time
-// Thread.currentThread().wait(1000);
-// ITracClient client = connector.getClientManager().getRepository(repository);
-// TracTicket ticket = client.getTicket(data.offlineHandlerTicketId);
-// if (ticket.getValue(Key.DESCRIPTION).equals(lastModified + "")) {
-// ticket.putBuiltinValue(Key.DESCRIPTION, lastModified + "x");
-// } else {
-// ticket.putBuiltinValue(Key.DESCRIPTION, lastModified + "");
-// }
-// client.updateTicket(ticket, "comment");
-//
-// repository.setSyncTimeStamp((lastModified + 1) + "");
-// result = offlineHandler.getChangedSinceLastSync(repository, tasks);
-// assertEquals(tasks, result);
+ repository.setSyncTimeStamp(lastModified + "");
+ result = offlineHandler.getChangedSinceLastSync(repository, tasks);
+ assertEquals(tasks, result);
+
+ repository.setSyncTimeStamp((lastModified + 1) + "");
+ result = offlineHandler.getChangedSinceLastSync(repository, tasks);
+ assertTrue(result.isEmpty());
+
+ // change ticket making sure it gets a new change time
+ Thread.sleep(1000);
+ ITracClient client = connector.getClientManager().getRepository(repository);
+ TracTicket ticket = client.getTicket(data.offlineHandlerTicketId);
+ if (ticket.getValue(Key.DESCRIPTION).equals(lastModified + "")) {
+ ticket.putBuiltinValue(Key.DESCRIPTION, lastModified + "x");
+ } else {
+ ticket.putBuiltinValue(Key.DESCRIPTION, lastModified + "");
+ }
+ client.updateTicket(ticket, "comment");
+
+ repository.setSyncTimeStamp((lastModified + 1) + "");
+ result = offlineHandler.getChangedSinceLastSync(repository, tasks);
+ assertEquals(tasks, result);
}
}

Back to the top