use of org.sonar.server.computation.task.container.TaskContainer in project sonarqube by SonarSource.
the class ReportTaskProcessor method process.
@Override
public CeTaskResult process(CeTask task) {
TaskContainer ceContainer = containerFactory.create(serverContainer, task, componentProviders);
try {
ceContainer.getComponentByType(ComputationStepExecutor.class).execute();
return ceContainer.getComponentByType(TaskResultHolder.class).getResult();
} finally {
ensureThreadLocalIsClean(ceContainer);
ceContainer.cleanup();
}
}
use of org.sonar.server.computation.task.container.TaskContainer 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());
}
use of org.sonar.server.computation.task.container.TaskContainer 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());
}
Aggregations