use of org.sonar.core.platform.SpringComponentContainer in project sonarqube by SonarSource.
the class NodeHealthModuleTest method no_broken_dependencies.
@Test
public void no_broken_dependencies() {
SpringComponentContainer container = new SpringComponentContainer();
Server server = mock(Server.class);
NetworkUtils networkUtils = mock(NetworkUtils.class);
// settings required by NodeHealthProvider
mapSettings.setProperty("sonar.cluster.node.name", randomAlphanumeric(3));
mapSettings.setProperty("sonar.cluster.node.port", valueOf(1 + random.nextInt(10)));
when(server.getStartedAt()).thenReturn(new Date());
when(networkUtils.getHostname()).thenReturn(randomAlphanumeric(12));
// upper level dependencies
container.add(mock(System2.class), mapSettings.asConfig(), server, networkUtils, mock(HazelcastMember.class));
// HealthAction dependencies
container.add(mock(HealthChecker.class));
underTest.configure(container);
container.startComponents();
}
use of org.sonar.core.platform.SpringComponentContainer in project sonarqube by SonarSource.
the class PlatformLevel4 method start.
@Override
public PlatformLevel start() {
SpringComponentContainer container = getContainer();
CoreExtensionsInstaller coreExtensionsInstaller = parent.get(WebCoreExtensionsInstaller.class);
coreExtensionsInstaller.install(container, hasPlatformLevel4OrNone(), noAdditionalSideFilter());
ServerExtensionInstaller extensionInstaller = parent.get(ServerExtensionInstaller.class);
extensionInstaller.installExtensions(container);
super.start();
return this;
}
use of org.sonar.core.platform.SpringComponentContainer in project sonarqube by SonarSource.
the class ProjectExportComputationStepsTest method instances_throws_ISE_if_container_does_not_have_second_step.
@Test
public void instances_throws_ISE_if_container_does_not_have_second_step() {
ComplexityMeasuresStep reportExtractionStep = mock(ComplexityMeasuresStep.class);
SpringComponentContainer componentContainer = new SpringComponentContainer() {
{
add(reportExtractionStep);
}
}.startComponents();
TaskContainerImpl computeEngineContainer = new TaskContainerImpl(componentContainer, container -> {
// do nothing
});
computeEngineContainer.startComponents();
Iterable<ComputationStep> instances = new ProjectExportComputationSteps(computeEngineContainer).instances();
assertThatThrownBy(() -> Lists.newArrayList(instances)).isInstanceOf(IllegalStateException.class).hasMessageContaining("class org.sonar.ce.task.projectexport.steps.LoadProjectStep");
}
use of org.sonar.core.platform.SpringComponentContainer in project sonarqube by SonarSource.
the class ComputeEngineContainerImpl method start.
@Override
public ComputeEngineContainer start(Props props) {
this.level1 = new SpringComponentContainer();
populateLevel1(this.level1, props, requireNonNull(computeEngineStatus));
startLevel1(this.level1);
SpringComponentContainer level2 = this.level1.createChild();
populateLevel2(level2);
startLevel2(level2);
SpringComponentContainer level3 = level2.createChild();
populateLevel3(level3);
startLevel3(level3);
this.level4 = level3.createChild();
populateLevel4(this.level4, props);
startLevel4(this.level4);
startupTasks();
return this;
}
use of org.sonar.core.platform.SpringComponentContainer in project sonarqube by SonarSource.
the class PlatformLevel3 method start.
@Override
public PlatformLevel start() {
SpringComponentContainer container = getContainer();
CoreExtensionsInstaller coreExtensionsInstaller = parent.get(WebCoreExtensionsInstaller.class);
coreExtensionsInstaller.install(container, hasPlatformLevel(3), noAdditionalSideFilter());
return super.start();
}
Aggregations