Search in sources :

Example 41 with ComponentContainer

use of org.sonar.core.platform.ComponentContainer in project sonarqube by SonarSource.

the class QualityGateModuleTest method verify_count_of_added_components.

@Test
public void verify_count_of_added_components() {
    ComponentContainer container = new ComponentContainer();
    new QualityGateModule().configure(container);
    assertThat(container.size()).isEqualTo(23 + 2);
}
Also used : ComponentContainer(org.sonar.core.platform.ComponentContainer) Test(org.junit.Test)

Example 42 with ComponentContainer

use of org.sonar.core.platform.ComponentContainer in project sonarqube by SonarSource.

the class RootsWsModuleTest method verify_number_of_components_added_by_module.

@Test
public void verify_number_of_components_added_by_module() {
    ComponentContainer container = new ComponentContainer();
    underTest.configure(container);
    assertThat(container.getPicoContainer().getComponentAdapters()).hasSize(COMPONENTS_IN_EMPTY_COMPONENT_CONTAINER + 4);
}
Also used : ComponentContainer(org.sonar.core.platform.ComponentContainer) Test(org.junit.Test)

Example 43 with ComponentContainer

use of org.sonar.core.platform.ComponentContainer in project sonarqube by SonarSource.

the class ComputeEngineContainerImpl method start.

@Override
public ComputeEngineContainer start(Props props) {
    this.level1 = new ComponentContainer();
    this.level1.add(props.rawProperties()).add(level1Components()).add(toArray(CorePropertyDefinitions.all()));
    configureFromModules(this.level1);
    this.level1.startComponents();
    ComponentContainer level2 = this.level1.createChild();
    level2.add(level2Components());
    configureFromModules(level2);
    level2.startComponents();
    ComponentContainer level3 = level2.createChild();
    level3.add(level3Components());
    configureFromModules(level3);
    level3.startComponents();
    this.level4 = level3.createChild();
    this.level4.add(level4Components());
    configureFromModules(this.level4);
    ServerExtensionInstaller extensionInstaller = this.level4.getComponentByType(ServerExtensionInstaller.class);
    extensionInstaller.installExtensions(this.level4);
    this.level4.startComponents();
    startupTasks();
    return this;
}
Also used : ComponentContainer(org.sonar.core.platform.ComponentContainer) ServerExtensionInstaller(org.sonar.server.plugins.ServerExtensionInstaller)

Example 44 with ComponentContainer

use of org.sonar.core.platform.ComponentContainer in project sonarqube by SonarSource.

the class DaoModuleTest method verify_count_of_added_components.

@Test
public void verify_count_of_added_components() {
    ComponentContainer container = new ComponentContainer();
    new DaoModule().configure(container);
    assertThat(container.size()).isEqualTo(2 + 45);
}
Also used : ComponentContainer(org.sonar.core.platform.ComponentContainer) Test(org.junit.Test)

Example 45 with ComponentContainer

use of org.sonar.core.platform.ComponentContainer in project sonarqube by SonarSource.

the class MigrationConfigurationModuleTest method verify_component_count.

@Test
public void verify_component_count() {
    ComponentContainer container = new ComponentContainer();
    underTest.configure(container);
    assertThat(container.getPicoContainer().getComponentAdapters()).hasSize(COMPONENTS_IN_EMPTY_COMPONENT_CONTAINER + // DbVersion classes
    7 + // Others
    3);
}
Also used : ComponentContainer(org.sonar.core.platform.ComponentContainer) Test(org.junit.Test)

Aggregations

ComponentContainer (org.sonar.core.platform.ComponentContainer)51 Test (org.junit.Test)46 SonarRuntime (org.sonar.api.SonarRuntime)3 AnalysisMode (org.sonar.api.batch.AnalysisMode)3 PluginInfo (org.sonar.core.platform.PluginInfo)3 TaskContainer (org.sonar.server.computation.task.container.TaskContainer)2 TaskContainerImpl (org.sonar.server.computation.task.container.TaskContainerImpl)2 Platform (org.sonar.server.platform.Platform)2 Before (org.junit.Before)1 Sensor (org.sonar.api.batch.Sensor)1 PostJobContext (org.sonar.api.batch.postjob.PostJobContext)1 MapSettings (org.sonar.api.config.MapSettings)1 PostJobOptimizer (org.sonar.scanner.postjob.PostJobOptimizer)1 DefaultSensorContext (org.sonar.scanner.sensor.DefaultSensorContext)1 SensorOptimizer (org.sonar.scanner.sensor.SensorOptimizer)1 ProjectsEsModule (org.sonar.server.measure.index.ProjectsEsModule)1 ServerLifecycleNotifier (org.sonar.server.platform.ServerLifecycleNotifier)1 ServerExtensionInstaller (org.sonar.server.plugins.ServerExtensionInstaller)1