diff --git a/core/src/main/java/org/jclouds/JcloudsVersion.java b/core/src/main/java/org/jclouds/JcloudsVersion.java index f23118e55b..c5fa1d5e22 100644 --- a/core/src/main/java/org/jclouds/JcloudsVersion.java +++ b/core/src/main/java/org/jclouds/JcloudsVersion.java @@ -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"; diff --git a/core/src/test/java/org/jclouds/JcloudsVersionTest.java b/core/src/test/java/org/jclouds/JcloudsVersionTest.java index dc2c973cb5..027d1178f4 100644 --- a/core/src/test/java/org/jclouds/JcloudsVersionTest.java +++ b/core/src/test/java/org/jclouds/JcloudsVersionTest.java @@ -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");