Search in sources :

Example 21 with ComponentContainer

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

the class MeasuresWsModuleTest method verify_count_of_added_components.

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

Example 22 with ComponentContainer

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

the class RequestIdFilterTest method setUp.

@Before
public void setUp() throws Exception {
    ComponentContainer container = new ComponentContainer();
    container.add(requestIdGenerator);
    when(platform.getContainer()).thenReturn(container);
}
Also used : ComponentContainer(org.sonar.core.platform.ComponentContainer) Before(org.junit.Before)

Example 23 with ComponentContainer

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

the class RequestIdFilterTest method filter_does_not_add_requestId_to_request_passed_on_to_chain_when_there_is_no_RequestIdGenerator_in_container.

@Test
public void filter_does_not_add_requestId_to_request_passed_on_to_chain_when_there_is_no_RequestIdGenerator_in_container() throws IOException, ServletException {
    Platform platform = mock(Platform.class);
    when(platform.getContainer()).thenReturn(new ComponentContainer());
    RequestIdFilter underTest = new RequestIdFilter(platform);
    underTest.doFilter(servletRequest, servletResponse, filterChain);
    verify(servletRequest, times(0)).setAttribute(anyString(), anyString());
}
Also used : Platform(org.sonar.server.platform.Platform) ComponentContainer(org.sonar.core.platform.ComponentContainer) Test(org.junit.Test)

Example 24 with ComponentContainer

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

the class ProjectAnalysisModuleTest method verify_count_of_added_components.

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

Example 25 with ComponentContainer

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

the class ProjectTagsWsModuleTest method verify_count_of_added_components.

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