Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2019-09-22 14:58:25 +0000
committerThomas Wolf2019-09-30 20:14:10 +0000
commit0c17469b141549011d5d2f4e6731b3fab2ef4379 (patch)
treeb9052c379cfbb96a71709a7cc8ab170995458135 /org.eclipse.egit.ui.test/src
parenta0b9dfe131ad2046e2f4b3cfdcd60ba7c7ae81d3 (diff)
downloadegit-0c17469b141549011d5d2f4e6731b3fab2ef4379.tar.gz
egit-0c17469b141549011d5d2f4e6731b3fab2ef4379.tar.xz
egit-0c17469b141549011d5d2f4e6731b3fab2ef4379.zip
Adapt editor inputs to IFile for merge with index stage 2 as input
Otherwise the framework cannot find the correct DocumentProvider, which may cause a PartInitException on opening the merge editor. This uses the same hacks as in LocalNonWorkspaceTypedElement. Bug: 550989 Change-Id: Id024c7f849f4cc6d16e6aa4e845f04f86c9534e5 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.egit.ui.test/src')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/MergeToolTest.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/MergeToolTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/MergeToolTest.java
index 55a1cb612f..35f2a3487b 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/MergeToolTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/team/actions/MergeToolTest.java
@@ -22,6 +22,7 @@ import org.eclipse.egit.core.Activator;
import org.eclipse.egit.core.JobFamilies;
import org.eclipse.egit.core.internal.indexdiff.IndexDiffCache;
import org.eclipse.egit.core.op.MergeOperation;
+import org.eclipse.egit.ui.UIPreferences;
import org.eclipse.egit.ui.common.CompareEditorTester;
import org.eclipse.egit.ui.common.LocalRepositoryTestCase;
import org.eclipse.egit.ui.test.ContextMenuHelper;
@@ -32,6 +33,7 @@ import org.eclipse.jgit.junit.TestRepository;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -42,16 +44,28 @@ public class MergeToolTest extends LocalRepositoryTestCase {
private TestRepository testRepository;
+ private int mergeMode;
+
@Before
public void setUp() throws Exception {
File repositoryFile = createProjectAndCommitToRepository();
Repository repository = lookupRepository(repositoryFile);
- testRepository = new TestRepository<Repository>(repository);
+ testRepository = new TestRepository<>(repository);
+ mergeMode = org.eclipse.egit.ui.Activator.getDefault()
+ .getPreferenceStore().getInt(UIPreferences.MERGE_MODE);
+ }
+
+ @After
+ public void resetMergeMode() throws Exception {
+ org.eclipse.egit.ui.Activator.getDefault().getPreferenceStore()
+ .setValue(UIPreferences.MERGE_MODE, mergeMode);
}
@Test
public void useHeadOptionShouldCauseFileToNotHaveConflictMarkers()
throws Exception {
+ org.eclipse.egit.ui.Activator.getDefault().getPreferenceStore()
+ .setValue(UIPreferences.MERGE_MODE, 2);
IPath path = new Path(PROJ1).append("folder/test.txt");
testRepository.branch("stable").commit().add(path.toString(), "stable")
.create();

Back to the top