import org.sonar.api.measures.CoreMetrics;
import org.sonar.api.resources.Qualifiers;
-import org.sonar.api.web.*;
+import org.sonar.api.web.AbstractRubyTemplate;
+import org.sonar.api.web.DefaultTab;
+import org.sonar.api.web.NavigationSection;
+import org.sonar.api.web.ResourceQualifier;
+import org.sonar.api.web.RubyRailsPage;
+import org.sonar.api.web.UserRole;
@ResourceQualifier(Qualifiers.UNIT_TEST_FILE)
@NavigationSection(NavigationSection.RESOURCE_TAB)
-@DefaultTab(metrics = {CoreMetrics.TESTS_KEY, CoreMetrics.TEST_EXECUTION_TIME_KEY, CoreMetrics.TEST_SUCCESS_DENSITY_KEY, CoreMetrics.TEST_FAILURES_KEY, CoreMetrics.TEST_ERRORS_KEY, CoreMetrics.SKIPPED_TESTS_KEY})
+@DefaultTab(metrics = {
+ CoreMetrics.TESTS_KEY, CoreMetrics.TEST_EXECUTION_TIME_KEY, CoreMetrics.TEST_SUCCESS_DENSITY_KEY,
+ CoreMetrics.TEST_FAILURES_KEY, CoreMetrics.TEST_ERRORS_KEY, CoreMetrics.SKIPPED_TESTS_KEY})
@UserRole(UserRole.CODEVIEWER)
public class TestsViewer extends AbstractRubyTemplate implements RubyRailsPage {
return operator.equals(OPERATOR_NOT_EQUALS);
}
+ /**
+ * This method should not be used because it does not manage alerts with variation
+ * @see org.sonar.plugins.core.sensors.CheckAlertThresholds#getAlertLabel(Alert alert, Metric.Level level)
+ * @deprecated
+ */
+ public String getAlertLabel(Metric.Level level) {
+ return new StringBuilder()
+ .append(getMetric().getName())
+ .append(" ").append(getOperator())
+ .append(" ")
+ .append(level.equals(Metric.Level.ERROR) ? getValueError() : getValueWarning()).toString();
+ }
+
@Override
public Object clone() {
return new Alert(getRulesProfile(), getMetric(), getOperator(), getValueError(), getValueWarning(), getPeriod());