]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3741 The plugin upgrades that are available in Update Center are not compatible...
authorSimon Brandhof <simon.brandhof@gmail.com>
Fri, 17 Aug 2012 13:33:36 +0000 (15:33 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Fri, 17 Aug 2012 13:33:36 +0000 (15:33 +0200)
sonar-core/src/main/java/org/sonar/core/plugins/DefaultPluginMetadata.java
sonar-core/src/test/java/org/sonar/core/plugins/DefaultPluginMetadataTest.java

index 6b96809a76bbd8efab1c869d34f12e4f884c4057..c0c00ae9be3e41d6597427f4b6985f91b49d5454 100644 (file)
@@ -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;
   }
 
index 7d8a770e85e5ee0195002c01eadd918f7999b427..0714f5bdf23139abd8b624d3a93c6d2ac72dbcf7 100644 (file)
@@ -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();