diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2012-08-17 15:33:36 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2012-08-17 15:33:36 +0200 |
commit | ffde32687741fcf5c853becc833c849669988827 (patch) | |
tree | 604fc9051201acfca343c1a9109021b6c7cb89db /sonar-core | |
parent | ec6d10a01e23bd3ab114ca196436659d57f22ad9 (diff) | |
download | sonarqube-ffde32687741fcf5c853becc833c849669988827.tar.gz sonarqube-ffde32687741fcf5c853becc833c849669988827.zip |
SONAR-3741 The plugin upgrades that are available in Update Center are not compatible with Sonar Release Candidates
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/plugins/DefaultPluginMetadata.java | 4 | ||||
-rw-r--r-- | sonar-core/src/test/java/org/sonar/core/plugins/DefaultPluginMetadataTest.java | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/plugins/DefaultPluginMetadata.java b/sonar-core/src/main/java/org/sonar/core/plugins/DefaultPluginMetadata.java index 6b96809a76b..c0c00ae9be3 100644 --- a/sonar-core/src/main/java/org/sonar/core/plugins/DefaultPluginMetadata.java +++ b/sonar-core/src/main/java/org/sonar/core/plugins/DefaultPluginMetadata.java @@ -191,8 +191,8 @@ public class DefaultPluginMetadata implements PluginMetadata, Comparable<PluginM return true; // Plugins without sonar version are so old, they are compatible with a version containing this code } - Version minimumVersion = Version.create(this.sonarVersion); - Version actualVersion = Version.create(sonarVersion); + Version minimumVersion = Version.createRelease(this.sonarVersion); + Version actualVersion = Version.createRelease(sonarVersion); return actualVersion.compareTo(minimumVersion) >= 0; } diff --git a/sonar-core/src/test/java/org/sonar/core/plugins/DefaultPluginMetadataTest.java b/sonar-core/src/test/java/org/sonar/core/plugins/DefaultPluginMetadataTest.java index 7d8a770e85e..0714f5bdf23 100644 --- a/sonar-core/src/test/java/org/sonar/core/plugins/DefaultPluginMetadataTest.java +++ b/sonar-core/src/test/java/org/sonar/core/plugins/DefaultPluginMetadataTest.java @@ -113,6 +113,9 @@ public class DefaultPluginMetadataTest { assertThat(pluginWithVersion("1.0").isCompatibleWith("1.1")).isTrue(); assertThat(pluginWithVersion("1.1.1").isCompatibleWith("1.1.2")).isTrue(); assertThat(pluginWithVersion("2.0").isCompatibleWith("2.1.0")).isTrue(); + assertThat(pluginWithVersion("3.2").isCompatibleWith("3.2-RC1")).isTrue(); + assertThat(pluginWithVersion("3.2").isCompatibleWith("3.2-RC2")).isTrue(); + assertThat(pluginWithVersion("3.2").isCompatibleWith("3.1-RC2")).isFalse(); assertThat(pluginWithVersion("1.1").isCompatibleWith("1.0")).isFalse(); assertThat(pluginWithVersion("2.0.1").isCompatibleWith("2.0.0")).isFalse(); @@ -127,7 +130,6 @@ public class DefaultPluginMetadataTest { assertThat(pluginWithVersion("3.1-RC2").isCompatibleWith("3.2-SNAPSHOT")).isTrue(); assertThat(pluginWithVersion("3.1-RC1").isCompatibleWith("3.2-RC2")).isTrue(); assertThat(pluginWithVersion("3.1-RC1").isCompatibleWith("3.1-RC2")).isTrue(); - assertThat(pluginWithVersion("3.1-RC2").isCompatibleWith("3.1-RC1")).isFalse(); assertThat(pluginWithVersion(null).isCompatibleWith("0")).isTrue(); assertThat(pluginWithVersion(null).isCompatibleWith("3.1")).isTrue(); |