Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2010-07-08 03:58:33 +0000
committerspingel2010-07-08 03:58:33 +0000
commit574a2d0a13c245cb795cf17e392f7dc76e17db66 (patch)
treeb0b5ec1d4cda3195b5ed4a529b63efde923b35e8 /org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac
parent5575596f6077dcd97955afd137179d1d449b5090 (diff)
downloadorg.eclipse.mylyn.tasks-574a2d0a13c245cb795cf17e392f7dc76e17db66.tar.gz
org.eclipse.mylyn.tasks-574a2d0a13c245cb795cf17e392f7dc76e17db66.tar.xz
org.eclipse.mylyn.tasks-574a2d0a13c245cb795cf17e392f7dc76e17db66.zip
NEW - bug 253932: [upstream] submitting changes also sends unchanged fields possibly resetting them to old values
https://bugs.eclipse.org/bugs/show_bug.cgi?id=253932
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/core/TracTaskDataHandlerXmlRpcTest.java25
1 files changed, 23 insertions, 2 deletions
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 1d5d6aa0a..05eb282ff 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
@@ -377,8 +377,9 @@ public class TracTaskDataHandlerXmlRpcTest extends TestCase {
operation = taskData.getAttributeMapper().getTaskOperation(operations.get(2));
assertEquals("resolve", operation.getOperationId());
assertNotNull(operation.getLabel());
- String associatedId = operation.getTaskAttribute().getMetaData().getValue(
- TaskAttribute.META_ASSOCIATED_ATTRIBUTE_ID);
+ String associatedId = operation.getTaskAttribute()
+ .getMetaData()
+ .getValue(TaskAttribute.META_ASSOCIATED_ATTRIBUTE_ID);
assertNotNull(associatedId);
if (hasReassign) {
@@ -409,4 +410,24 @@ public class TracTaskDataHandlerXmlRpcTest extends TestCase {
assertEquals("", attribute.getValue());
}
+ public void testPostTaskDataMidAirCollision() throws Exception {
+ TracTicket ticket = TracTestUtil.createTicket(client, "midAirCollision");
+ TaskData taskData = taskDataHandler.getTaskData(repository, ticket.getId() + "", new NullProgressMonitor());
+ TaskAttribute attribute = taskData.getRoot().getMappedAttribute(TaskAttribute.PRIORITY);
+ attribute.setValue("blocker");
+
+ // change ticket in repository
+ ticket.putBuiltinValue(Key.PRIORITY, "trivial");
+ client.updateTicket(ticket, "changing priority", null);
+
+ // submit conflicting change
+ try {
+ taskDataHandler.postTaskData(repository, taskData, null, new NullProgressMonitor());
+ fail("Expected CoreException due to mid-air collision");
+ } catch (CoreException e) {
+ assertEquals(RepositoryStatus.createCollisionError(repository.getRepositoryUrl(), TracCorePlugin.ID_PLUGIN)
+ .getMessage(), e.getStatus().getMessage());
+ }
+ }
+
}

Back to the top