Search in sources :

Example 31 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_any_step.

@Test
public void instances_throws_ISE_if_container_does_not_have_any_step() throws Exception {
    expectedException.expect(IllegalStateException.class);
    expectedException.expectMessage("Component not found: " + ExtractReportStep.class);
    TaskContainerImpl computeEngineContainer = new TaskContainerImpl(new 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 32 with ComponentContainer

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

the class EsTester method before.

@Override
protected void before() throws Throwable {
    truncateIndices();
    if (!indexDefinitions.isEmpty()) {
        container = new ComponentContainer();
        container.addSingleton(new MapSettings());
        container.addSingletons(indexDefinitions);
        container.addSingleton(client);
        container.addSingleton(IndexDefinitions.class);
        container.addSingleton(IndexCreator.class);
        container.startComponents();
    }
}
Also used : MapSettings(org.sonar.api.config.MapSettings) ComponentContainer(org.sonar.core.platform.ComponentContainer)

Example 33 with ComponentContainer

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

the class ProjectsEsModuleTest method verify_count_of_added_components.

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

Example 34 with ComponentContainer

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

the class LicensesWsModuleTest method verify_count_of_added_components.

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

Example 35 with ComponentContainer

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

the class NotificationModuleTest method verify_count_of_added_components.

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