Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathieu Cartaud2016-06-15 04:13:57 -0400
committerMathieu Cartaud2016-06-15 10:29:59 -0400
commit6477d1125eebfd494f4a3d1a666519e24daedf9d (patch)
treedf98e6aaac6dfb813ea055617a1ce1387064f041 /plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff
parent5722fba2307aeda65d7367dd302bcd9b20f02a7a (diff)
downloadorg.eclipse.emf.compare-6477d1125eebfd494f4a3d1a666519e24daedf9d.tar.gz
org.eclipse.emf.compare-6477d1125eebfd494f4a3d1a666519e24daedf9d.tar.xz
org.eclipse.emf.compare-6477d1125eebfd494f4a3d1a666519e24daedf9d.zip
Switch to Eclipse mars.2
Format all non generated classes to get ride of formatter incompatibilities Migrate checkstyle config for checkstyle 6.19 Change-Id: I8c2b31765053a3686de62320f893bedf4ad81d1f Signed-off-by: Mathieu Cartaud <mathieu.cartaud@obeo.fr>
Diffstat (limited to 'plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff')
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/ComparisonUtilTest.java8
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/DiffUtilTest.java42
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/ThreeWayTextDiffTest.java6
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/URIDistanceTest.java6
4 files changed, 32 insertions, 30 deletions
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/ComparisonUtilTest.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/ComparisonUtilTest.java
index b40718cdb..5929b72d3 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/ComparisonUtilTest.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/ComparisonUtilTest.java
@@ -52,8 +52,8 @@ public class ComparisonUtilTest {
// Right to left on a deleted element
final Predicate<? super Diff> leftPeriodical = and(fromSide(DifferenceSource.LEFT),
- ofKind(DifferenceKind.DELETE), referenceValueMatch("eClassifiers", "extlibrary.Periodical",
- true));
+ ofKind(DifferenceKind.DELETE),
+ referenceValueMatch("eClassifiers", "extlibrary.Periodical", true));
final Diff leftPeriodicalDiff = Iterators.find(differences.iterator(), leftPeriodical);
boolean leftToRight = false;
Iterable<Diff> subDiffs = ComparisonUtil.getSubDiffs(leftToRight).apply(leftPeriodicalDiff);
@@ -88,8 +88,8 @@ public class ComparisonUtilTest {
// Right to left on a deleted element
final Predicate<? super Diff> leftPeriodical3Way = and(fromSide(DifferenceSource.LEFT),
- ofKind(DifferenceKind.DELETE), referenceValueMatch("eClassifiers", "extlibrary.Periodical",
- true));
+ ofKind(DifferenceKind.DELETE),
+ referenceValueMatch("eClassifiers", "extlibrary.Periodical", true));
final Diff leftPeriodicalDiff3Way = Iterators.find(differences.iterator(), leftPeriodical3Way);
leftToRight = false;
subDiffs = ComparisonUtil.getSubDiffs(leftToRight).apply(leftPeriodicalDiff3Way);
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/DiffUtilTest.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/DiffUtilTest.java
index 43ee1d717..537f7b544 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/DiffUtilTest.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/DiffUtilTest.java
@@ -471,20 +471,21 @@ public class DiffUtilTest {
*/
@Test
public void diceCoefficient() {
- final String[] data = new String[] {"ceString", "ceString", "classe", "Classe", "Classe",
- "UneClasse", "package", "packagedeux", "", "MaClasse", "package", "packageASupprimer",
- "attribut", "reference", "aa", "aaaa", "aaa", "aaaa", "v1", "v2", "v", "v1", "a", "a", "a",
- "b", "a", "A", "GGG", "GGGGGG", "night", "nacht", };
+ final String[] data = new String[] {"ceString", "ceString", "classe", "Classe", "Classe", "UneClasse",
+ "package", "packagedeux", "", "MaClasse", "package", "packageASupprimer", "attribut",
+ "reference", "aa", "aaaa", "aaa", "aaaa", "v1", "v2", "v", "v1", "a", "a", "a", "b", "a", "A",
+ "GGG", "GGGGGG", "night", "nacht", };
final double[] similarities = new double[] {1d, 0.8d, 10d / 13d, 12d / 16d, 0d, 12d / 22d, 0d,
2d / 4d, 4d / 5d, 1d / 2d, 1d / 3d, 1d, 0d, 0d, 4d / 7d, 2d / 8d };
for (int i = 0; i < data.length; i += 2) {
- assertEquals("Unexpected result of the dice coefficient for str1 = " + data[i] + " and str2 = "
- + data[i + 1], similarities[i / 2], DiffUtil.diceCoefficient(data[i], data[i + 1]),
- Double.MIN_VALUE);
+ assertEquals(
+ "Unexpected result of the dice coefficient for str1 = " + data[i] + " and str2 = "
+ + data[i + 1],
+ similarities[i / 2], DiffUtil.diceCoefficient(data[i], data[i + 1]), Double.MIN_VALUE);
// Make sure that the result is symmetric
- assertEquals("Dice coefficient was not symmetric for str1 = " + data[i] + " and str2 = "
- + data[i + 1], similarities[i / 2], DiffUtil.diceCoefficient(data[i + 1], data[i]),
- Double.MIN_VALUE);
+ assertEquals(
+ "Dice coefficient was not symmetric for str1 = " + data[i] + " and str2 = " + data[i + 1],
+ similarities[i / 2], DiffUtil.diceCoefficient(data[i + 1], data[i]), Double.MIN_VALUE);
}
}
@@ -525,22 +526,23 @@ public class DiffUtilTest {
@Test
public void diceCoefficientFullWidth() {
- final String[] data = new String[] {"ceString", "ceString", "classe", "Classe", "Classe",
- "UneClasse", "package", "packagedeux", "", "MaClasse", "package", "packageASupprimer",
- "attribut", "reference", "aa", "aaaa", "aaa", "aaaa", "v1", "v2", "v", "v1", "a", "a", "a",
- "b", "a", "A", "GGG", "GGGGGG", "night", "nacht", "fullwidth string", "fullwidth string",
+ final String[] data = new String[] {"ceString", "ceString", "classe", "Classe", "Classe", "UneClasse",
+ "package", "packagedeux", "", "MaClasse", "package", "packageASupprimer", "attribut",
+ "reference", "aa", "aaaa", "aaa", "aaaa", "v1", "v2", "v", "v1", "a", "a", "a", "b", "a", "A",
+ "GGG", "GGGGGG", "night", "nacht", "fullwidth string", "fullwidth string",
"fullwidth string", "fullwidth CharSequence" };
final double[] similarities = new double[] {1d, 0.8d, 10d / 13d, 12d / 16d, 0d, 12d / 22d, 0d,
2d / 4d, 4d / 5d, 1d / 2d, 1d / 3d, 1d, 0d, 0d, 4d / 7d, 2d / 8d, 1d, 18d / 38d, };
for (int i = 0; i < data.length; i += 2) {
- assertEquals("Unexpected result of the dice coefficient for str1 = " + data[i] + " and str2 = "
- + data[i + 1], similarities[i / 2], DiffUtil.diceCoefficient(data[i], data[i + 1]),
- Double.MIN_VALUE);
+ assertEquals(
+ "Unexpected result of the dice coefficient for str1 = " + data[i] + " and str2 = "
+ + data[i + 1],
+ similarities[i / 2], DiffUtil.diceCoefficient(data[i], data[i + 1]), Double.MIN_VALUE);
// Make sure that the result is symmetric
- assertEquals("Dice coefficient was not symmetric for str1 = " + data[i] + " and str2 = "
- + data[i + 1], similarities[i / 2], DiffUtil.diceCoefficient(data[i + 1], data[i]),
- Double.MIN_VALUE);
+ assertEquals(
+ "Dice coefficient was not symmetric for str1 = " + data[i] + " and str2 = " + data[i + 1],
+ similarities[i / 2], DiffUtil.diceCoefficient(data[i + 1], data[i]), Double.MIN_VALUE);
}
}
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/ThreeWayTextDiffTest.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/ThreeWayTextDiffTest.java
index 9d0434cee..fa8a9a859 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/ThreeWayTextDiffTest.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/ThreeWayTextDiffTest.java
@@ -461,10 +461,8 @@ public class ThreeWayTextDiffTest {
final String origin = "They don't call it a Quarter Pounder with Cheese?" + NL //
+ "They call it a Royale with Cheese.";
- final String left = "Whose chopper is this?"
- + NL // added same as right
- + "It's Zed's!"
- + NL // added same as right
+ final String left = "Whose chopper is this?" + NL // added same as right
+ + "It's Zed's!" + NL // added same as right
+ "They don't call it a Quarter Pounder with Cheese?" + NL
+ "They call it a Royale with Cheese.";
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/URIDistanceTest.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/URIDistanceTest.java
index a0548fb94..ba3421964 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/URIDistanceTest.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/diff/URIDistanceTest.java
@@ -81,8 +81,10 @@ public class URIDistanceTest {
@Test
public void limitCases() throws Exception {
assertEquals(0, proximity("", ""));
- assertEquals(10, proximity("/", "/a/very/long/path/just/to/check/we/wont/ends/up/with/a/weird/thing"));
- assertEquals(10, proximity("/a/very/long/path/just/to/check/we/wont/ends/up/with/a/weird/thing", "/"));
+ assertEquals(10,
+ proximity("/", "/a/very/long/path/just/to/check/we/wont/ends/up/with/a/weird/thing"));
+ assertEquals(10,
+ proximity("/a/very/long/path/just/to/check/we/wont/ends/up/with/a/weird/thing", "/"));
}
@Test

Back to the top