aboutsummaryrefslogtreecommitdiffstats
path: root/api/src/test/java/org/semver/DeltaTest.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-10-07 10:40:40 +0200
committerSven Gothel <[email protected]>2015-10-07 10:40:40 +0200
commit4f50b49c955f2bde2bb7eb4c7493206ec6bb1f2f (patch)
tree2e4c5ffd3c2396a6e695fa04345d6c151750fe0b /api/src/test/java/org/semver/DeltaTest.java
parent0d2e314ef48bd2fd38b45f781c4573bdb2b32a69 (diff)
Fix JLS Binary Compat: Moving methods and fields upwards for classes _and_ interfaces is OKHEADmaster
- We shall also travers all interfaces upwards - All methods and fields found upwards must be tested for compatibility as well! Further: - Add class-name to Field- and MethodInfo via new intermediate AbstractMemberInfo. The class-name is used to have allow differs to find a class move upwards! - Pretty printing of class move binary-compatible change
Diffstat (limited to 'api/src/test/java/org/semver/DeltaTest.java')
-rwxr-xr-xapi/src/test/java/org/semver/DeltaTest.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/api/src/test/java/org/semver/DeltaTest.java b/api/src/test/java/org/semver/DeltaTest.java
index 6548e61..241684b 100755
--- a/api/src/test/java/org/semver/DeltaTest.java
+++ b/api/src/test/java/org/semver/DeltaTest.java
@@ -91,7 +91,7 @@ public class DeltaTest {
final int patch = 3;
final Version version = new Version(major, minor, patch);
- final Version inferedVersion = new Delta(Collections.singleton(new Delta.Add("class", new FieldInfo(0, "", "", "", null))), false).infer(version);
+ final Version inferedVersion = new Delta(Collections.singleton(new Delta.Add("class", new FieldInfo("class", 0, "", "", "", null))), false).infer(version);
assertEquals(new Version(major, minor+1, 0), inferedVersion);
}
@@ -103,7 +103,7 @@ public class DeltaTest {
final int patch = 3;
final Version version = new Version(major, minor, patch);
- final Version inferedVersion = new Delta(Collections.singleton(new Delta.Change("class", new FieldInfo(0, "", "", "", null), new FieldInfo(0, "", "", "", null))), false).infer(version);
+ final Version inferedVersion = new Delta(Collections.singleton(new Delta.Change("class", new FieldInfo("class", 0, "", "", "", null), new FieldInfo("class", 0, "", "", "", null))), false).infer(version);
assertEquals(new Version(major+1, 0, 0), inferedVersion);
}
@@ -115,7 +115,7 @@ public class DeltaTest {
final int patch = 3;
final Version version = new Version(major, minor, patch);
- final Version inferedVersion = new Delta(Collections.singleton(new Delta.Remove("class", new FieldInfo(0, "", "", "", null))), false).infer(version);
+ final Version inferedVersion = new Delta(Collections.singleton(new Delta.Remove("class", new FieldInfo("class", 0, "", "", "", null))), false).infer(version);
assertEquals(new Version(major+1, 0, 0), inferedVersion);
}
@@ -157,7 +157,7 @@ public class DeltaTest {
@Test
public void shouldValidateWithIncorrectVersionFail() {
- validate(Collections.singleton(new Delta.Remove("class", new FieldInfo(0, "", "", "", null))), new Version(1, 1, 0), new Version(1, 1, 1), false);
+ validate(Collections.singleton(new Delta.Remove("class", new FieldInfo("class", 0, "", "", "", null))), new Version(1, 1, 0), new Version(1, 1, 1), false);
}
@Test
@@ -167,15 +167,15 @@ public class DeltaTest {
@Test
public void upgradeMinorVersionOnFieldDeprecated() {
- validate(singleton(new Delta.Deprecate("class", new FieldInfo(0, "", "", "", null), new FieldInfo(0, "", "", "", null))), new Version(1, 1, 0), new Version(1, 2, 0), true);
+ validate(singleton(new Delta.Deprecate("class", new FieldInfo("class", 0, "", "", "", null), new FieldInfo("class", 0, "", "", "", null))), new Version(1, 1, 0), new Version(1, 2, 0), true);
}
@Test
public void upgradeMinorVersionOnMethodDeprecated() {
- validate(singleton(new Delta.Deprecate("class", new MethodInfo(0, "", "", "", null), new MethodInfo(0, "", "", "", null))), new Version(1, 1, 0), new Version(1, 2, 0), true);
+ validate(singleton(new Delta.Deprecate("class", new MethodInfo("class", 0, "", "", "", null), new MethodInfo("class", 0, "", "", "", null))), new Version(1, 1, 0), new Version(1, 2, 0), true);
}
- private void validate(Set<? extends Delta.Difference> differences, Version previous, Version current, boolean valid) {
+ private void validate(final Set<? extends Delta.Difference> differences, final Version previous, final Version current, final boolean valid) {
assertEquals(
"accept differences " + differences + " when changing version from " + previous + " to " + current,
valid,