diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2018-02-05 14:48:50 +0100 |
---|---|---|
committer | Janos Gyerik <janos.gyerik@sonarsource.com> | 2018-02-06 09:13:51 +0100 |
commit | 3c42d5d2e6b362d389c0058e069897bf26ef65f7 (patch) | |
tree | 567be18ebbb7c081e6f06ebe5ad65fd25048bd41 /plugins | |
parent | ea77a805bfccb66c5943eb0bcaf36df3cb905227 (diff) | |
download | sonarqube-3c42d5d2e6b362d389c0058e069897bf26ef65f7.tar.gz sonarqube-3c42d5d2e6b362d389c0058e069897bf26ef65f7.zip |
Add Java API Plugin.Context#getBootConfiguration()
That allows plugins to check configuration when providing the list
of extensions.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/XooPluginTest.java | 7 |
1 files changed, 4 insertions, 3 deletions
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 e9703dc34de..fa1cb855b2b 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 @@ -23,6 +23,7 @@ import org.junit.Test; import org.sonar.api.Plugin; import org.sonar.api.SonarQubeSide; import org.sonar.api.SonarRuntime; +import org.sonar.api.internal.PluginContextImpl; import org.sonar.api.internal.SonarRuntimeImpl; import org.sonar.api.utils.Version; import org.sonar.xoo.lang.CpdTokenizerSensor; @@ -34,7 +35,7 @@ public class XooPluginTest { @Test public void provide_extensions_for_5_4() { SonarRuntime runtime = SonarRuntimeImpl.forSonarLint(Version.parse("5.4")); - Plugin.Context context = new Plugin.Context(runtime); + Plugin.Context context = new PluginContextImpl.Builder().setSonarRuntime(runtime).build(); new XooPlugin().define(context); assertThat(context.getExtensions()).hasSize(46).doesNotContain(CpdTokenizerSensor.class); } @@ -42,7 +43,7 @@ public class XooPluginTest { @Test public void provide_extensions_for_5_5() { SonarRuntime runtime = SonarRuntimeImpl.forSonarQube(Version.parse("5.5"), SonarQubeSide.SCANNER); - Plugin.Context context = new Plugin.Context(runtime); + Plugin.Context context = new PluginContextImpl.Builder().setSonarRuntime(runtime).build(); new XooPlugin().define(context); assertThat(context.getExtensions()).hasSize(49).contains(CpdTokenizerSensor.class); } @@ -50,7 +51,7 @@ public class XooPluginTest { @Test public void provide_extensions_for_6_6() { SonarRuntime runtime = SonarRuntimeImpl.forSonarQube(Version.parse("6.6"), SonarQubeSide.SCANNER); - Plugin.Context context = new Plugin.Context(runtime); + Plugin.Context context = new PluginContextImpl.Builder().setSonarRuntime(runtime).build(); new XooPlugin().define(context); assertThat(context.getExtensions()).hasSize(50).contains(CpdTokenizerSensor.class); } |