use of org.sonar.server.computation.task.step.ComputationStep in project sonarqube by SonarSource.
the class LoadMeasureComputersStepTest method not_fail_if_input_metrics_are_same_as_output_metrics.
@Test
public void not_fail_if_input_metrics_are_same_as_output_metrics() throws Exception {
MeasureComputer[] computers = new MeasureComputer[] { newMeasureComputer(array(NEW_METRIC_1), array(NEW_METRIC_1)) };
ComputationStep underTest = new LoadMeasureComputersStep(holder, array(new TestMetrics()), computers);
underTest.execute();
assertThat(holder.getMeasureComputers()).hasSize(1);
}
use of org.sonar.server.computation.task.step.ComputationStep in project sonarqube by SonarSource.
the class LoadMeasureComputersStepTest method support_core_metrics_as_input_metrics.
@Test
public void support_core_metrics_as_input_metrics() throws Exception {
MeasureComputer[] computers = new MeasureComputer[] { newMeasureComputer(array(NCLOC_KEY), array(NEW_METRIC_1)) };
ComputationStep underTest = new LoadMeasureComputersStep(holder, array(new TestMetrics()), computers);
underTest.execute();
assertThat(holder.getMeasureComputers()).hasSize(1);
}
use of org.sonar.server.computation.task.step.ComputationStep in project sonarqube by SonarSource.
the class LoadMeasureComputersStepTest method support_plugin_metrics_as_input_metrics.
@Test
public void support_plugin_metrics_as_input_metrics() throws Exception {
MeasureComputer[] computers = new MeasureComputer[] { newMeasureComputer(array(NEW_METRIC_1), array(NEW_METRIC_2)) };
ComputationStep underTest = new LoadMeasureComputersStep(holder, array(new TestMetrics()), computers);
underTest.execute();
assertThat(holder.getMeasureComputers()).hasSize(1);
}
use of org.sonar.server.computation.task.step.ComputationStep in project sonarqube by SonarSource.
the class LoadMeasureComputersStepTest method fail_with_ISE_when_output_metric_is_not_define_by_plugin.
@Test
public void fail_with_ISE_when_output_metric_is_not_define_by_plugin() throws Exception {
thrown.expect(IllegalStateException.class);
thrown.expectMessage("Metric 'unknown' cannot be used as an output metric as no plugin declare this metric");
MeasureComputer[] computers = new MeasureComputer[] { newMeasureComputer(array(NEW_METRIC_4), array("unknown")) };
ComputationStep underTest = new LoadMeasureComputersStep(holder, array(new TestMetrics()), computers);
underTest.execute();
}
use of org.sonar.server.computation.task.step.ComputationStep in project sonarqube by SonarSource.
the class LoadReportAnalysisMetadataHolderStepTest method execute_fails_with_MessageException_when_report_has_no_organizationKey_but_does_not_belong_to_the_default_organization.
@Test
public void execute_fails_with_MessageException_when_report_has_no_organizationKey_but_does_not_belong_to_the_default_organization() {
reportReader.setMetadata(newBatchReportBuilder().build());
OrganizationDto nonDefaultOrganizationDto = dbTester.organizations().insert();
ComputationStep underTest = createStep(createCeTask(PROJECT_KEY, nonDefaultOrganizationDto.getUuid()));
expectedException.expect(MessageException.class);
expectedException.expectMessage("Report does not specify an OrganizationKey but it has been submitted to another organization (" + nonDefaultOrganizationDto.getKey() + ") than the default one (" + dbTester.getDefaultOrganization().getKey() + ")");
underTest.execute();
}
Aggregations