Search in sources :

Example 11 with ComponentContainer

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

the class ComputeEngineContainerImpl method startupTasks.

private void startupTasks() {
    ComponentContainer startupLevel = this.level4.createChild();
    startupLevel.add(startupComponents());
    startupLevel.startComponents();
    // done in PlatformLevelStartup
    ServerLifecycleNotifier serverLifecycleNotifier = startupLevel.getComponentByType(ServerLifecycleNotifier.class);
    if (serverLifecycleNotifier != null) {
        serverLifecycleNotifier.notifyStart();
    }
    startupLevel.stopComponents();
}
Also used : ComponentContainer(org.sonar.core.platform.ComponentContainer) ServerLifecycleNotifier(org.sonar.server.platform.ServerLifecycleNotifier)

Example 12 with ComponentContainer

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

the class MigrationEngineModuleTest 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 + 2);
}
Also used : ComponentContainer(org.sonar.core.platform.ComponentContainer) Test(org.junit.Test)

Example 13 with ComponentContainer

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

the class AuthenticationModuleTest method verify_count_of_added_components.

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

Example 14 with ComponentContainer

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

the class ReportComputationStepsTest method instances_throws_ISE_if_container_does_not_have_second_step.

@Test
public void instances_throws_ISE_if_container_does_not_have_second_step() throws Exception {
    expectedException.expect(IllegalStateException.class);
    expectedException.expectMessage("Component not found: class org.sonar.server.computation.task.projectanalysis.step.PersistScannerContextStep");
    final ExtractReportStep reportExtractionStep = mock(ExtractReportStep.class);
    ComponentContainer componentContainer = new ComponentContainer() {

        {
            addSingleton(reportExtractionStep);
        }
    };
    TaskContainerImpl computeEngineContainer = new TaskContainerImpl(componentContainer, new ContainerPopulator<TaskContainer>() {

        @Override
        public void populateContainer(TaskContainer container) {
        // do nothing
        }
    });
    Lists.newArrayList(new ReportComputationSteps(computeEngineContainer).instances());
}
Also used : TaskContainerImpl(org.sonar.server.computation.task.container.TaskContainerImpl) TaskContainer(org.sonar.server.computation.task.container.TaskContainer) ComponentContainer(org.sonar.core.platform.ComponentContainer) Test(org.junit.Test)

Example 15 with ComponentContainer

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

the class WebhookModuleTest method verify_count_of_added_components.

@Test
public void verify_count_of_added_components() {
    ComponentContainer container = new ComponentContainer();
    underTest.configure(container);
    assertThat(container.size()).isEqualTo(4 + COMPONENTS_IN_EMPTY_COMPONENT_CONTAINER);
}
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