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

This commit is contained in:
Andrew Phillips 2013-10-17 19:28:12 -04:00
parent 29d574ffb2
commit 4500dbe2ef
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";
/*
* 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 -
* see http://semver.org. Note that x.y.z-incubating does *not* meet the
* semver criteria for a *release* version.
* 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.
*/
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 BETA_VERSION_IDENTIFIER = "beta";

View File

@ -53,6 +53,12 @@ public class JcloudsVersionTest {
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 })
public void testFailsIfAlphaSnapshot() {
new JcloudsVersion("1.2.3-alpha.5-SNAPSHOT");
@ -115,18 +121,6 @@ public class JcloudsVersionTest {
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
public void testRecognisesAlpha() {
JcloudsVersion version = new JcloudsVersion("1.2.3-alpha.5");