summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Muskalla2012-08-10 10:59:43 (EDT)
committer Benjamin Muskalla2012-08-10 10:59:43 (EDT)
commit1d3666f7377c3f29438ab564eec4f0c27690d56b (patch)
tree6f2ffd80498c942d315f49284680a35a4161c2e4
parent10fcea1fc458ba6b29241f4d67e17fee0f0bddbe (diff)
downloadorg.eclipse.mylyn.tasks-1d3666f7377c3f29438ab564eec4f0c27690d56b.zip
org.eclipse.mylyn.tasks-1d3666f7377c3f29438ab564eec4f0c27690d56b.tar.gz
org.eclipse.mylyn.tasks-1d3666f7377c3f29438ab564eec4f0c27690d56b.tar.bz2
NEW - bug 386920: Trac doesn't use Policy for monitor in refs/changes/58/7158/2
initializeTaskData https://bugs.eclipse.org/bugs/show_bug.cgi?id=386920 Change-Id: I09b2d7139dd2a2b8a052209b7355d574117e4ba7
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracTaskDataHandler.java5
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/core/TracTaskDataHandlerXmlRpcTest.java12
2 files changed, 15 insertions, 2 deletions
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracTaskDataHandler.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracTaskDataHandler.java
index 650c779..29da420 100644
--- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracTaskDataHandler.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/TracTaskDataHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 Steffen Pingel and others.
+ * Copyright (c) 2006, 2012 Steffen Pingel 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Steffen Pingel - initial API and implementation
+ * Benjamin Muskalla - bug 386920
*******************************************************************************/
package org.eclipse.mylyn.internal.trac.core;
@@ -54,6 +55,7 @@ import org.eclipse.osgi.util.NLS;
/**
* @author Steffen Pingel
+ * @author Benjamin Muskalla
*/
public class TracTaskDataHandler extends AbstractTaskDataHandler {
@@ -467,6 +469,7 @@ public class TracTaskDataHandler extends AbstractTaskDataHandler {
@Override
public boolean initializeTaskData(TaskRepository repository, TaskData data, ITaskMapping initializationData,
IProgressMonitor monitor) throws CoreException {
+ monitor = Policy.monitorFor(monitor);
try {
ITracClient client = connector.getClientManager().getTracClient(repository);
client.updateAttributes(monitor, false);
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 bd20e50..719aa5d 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2010 Steffen Pingel and others.
+ * Copyright (c) 2006, 2012 Steffen Pingel 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Steffen Pingel - initial API and implementation
+ * Benjamin Muskalla - bug 386920
*******************************************************************************/
package org.eclipse.mylyn.trac.tests.core;
@@ -45,6 +46,7 @@ import org.eclipse.mylyn.tasks.core.TaskMapping;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.AbstractTaskAttachmentHandler;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
+import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.core.data.TaskMapper;
import org.eclipse.mylyn.tasks.core.data.TaskOperation;
@@ -56,6 +58,7 @@ import org.eclipse.mylyn.trac.tests.support.XmlRpcServer.TestData;
/**
* @author Steffen Pingel
+ * @author Benjamin Muskalla
*/
public class TracTaskDataHandlerXmlRpcTest extends TestCase {
@@ -361,6 +364,13 @@ public class TracTaskDataHandlerXmlRpcTest extends TestCase {
assertNull(taskData.getRoot().getAttribute(TracAttribute.SEVERITY.getTracKey()));
}
+ public void testInitializeTaskDataNoMonitor() throws Exception {
+ connector.getClientManager().repositoryRemoved(repository);
+ TaskData taskData = new TaskData(new TaskAttributeMapper(repository), TracCorePlugin.CONNECTOR_KIND, "", "");
+ boolean initialized = taskDataHandler.initializeTaskData(repository, taskData, new TaskMapping(), null);
+ assertTrue(initialized);
+ }
+
public void testOperations() throws Exception {
boolean hasReassign = TracFixture.current().getVersion().compareTo("0.11") >= 0;