@@ -0,0 +1,1918 @@
+package org.jboss.loom.utils.compar;%0A%0Aimport org.jboss.loom.recog.VersionComparer;%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0A/**%0A *%0A * @author Ondrej Zizka, ozizka at redhat.com%0A */%0Apublic class VersionComparerTest %7B%0A    private static final Logger log = LoggerFactory.getLogger( VersionComparerTest.class.getName() );%0A    %0A%0A    @Test%0A    public void testMain() %7B%0A        Assert.assertTrue( doCompareVersions(%222.3.0.GA%22, %222.4.0-SNAPSHOT%22, -1) );%0A        Assert.assertTrue( doCompareVersions(%222.4.0.GA%22, %222.4.0-SNAPSHOT%22, 1) );%0A        Assert.assertTrue( doCompareVersions(%222.4.1.GA%22, %222.4.0-SNAPSHOT%22, 1) );%0A        Assert.assertTrue( doCompareVersions(%222.4.1%22, %222.4.0-SNAPSHOT%22, 1) );%0A        Assert.assertTrue( doCompareVersions(%222.4.0%22, %222.4.0-SNAPSHOT%22, 1) );%0A        Assert.assertTrue( doCompareVersions(%222.4.0%22, %222.4.0.GA%22, 0) );%0A        Assert.assertTrue( doCompareVersions(%222.4.0.CR1%22, %222.4.0.GA%22, -1) );%0A        Assert.assertTrue( doCompareVersions(%222.4.CR1%22, %222.4.0.GA%22, -1) );%0A        Assert.assertTrue( doCompareVersions(%222.4.CR1%22, %222.4.0%22, -1) );%0A        Assert.assertTrue( doCompareVersions(%222.0.0.0%22, %222.0.0.SNAPSHOT%22, 1) );%0A        Assert.assertTrue( doCompareVersions(%222.0.0.1%22, %222.0.0.SNAPSHOT%22, -1) );%0A        Assert.assertTrue( doCompareVersions(%222.0.0.1%22, %222.0.0.SP2%22, 1) );%0A        Assert.assertTrue( doCompareVersions(%222.0.0.1%22, %222.0.SP2%22, 1) );%0A        //System.out.println(%22Test %22 + (succ ? %22PASSED%22 : %22FAILED%22) ) );%0A    %7D%0A    %0A    %0A     private static boolean doCompareVersions( String v1, String v2, int expectedSignum )%7B%0A          int compared = VersionComparer.compareVersions(v1, v2);%0A          log.info( String.format(%22Comparing versions:  %25s  and  %25s  produces:  %25d, expected: %25d%25n%22, v1, v2, compared, expectedSignum ) );%0A          return Integer.signum(expectedSignum) == Integer.signum( compared );%0A     %7D%0A    %0A%7D// class

Add VersionComparerTest