Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 9d48df21d723b1d6b5aad1b76451be4c4812a2b4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*******************************************************************************
 * Copyright (C) 2016 Obeo.
 *
 * 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
 *******************************************************************************/
package org.eclipse.papyrus.compare.diagram.tests.conflicts;

import static org.junit.Assert.assertEquals;

import java.io.File;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Conflict;
import org.eclipse.emf.compare.ConflictKind;
import org.eclipse.emf.compare.conflict.DefaultConflictDetector;
import org.eclipse.emf.compare.conflict.MatchBasedConflictDetector;
import org.eclipse.emf.compare.ide.ui.tests.git.framework.GitTestRunner;
import org.eclipse.emf.compare.ide.ui.tests.git.framework.annotations.GitCompare;
import org.eclipse.emf.compare.ide.ui.tests.git.framework.annotations.GitInput;
import org.eclipse.emf.compare.ide.ui.tests.workspace.TestProject;
import org.eclipse.emf.compare.ide.ui.tests.framework.ResolutionStrategyID;
import org.eclipse.emf.compare.ide.ui.tests.framework.annotations.ResolutionStrategies;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.jgit.api.ResetCommand.ResetType;
import org.junit.Test;
import org.junit.runner.RunWith;

@SuppressWarnings({"nls", "unused" })
@RunWith(GitTestRunner.class)
@ResolutionStrategies(ResolutionStrategyID.WORKSPACE)
public class MoveOfDiagramConflictDetectionTest {

	@GitCompare(local = "branch1", remote = "branch2", file = "model.uml")
	@GitInput("/data/case001.zip")
	public void pseudoConflictsOnResourceRootTest(Comparison comparison) throws Exception {
		assertEquals(16, comparison.getDifferences().size());
		assertEquals(4, comparison.getConflicts().size());

		for (Conflict conflict : comparison.getConflicts()) {
			assertEquals(ConflictKind.PSEUDO, conflict.getKind());
		}
	}

	@GitCompare(local = "branch1", remote = "branch2", file = "model.uml")
	@GitInput("/data/case002.zip")
	public void conflictsOnResourceRootTest(Comparison comparison) throws Exception {
		assertEquals(4, comparison.getDifferences().size());
		assertEquals(2, comparison.getConflicts().size());

		for (Conflict conflict : comparison.getConflicts()) {
			assertEquals(ConflictKind.REAL, conflict.getKind());
		}
	}

}

Back to the top