From 4b869a60b026b4c6822c42c7656993d0c265ef50 Mon Sep 17 00:00:00 2001 From: Martín Schonaker Date: Thu, 10 Apr 2014 01:17:01 -0300 Subject: Issue #25: some tests at DeltaTest. --- api/src/test/java/org/semver/DeltaTest.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'api') diff --git a/api/src/test/java/org/semver/DeltaTest.java b/api/src/test/java/org/semver/DeltaTest.java index 3c36d42..3562592 100755 --- a/api/src/test/java/org/semver/DeltaTest.java +++ b/api/src/test/java/org/semver/DeltaTest.java @@ -21,7 +21,9 @@ import java.util.Set; import org.junit.Assert; import org.junit.Test; +import org.osjava.jardiff.ClassInfo; import org.osjava.jardiff.FieldInfo; +import org.osjava.jardiff.MethodInfo; public class DeltaTest { @@ -142,4 +144,18 @@ public class DeltaTest { Assert.assertFalse(new Delta(Collections.singleton(new Delta.Remove("class", new FieldInfo(0, "", "", "", null)))).validate(new Version(1, 1, 0), new Version(1, 1, 1))); } + @Test + public void upgradeMinorVersionOnClassDeprecated() { + Assert.assertTrue(new Delta(Collections.singleton(new Delta.Deprecate("class", new ClassInfo(1, 0, "", "", "", null, null, null), new ClassInfo(1, 0, "", "", "", null, null, null)))).validate(new Version(1, 1, 0), new Version(1, 2, 0))); + } + + @Test + public void upgradeMinorVersionOnFieldDeprecated() { + Assert.assertTrue(new Delta(Collections.singleton(new Delta.Deprecate("class", new FieldInfo(0, "", "", "", null), new FieldInfo(0, "", "", "", null)))).validate(new Version(1, 1, 0), new Version(1, 2, 0))); + } + + @Test + public void upgradeMinorVersionOnMethodDeprecated() { + Assert.assertTrue(new Delta(Collections.singleton(new Delta.Deprecate("class", new MethodInfo(0, "", "", "", null), new MethodInfo(0, "", "", "", null)))).validate(new Version(1, 1, 0), new Version(1, 2, 0))); + } } \ No newline at end of file -- cgit v1.2.3