use of org.sonar.server.computation.task.projectanalysis.metric.Metric.MetricType in project sonarqube by SonarSource.
the class ConditionEvaluatorTest method test_condition_on_period.
@Test
public void test_condition_on_period() {
for (MetricType metricType : ImmutableList.of(FLOAT, INT, WORK_DUR)) {
Metric metric = createMetric(metricType);
Measure measure = newMeasureBuilder().setVariation(3d).createNoValue();
assertThat(underTest.evaluate(new Condition(metric, GREATER_THAN.getDbValue(), "3", null, true), measure)).hasLevel(OK);
}
}
use of org.sonar.server.computation.task.projectanalysis.metric.Metric.MetricType in project sonarqube by SonarSource.
the class ConditionEvaluatorTest method condition_is_always_ok_when_measure_is_noValue.
@Test
public void condition_is_always_ok_when_measure_is_noValue() {
for (MetricType metricType : from(asList(values())).filter(not(in(ImmutableSet.of(DATA, LEVEL))))) {
Metric metric = createMetric(metricType);
Measure measure = newMeasureBuilder().createNoValue();
assertThat(underTest.evaluate(createErrorCondition(metric, EQUALS, "10.2"), measure)).hasLevel(OK);
}
}
Aggregations