use of org.sonar.api.SonarRuntime in project sonarqube by SonarSource.
the class XooPluginTest method provide_extensions_for_5_5.
@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);
new XooPlugin().define(context);
assertThat(context.getExtensions()).hasSize(47).contains(CpdTokenizerSensor.class);
}
use of org.sonar.api.SonarRuntime in project sonarlint-core by SonarSource.
the class DefaultServerTest method coverageUnusedMethods.
@Test
public void coverageUnusedMethods() {
SonarRuntime runtime = mock(SonarRuntime.class);
when(runtime.getApiVersion()).thenReturn(Version.create(2, 2));
DefaultServer metadata = new DefaultServer(new MapSettings(), runtime);
assertThat(metadata.getStartedAt()).isNull();
assertThat(metadata.getRootDir()).isNull();
assertThat(metadata.getContextPath()).isNull();
assertThat(metadata.isSecured()).isFalse();
assertThat(metadata.isDev()).isFalse();
assertThat(metadata.getPublicRootUrl()).isNull();
}
use of org.sonar.api.SonarRuntime in project sonar-java by SonarSource.
the class JavaPluginTest method sonarLint_6_7_extensions.
@Test
public void sonarLint_6_7_extensions() {
SonarRuntime runtime = SonarRuntimeImpl.forSonarLint(VERSION_6_7);
Plugin.Context context = new Plugin.Context(runtime);
javaPlugin.define(context);
assertThat(context.getExtensions()).hasSize(14);
}
use of org.sonar.api.SonarRuntime in project sonar-go by SonarSource.
the class GoPluginTest method count_extension_points.
@Test
void count_extension_points() {
SonarRuntime runtime = SonarRuntimeImpl.forSonarQube(Version.create(6, 7), SonarQubeSide.SCANNER);
Plugin.Context context = new Plugin.Context(runtime);
Plugin underTest = new GoPlugin();
underTest.define(context);
assertThat(context.getExtensions()).hasSize(6);
}
use of org.sonar.api.SonarRuntime in project sonarqube by SonarSource.
the class XooPluginTest method provide_extensions_for_sonar_lint.
@Test
public void provide_extensions_for_sonar_lint() {
SonarRuntime runtime = SonarRuntimeImpl.forSonarLint(Version.parse("5.4"));
Plugin.Context context = new PluginContextImpl.Builder().setSonarRuntime(runtime).build();
new XooPlugin().define(context);
assertThat(getExtensions(context)).isNotEmpty().doesNotContain(MeasureSensor.class);
}
Aggregations