ACS-953 Unable to upgrade from ACS-7.0-M1 or ACS-7.0-M2 to ACS-7.0-A12 (#183)

* ACS-953 Unable to upgrade from ACS-7.0-M1 or ACS-7.0-M2 to ACS-7.0-A12

Now that we create internal releases of the form M.m.r-M9 (milestone), M.m.r-A9 (alpha) and M.m.r-RC9 (release candidate) during development and testing, we need to ensure we can upgrade from any of these to any other, as they may occur in any order and also to the final external release M.m.r. We also will allow a change from the final release back to an internal one for regression testing. The code within ModuleComponentHelper which calls this method, checks if it is the same version (0) and then if it is downgrading (> 0), so if they share the same M.m.r part matches AND is one of these formats, we return <0.
This commit is contained in:
Alan Davis
2020-11-30 19:54:21 +00:00
committed by GitHub
parent 73c875eac9
commit ea4e18d347
4 changed files with 180 additions and 31 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2010 Alfresco Software Limited.
* Copyright (C) 2005-2020 Alfresco Software Limited.
*
* This file is part of Alfresco
*
@@ -74,6 +74,22 @@ public class VersionNumberTest extends TestCase
{
// OK
}
try
{
new VersionNumber("1.2.3-M4");
fail("Should not have created an invalid version");
} catch (Exception exception)
{
// OK
}
try
{
new VersionNumber("1.2.3-A4");
fail("Should not have created an invalid version");
} catch (Exception exception)
{
// OK
}
}
public void testEquals()