JCLOUDS-352: Drops support for "-incubating" release versions

This commit is contained in:
Andrew Phillips 2013-10-17 19:28:12 -04:00
parent 3b8c38994a
commit 0298318790
2 changed files with 9 additions and 16 deletions

View File

@ -39,12 +39,11 @@ public class JcloudsVersion {
private static final String VERSION_PROPERTY_NAME = "version"; private static final String VERSION_PROPERTY_NAME = "version";
/* /*
* x.y.z or x.y.z-incubating or x.y.z-alpha.n or x.y.z-beta.n or x.y.z-rc.n or x.y.z-SNAPSHOT - * x.y.z or x.y.z-alpha.n or x.y.z-beta.n or x.y.z-rc.n or x.y.z-SNAPSHOT -
* see http://semver.org. Note that x.y.z-incubating does *not* meet the * see http://semver.org.
* semver criteria for a *release* version.
*/ */
private static final Pattern SEMANTIC_VERSION_PATTERN = private static final Pattern SEMANTIC_VERSION_PATTERN =
Pattern.compile("(\\d+)\\.(\\d+)\\.(\\d+)(?:-(alpha|beta|rc)\\.(\\d+)|-incubating|-SNAPSHOT)?"); Pattern.compile("(\\d+)\\.(\\d+)\\.(\\d+)(?:-(alpha|beta|rc)\\.(\\d+)|-SNAPSHOT)?");
private static final String ALPHA_VERSION_IDENTIFIER = "alpha"; private static final String ALPHA_VERSION_IDENTIFIER = "alpha";
private static final String BETA_VERSION_IDENTIFIER = "beta"; private static final String BETA_VERSION_IDENTIFIER = "beta";

View File

@ -53,6 +53,12 @@ public class JcloudsVersionTest {
new JcloudsVersion("1.2.3-rc-4"); new JcloudsVersion("1.2.3-rc-4");
} }
@Test(expectedExceptions = { IllegalArgumentException.class })
public void testFailsIfIncubating() {
// no longer supported after graduation from the Apache Incubator
new JcloudsVersion("1.2.3-incubating");
}
@Test(expectedExceptions = { IllegalArgumentException.class }) @Test(expectedExceptions = { IllegalArgumentException.class })
public void testFailsIfAlphaSnapshot() { public void testFailsIfAlphaSnapshot() {
new JcloudsVersion("1.2.3-alpha.5-SNAPSHOT"); new JcloudsVersion("1.2.3-alpha.5-SNAPSHOT");
@ -115,18 +121,6 @@ public class JcloudsVersionTest {
assertNull(version.releaseCandidateVersion); assertNull(version.releaseCandidateVersion);
} }
@Test
public void testSupportsIncubatingReleaseVersion() {
// *not* a semver-compliant release version!
JcloudsVersion version = new JcloudsVersion("1.2.3-incubating");
assertFalse(version.alpha, "Expected non-alpha");
assertFalse(version.beta, "Expected non-beta");
assertFalse(version.releaseCandidate, "Expected non-release candidate");
assertNull(version.alphaVersion);
assertNull(version.betaVersion);
assertNull(version.releaseCandidateVersion);
}
@Test @Test
public void testRecognisesAlpha() { public void testRecognisesAlpha() {
JcloudsVersion version = new JcloudsVersion("1.2.3-alpha.5"); JcloudsVersion version = new JcloudsVersion("1.2.3-alpha.5");