aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-xoo-plugin
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2017-01-05 11:24:54 +0100
committerJulien HENRY <henryju@yahoo.fr>2017-01-10 20:52:16 +0100
commitfafd6a2b35d2b7947a7727b10560e1f4c0a90e81 (patch)
tree31aed5897e2e8af36effa3d4cd658fa278e6c88c /plugins/sonar-xoo-plugin
parentb0ff5f224d41bdb89a4a42e5500ce4f830c7ab01 (diff)
downloadsonarqube-fafd6a2b35d2b7947a7727b10560e1f4c0a90e81.tar.gz
sonarqube-fafd6a2b35d2b7947a7727b10560e1f4c0a90e81.zip
SONAR-8573 Use api/settings to load global settings
Diffstat (limited to 'plugins/sonar-xoo-plugin')
-rw-r--r--plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java6
-rw-r--r--plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/XooPluginTest.java4
2 files changed, 8 insertions, 2 deletions
diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java
index 9a84189608f..5dd494efb8e 100644
--- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java
+++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java
@@ -20,6 +20,7 @@
package org.sonar.xoo;
import org.sonar.api.Plugin;
+import org.sonar.api.PropertyType;
import org.sonar.api.SonarProduct;
import org.sonar.api.config.PropertyDefinition;
import org.sonar.api.resources.Qualifiers;
@@ -81,6 +82,11 @@ public class XooPlugin implements Plugin {
.subCategory("General")
.onQualifiers(Qualifiers.PROJECT)
.build(),
+ // Used by DuplicationsTest. If not declared it is not returned by api/settings
+ PropertyDefinition.builder("sonar.cpd.xoo.minimumTokens")
+ .onQualifiers(Qualifiers.PROJECT)
+ .type(PropertyType.INTEGER)
+ .build(),
Xoo.class,
Xoo2.class,
XooRulesDefinition.class,
diff --git a/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/XooPluginTest.java b/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/XooPluginTest.java
index 03d8f037c4b..1969b18c482 100644
--- a/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/XooPluginTest.java
+++ b/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/XooPluginTest.java
@@ -36,7 +36,7 @@ public class XooPluginTest {
SonarRuntime runtime = SonarRuntimeImpl.forSonarLint(Version.parse("5.4"));
Plugin.Context context = new Plugin.Context(runtime);
new XooPlugin().define(context);
- assertThat(context.getExtensions()).hasSize(41).doesNotContain(CpdTokenizerSensor.class);
+ assertThat(context.getExtensions()).hasSize(42).doesNotContain(CpdTokenizerSensor.class);
}
@Test
@@ -44,6 +44,6 @@ public class XooPluginTest {
SonarRuntime runtime = SonarRuntimeImpl.forSonarQube(Version.parse("5.5"), SonarQubeSide.SCANNER);
Plugin.Context context = new Plugin.Context(runtime);
new XooPlugin().define(context);
- assertThat(context.getExtensions()).hasSize(44).contains(CpdTokenizerSensor.class);
+ assertThat(context.getExtensions()).hasSize(45).contains(CpdTokenizerSensor.class);
}
}