metric.comment_lines_density.name=Comments (%)
metric.comment_lines_density.short_name=Comments
metric.complexity.description=Cyclomatic complexity
-metric.complexity.name=Complexity
+metric.complexity.name=Cyclomatic Complexity
metric.complexity_in_classes.description=Cyclomatic complexity in classes
metric.complexity_in_classes.name=Complexity in Classes
metric.complexity_in_functions.description=Cyclomatic complexity in functions
import java.util.TimeZone;
import org.junit.Before;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.runners.MockitoJUnitRunner;
import org.sonar.api.measures.CoreMetrics;
import org.sonar.api.measures.Metric;
import org.sonar.api.utils.DateUtils;
-import org.sonar.api.utils.System2;
+import org.sonar.api.utils.internal.TestSystem2;
import org.sonar.core.platform.PluginInfo;
import org.sonar.core.platform.PluginRepository;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-@RunWith(MockitoJUnitRunner.class)
public class DefaultI18nTest {
- @Mock
- System2 system2;
+ private TestSystem2 system2 = new TestSystem2();
DefaultI18n underTest;
@Test
public void get_age_from_now() {
- when(system2.now()).thenReturn(DateUtils.parseDate("2014-01-02").getTime());
+ system2.setNow(DateUtils.parseDate("2014-01-02").getTime());
assertThat(underTest.ageFromNow(Locale.ENGLISH, DateUtils.parseDate("2014-01-01"))).isEqualTo("a day");
}
// --------------------------------------------------------------------------------------------------------------------
public static final String COMPLEXITY_KEY = "complexity";
- public static final Metric<Integer> COMPLEXITY = new Metric.Builder(COMPLEXITY_KEY, "Complexity", Metric.ValueType.INT)
+ public static final Metric<Integer> COMPLEXITY = new Metric.Builder(COMPLEXITY_KEY, "Cyclomatic Complexity", Metric.ValueType.INT)
.setDescription("Cyclomatic complexity")
.setDirection(Metric.DIRECTION_WORST)
.setQualitative(false)