[MNG-6655] Add support for "release" qualifier

This closes #249
This commit is contained in:
Michael Osipov 2019-05-12 17:31:35 +02:00
parent 2760e3e175
commit 3ac9718f82
2 changed files with 10 additions and 5 deletions

View File

@ -33,7 +33,7 @@ import java.util.Properties;
* <p>
* Generic implementation of version comparison.
* </p>
*
*
* Features:
* <ul>
* <li>mixing of '<code>-</code>' (hyphen) and '<code>.</code>' (dot) separators,</li>
@ -361,6 +361,7 @@ public class ComparableVersion
{
ALIASES.put( "ga", "" );
ALIASES.put( "final", "" );
ALIASES.put( "release", "" );
ALIASES.put( "cr", "rc" );
}

View File

@ -135,6 +135,7 @@ public class ComparableVersionTest
// aliases
checkVersionsEqual( "1ga", "1" );
checkVersionsEqual( "1release", "1" );
checkVersionsEqual( "1final", "1" );
checkVersionsEqual( "1cr", "1rc" );
@ -150,6 +151,9 @@ public class ComparableVersionTest
checkVersionsEqual( "1M", "1m" );
checkVersionsEqual( "1Ga", "1" );
checkVersionsEqual( "1GA", "1" );
checkVersionsEqual( "1RELEASE", "1" );
checkVersionsEqual( "1release", "1" );
checkVersionsEqual( "1RELeaSE", "1" );
checkVersionsEqual( "1Final", "1" );
checkVersionsEqual( "1FinaL", "1" );
checkVersionsEqual( "1FINAL", "1" );
@ -229,7 +233,7 @@ public class ComparableVersionTest
/**
* Test all versions are equal when starting with many leading zeroes regardless of string length
* (related to MNG-6572 optimization)
* (related to MNG-6572 optimization)
*/
public void testVersionEqualWithLeadingZeroes()
{
@ -255,13 +259,13 @@ public class ComparableVersionTest
"01",
"1"
};
checkVersionsArrayEqual( arr );
}
/**
* Test all "0" versions are equal when starting with many leading zeroes regardless of string length
* (related to MNG-6572 optimization)
* (related to MNG-6572 optimization)
*/
public void testVersionZeroEqualWithLeadingZeroes()
{
@ -287,7 +291,7 @@ public class ComparableVersionTest
"00",
"0"
};
checkVersionsArrayEqual( arr );
}