Search in sources :

Example 16 with ComputationStep

use of org.sonar.server.computation.task.step.ComputationStep in project sonarqube by SonarSource.

the class LoadMeasureComputersStepTest method fail_with_ISE_when_no_metrics_are_defined_by_plugin_but_measure_computer_use_a_new_metric.

@Test
public void fail_with_ISE_when_no_metrics_are_defined_by_plugin_but_measure_computer_use_a_new_metric() throws Exception {
    thrown.expect(IllegalStateException.class);
    thrown.expectMessage("Metric 'metric1' cannot be used as an output metric as no plugin declare this metric");
    MeasureComputer[] computers = new MeasureComputer[] { newMeasureComputer(array(NCLOC_KEY), array(NEW_METRIC_1)) };
    ComputationStep underTest = new LoadMeasureComputersStep(holder, computers);
    underTest.execute();
}
Also used : MeasureComputer(org.sonar.api.ce.measure.MeasureComputer) ComputationStep(org.sonar.server.computation.task.step.ComputationStep) Test(org.junit.Test)

Example 17 with ComputationStep

use of org.sonar.server.computation.task.step.ComputationStep in project sonarqube by SonarSource.

the class LoadMeasureComputersStepTest method return_empty_list_when_no_measure_computers.

@Test
public void return_empty_list_when_no_measure_computers() throws Exception {
    ComputationStep underTest = new LoadMeasureComputersStep(holder, array(new TestMetrics()));
    underTest.execute();
    assertThat(holder.getMeasureComputers()).isEmpty();
}
Also used : ComputationStep(org.sonar.server.computation.task.step.ComputationStep) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)17 ComputationStep (org.sonar.server.computation.task.step.ComputationStep)17 MeasureComputer (org.sonar.api.ce.measure.MeasureComputer)11 CeTask (org.sonar.ce.queue.CeTask)2 OrganizationDto (org.sonar.db.organization.OrganizationDto)2 MeasureComputerWrapper (org.sonar.server.computation.task.projectanalysis.api.measurecomputer.MeasureComputerWrapper)2 Organization (org.sonar.server.computation.task.projectanalysis.analysis.Organization)1