Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2011-03-01 09:08:47 +0000
committerspingel2011-03-01 09:08:47 +0000
commit641bae63d3bcc1df5ee5173007128f8b6e57eca9 (patch)
tree7713c0a93fc812c0a3f369b27f39ebbb4ede92f6 /org.eclipse.mylyn.tasks.tests/src
parentba8aaff78aadbc9f6e833e03fa64552e09bbc532 (diff)
downloadorg.eclipse.mylyn.tasks-641bae63d3bcc1df5ee5173007128f8b6e57eca9.tar.gz
org.eclipse.mylyn.tasks-641bae63d3bcc1df5ee5173007128f8b6e57eca9.tar.xz
org.eclipse.mylyn.tasks-641bae63d3bcc1df5ee5173007128f8b6e57eca9.zip
NEW - bug 286963: [api] add support for ignoring incoming notification on specified fields
https://bugs.eclipse.org/bugs/show_bug.cgi?id=286963
Diffstat (limited to 'org.eclipse.mylyn.tasks.tests/src')
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/support/MockSynchronizationParticipant.java37
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/TaskAttributeDiffTest.java2
2 files changed, 38 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/support/MockSynchronizationParticipant.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/support/MockSynchronizationParticipant.java
new file mode 100644
index 000000000..bc6ff9fe7
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/support/MockSynchronizationParticipant.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.tasks.tests.support;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.mylyn.tasks.core.data.ITaskAttributeDiff;
+import org.eclipse.mylyn.tasks.core.data.ITaskDataDiff;
+import org.eclipse.mylyn.tasks.core.sync.SynchronizationParticipant;
+
+/**
+ * @author Steffen Pingel
+ */
+public class MockSynchronizationParticipant extends SynchronizationParticipant {
+
+ public MockSynchronizationParticipant() {
+ }
+
+ @Override
+ public void processUpdate(ITaskDataDiff diff, IProgressMonitor monitor) {
+ if (diff.getChangedAttributes().size() == 1) {
+ ITaskAttributeDiff attributeDiff = diff.getChangedAttributes().iterator().next();
+ if ("version".equals(attributeDiff.getAttributeId())) {
+ diff.setHasChanged(false);
+ }
+ }
+ }
+
+}
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/TaskAttributeDiffTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/TaskAttributeDiffTest.java
index 861658a4e..1d8f1457e 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/TaskAttributeDiffTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/TaskAttributeDiffTest.java
@@ -21,7 +21,7 @@ import junit.framework.TestCase;
import org.eclipse.mylyn.internal.tasks.core.RepositoryModel;
import org.eclipse.mylyn.internal.tasks.core.TaskList;
import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager;
-import org.eclipse.mylyn.internal.tasks.ui.notifications.TaskDataDiff;
+import org.eclipse.mylyn.internal.tasks.core.data.TaskDataDiff;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;

Back to the top