use of org.sonar.server.computation.task.projectanalysis.metric.MetricImpl in project sonarqube by SonarSource.
the class CustomMeasuresCopyStepTest method test_float_value_type.
@Test
public void test_float_value_type() throws Exception {
CustomMeasureDto dto = new CustomMeasureDto();
dto.setValue(10.0);
assertThat(dtoToMeasure(dto, new MetricImpl(1, "m", "M", Metric.MetricType.FLOAT)).getDoubleValue()).isEqualTo(10.0);
}
use of org.sonar.server.computation.task.projectanalysis.metric.MetricImpl in project sonarqube by SonarSource.
the class CustomMeasuresCopyStepTest method test_percent_value_type.
@Test
public void test_percent_value_type() throws Exception {
CustomMeasureDto dto = new CustomMeasureDto();
dto.setValue(10.0);
assertThat(dtoToMeasure(dto, new MetricImpl(1, "m", "M", Metric.MetricType.PERCENT)).getDoubleValue()).isEqualTo(10);
}
use of org.sonar.server.computation.task.projectanalysis.metric.MetricImpl in project sonarqube by SonarSource.
the class CustomMeasuresCopyStepTest method test_string_value_type.
@Test
public void test_string_value_type() throws Exception {
CustomMeasureDto dto = new CustomMeasureDto();
dto.setTextValue("foo");
assertThat(dtoToMeasure(dto, new MetricImpl(1, "m", "M", Metric.MetricType.STRING)).getStringValue()).isEqualTo("foo");
}
Aggregations