diff options
Diffstat (limited to 'EssentialsUpdate/test/com/earth2me/essentials/update/VersionTest.java')
-rw-r--r-- | EssentialsUpdate/test/com/earth2me/essentials/update/VersionTest.java | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/EssentialsUpdate/test/com/earth2me/essentials/update/VersionTest.java b/EssentialsUpdate/test/com/earth2me/essentials/update/VersionTest.java index 901a8f9dc..92faade26 100644 --- a/EssentialsUpdate/test/com/earth2me/essentials/update/VersionTest.java +++ b/EssentialsUpdate/test/com/earth2me/essentials/update/VersionTest.java @@ -49,39 +49,39 @@ public class VersionTest extends TestCase @Test public void testCompareTo() { - Version a = new Version("1.1.1"); - Version b = new Version("Dev1.1.2"); - Version c = new Version("1.1.2"); - Version d = new Version("1.2.0"); - Version e = new Version("2.0.0"); - Version f = new Version("Pre1.1.1.1"); - Version g = new Version("Dev1.2.2"); - assertTrue("Testing dev", a.compareTo(b) < 0); - assertTrue("Testing dev", b.compareTo(a) > 0); - assertTrue("Testing build", a.compareTo(c) < 0); - assertTrue("Testing build", c.compareTo(a) > 0); - assertTrue("Testing minor", a.compareTo(d) < 0); - assertTrue("Testing minor", d.compareTo(a) > 0); - assertTrue("Testing major", a.compareTo(e) < 0); - assertTrue("Testing major", e.compareTo(a) > 0); - assertTrue("Testing pre", f.compareTo(a) < 0); - assertTrue("Testing pre", a.compareTo(f) > 0); - assertTrue("Testing dev vs dev", b.compareTo(g) < 0); - assertTrue("Testing dev vs dev", g.compareTo(b) > 0); + final Version verA = new Version("1.1.1"); + final Version verB = new Version("Dev1.1.2"); + final Version verC = new Version("1.1.2"); + final Version verD = new Version("1.2.0"); + final Version verE = new Version("2.0.0"); + final Version verF = new Version("Pre1.1.1.1"); + final Version verG = new Version("Dev1.2.2"); + assertTrue("Testing dev", verA.compareTo(verB) < 0); + assertTrue("Testing dev", verB.compareTo(verA) > 0); + assertTrue("Testing build", verA.compareTo(verC) < 0); + assertTrue("Testing build", verC.compareTo(verA) > 0); + assertTrue("Testing minor", verA.compareTo(verD) < 0); + assertTrue("Testing minor", verD.compareTo(verA) > 0); + assertTrue("Testing major", verA.compareTo(verE) < 0); + assertTrue("Testing major", verE.compareTo(verA) > 0); + assertTrue("Testing pre", verF.compareTo(verA) < 0); + assertTrue("Testing pre", verA.compareTo(verF) > 0); + assertTrue("Testing dev vs dev", verB.compareTo(verG) < 0); + assertTrue("Testing dev vs dev", verG.compareTo(verB) > 0); final TreeSet<Version> set = new TreeSet<Version>(); - set.add(a); - set.add(b); - set.add(c); - set.add(d); - set.add(e); - set.add(f); - set.add(g); - assertEquals("Testing sorting", f, set.pollFirst()); - assertEquals("Testing sorting", a, set.pollFirst()); - assertEquals("Testing sorting", c, set.pollFirst()); - assertEquals("Testing sorting", d, set.pollFirst()); - assertEquals("Testing sorting", e, set.pollFirst()); - assertEquals("Testing sorting", b, set.pollFirst()); - assertEquals("Testing sorting", g, set.pollFirst()); + set.add(verA); + set.add(verB); + set.add(verC); + set.add(verD); + set.add(verE); + set.add(verF); + set.add(verG); + assertEquals("Testing sorting", verF, set.pollFirst()); + assertEquals("Testing sorting", verA, set.pollFirst()); + assertEquals("Testing sorting", verC, set.pollFirst()); + assertEquals("Testing sorting", verD, set.pollFirst()); + assertEquals("Testing sorting", verE, set.pollFirst()); + assertEquals("Testing sorting", verB, set.pollFirst()); + assertEquals("Testing sorting", verG, set.pollFirst()); } } |