From c83f4bd213cadbd649df0094c0bc6ffa76886a32 Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Sun, 7 Sep 2014 21:02:04 -0300 Subject: [PATCH] add test for version comparison --- .../test/importer/VersionComparisonTest.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 wise-webapp/src/test/java/com/wisemapping/test/importer/VersionComparisonTest.java diff --git a/wise-webapp/src/test/java/com/wisemapping/test/importer/VersionComparisonTest.java b/wise-webapp/src/test/java/com/wisemapping/test/importer/VersionComparisonTest.java new file mode 100644 index 00000000..0b6ce88d --- /dev/null +++ b/wise-webapp/src/test/java/com/wisemapping/test/importer/VersionComparisonTest.java @@ -0,0 +1,27 @@ +package com.wisemapping.test.importer; + +import com.wisemapping.importer.ImporterException; +import com.wisemapping.importer.VersionNumber; +import org.testng.Assert; +import org.testng.annotations.Test; + +@Test +public class VersionComparisonTest { + + @Test + public void testVersionComparison() throws ImporterException { + + final VersionNumber greatest = new VersionNumber("1.0.1"); + final VersionNumber smaller = new VersionNumber("0.9.0"); + final VersionNumber intermediate = new VersionNumber("1.0.0"); + + Assert.assertTrue(smaller.isSmallerThan(intermediate)); + Assert.assertFalse(greatest.isSmallerThan(intermediate)); + Assert.assertTrue(greatest.isGreaterThan(smaller)); + Assert.assertFalse(intermediate.isGreaterThan(greatest)); + Assert.assertTrue(intermediate.equals(intermediate)); + Assert.assertFalse(greatest.equals(smaller)); + + } + +}