Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Davis2015-04-24 13:52:40 -0400
committerSam Davis2015-05-11 20:12:12 -0400
commitf34080f8b9904a4e4b9800c55d479fb56dec1418 (patch)
tree20bb368393d61e703bdd612de190e3d65d46a603 /org.eclipse.mylyn.tasks.core.tests
parentbbbea4be1af94a24280fe21c3e1e22e556f658f7 (diff)
downloadorg.eclipse.mylyn.tasks-f34080f8b9904a4e4b9800c55d479fb56dec1418.tar.gz
org.eclipse.mylyn.tasks-f34080f8b9904a4e4b9800c55d479fb56dec1418.tar.xz
org.eclipse.mylyn.tasks-f34080f8b9904a4e4b9800c55d479fb56dec1418.zip
465346: support partial repository configuration update
Change-Id: Ie970355deaa35b7916ec32d4947f64f1db1ed28e Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=465346
Diffstat (limited to 'org.eclipse.mylyn.tasks.core.tests')
-rw-r--r--org.eclipse.mylyn.tasks.core.tests/src/org/eclipse/mylyn/internal/tasks/core/TaskJobFactoryTest.java49
1 files changed, 49 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.tasks.core.tests/src/org/eclipse/mylyn/internal/tasks/core/TaskJobFactoryTest.java b/org.eclipse.mylyn.tasks.core.tests/src/org/eclipse/mylyn/internal/tasks/core/TaskJobFactoryTest.java
new file mode 100644
index 000000000..921f05bca
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.core.tests/src/org/eclipse/mylyn/internal/tasks/core/TaskJobFactoryTest.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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.internal.tasks.core;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.mylyn.internal.tasks.core.data.TaskDataManager;
+import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
+import org.eclipse.mylyn.tasks.core.IRepositoryManager;
+import org.eclipse.mylyn.tasks.core.IRepositoryModel;
+import org.eclipse.mylyn.tasks.core.ITask;
+import org.eclipse.mylyn.tasks.core.TaskRepository;
+import org.eclipse.mylyn.tasks.core.sync.TaskJob;
+
+public class TaskJobFactoryTest extends TestCase {
+ private TaskJobFactory jobFactory;
+
+ @Override
+ protected void setUp() throws Exception {
+ jobFactory = new TaskJobFactory(mock(TaskList.class), mock(TaskDataManager.class),
+ mock(IRepositoryManager.class), mock(IRepositoryModel.class));
+ }
+
+ public void testCreateUpdateRepositoryConfigurationJob() throws CoreException, InterruptedException {
+ AbstractRepositoryConnector connector = mock(AbstractRepositoryConnector.class);
+ TaskRepository repository = new TaskRepository("mock", "http://mock");
+ ITask task = mock(ITask.class);
+ TaskJob job = jobFactory.createUpdateRepositoryConfigurationJob(connector, repository, task);
+ job.schedule();
+ job.join();
+ verify(connector).updateRepositoryConfiguration(eq(repository), eq(task), any(IProgressMonitor.class));
+ }
+
+}

Back to the top