diff options
author | snowleo <schneeleo@gmail.com> | 2011-10-27 00:03:16 +0200 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2011-10-27 00:03:16 +0200 |
commit | 60b9d4fc80c881ce5548f7387c3de0d9fc5a7637 (patch) | |
tree | ca3fb9676c76f8700bda0bd21f9ffcc579d46c42 /EssentialsUpdate/test/com/earth2me/essentials | |
parent | 7622c5c5108f406d3fbb285de0d2446fdc3127dd (diff) | |
download | Essentials-60b9d4fc80c881ce5548f7387c3de0d9fc5a7637.tar Essentials-60b9d4fc80c881ce5548f7387c3de0d9fc5a7637.tar.gz Essentials-60b9d4fc80c881ce5548f7387c3de0d9fc5a7637.tar.lz Essentials-60b9d4fc80c881ce5548f7387c3de0d9fc5a7637.tar.xz Essentials-60b9d4fc80c881ce5548f7387c3de0d9fc5a7637.zip |
Some cleanup, refactoring of EssentialsHelp class
Diffstat (limited to 'EssentialsUpdate/test/com/earth2me/essentials')
-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()); } } |