use of org.sonar.api.SonarRuntime in project sonarqube by SonarSource.
the class StartupMetadataProviderTest method fail_to_load_from_database_if_properties_are_not_persisted.
@Test
public void fail_to_load_from_database_if_properties_are_not_persisted() {
SonarRuntime runtime = SonarRuntimeImpl.forSonarQube(Version.create(6, 1), SonarQubeSide.COMPUTE_ENGINE);
cluster.setStartupLeader(false);
expectedException.expect(IllegalStateException.class);
expectedException.expectMessage("Property sonar.core.startTime is missing in database");
underTest.provide(system, runtime, cluster, dbTester.getDbClient());
}
use of org.sonar.api.SonarRuntime in project sonarqube by SonarSource.
the class StartupMetadataProviderTest method load_from_database_if_compute_engine_of_startup_follower_server.
@Test
public void load_from_database_if_compute_engine_of_startup_follower_server() {
SonarRuntime runtime = SonarRuntimeImpl.forSonarQube(Version.create(6, 1), SonarQubeSide.COMPUTE_ENGINE);
testLoadingFromDatabase(runtime, false);
}
use of org.sonar.api.SonarRuntime in project sonarqube by SonarSource.
the class XooPluginTest method provide_extensions_for_5_4.
@Test
public void provide_extensions_for_5_4() {
SonarRuntime runtime = SonarRuntimeImpl.forSonarLint(Version.parse("5.4"));
Plugin.Context context = new Plugin.Context(runtime);
new XooPlugin().define(context);
assertThat(context.getExtensions()).hasSize(44).doesNotContain(CpdTokenizerSensor.class);
}
use of org.sonar.api.SonarRuntime in project sonarqube by SonarSource.
the class SonarRuntimeImplTest method sonarLint_environment.
@Test
public void sonarLint_environment() {
SonarRuntime apiVersion = SonarRuntimeImpl.forSonarLint(A_VERSION);
assertThat(apiVersion.getApiVersion()).isEqualTo(A_VERSION);
assertThat(apiVersion.getProduct()).isEqualTo(SonarProduct.SONARLINT);
try {
apiVersion.getSonarQubeSide();
Assertions.fail("Expected exception");
} catch (Exception e) {
assertThat(e).isInstanceOf(UnsupportedOperationException.class);
}
}
Aggregations