aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2014-10-02 11:28:15 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2014-10-02 11:33:03 +0200
commitb208388058b996661eb3e48bc33f67c928f4d0ce (patch)
tree12f5e8306d6817bbf1fbb8255890eb03d4bf6f4c /plugins
parentd9721fed6b9b17e8b0c466f85535ca7bbace6462 (diff)
downloadsonarqube-b208388058b996661eb3e48bc33f67c928f4d0ce.tar.gz
sonarqube-b208388058b996661eb3e48bc33f67c928f4d0ce.zip
SONAR-5682 Drop (some) APIs that were deprecated in versions 2.x or 3.x
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sonar-cpd-plugin/pom.xml5
-rw-r--r--plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/DefaultCpdEngine.java2
-rw-r--r--plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/DefaultCpdEngineTest.java2
-rw-r--r--plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/lang/MeasureSensorTest.java5
4 files changed, 8 insertions, 6 deletions
diff --git a/plugins/sonar-cpd-plugin/pom.xml b/plugins/sonar-cpd-plugin/pom.xml
index 48293a28711..0cbacd25785 100644
--- a/plugins/sonar-cpd-plugin/pom.xml
+++ b/plugins/sonar-cpd-plugin/pom.xml
@@ -27,6 +27,11 @@
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-duplications</artifactId>
<scope>provided</scope>
diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/DefaultCpdEngine.java b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/DefaultCpdEngine.java
index 925ecb87638..4c198581b8a 100644
--- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/DefaultCpdEngine.java
+++ b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/DefaultCpdEngine.java
@@ -187,7 +187,7 @@ public class DefaultCpdEngine extends CpdEngine {
minimumTokens = settings.getInt(CoreProperties.CPD_MINIMUM_TOKENS_PROPERTY);
}
if (minimumTokens == 0) {
- minimumTokens = CoreProperties.CPD_MINIMUM_TOKENS_DEFAULT_VALUE;
+ minimumTokens = 100;
}
return minimumTokens;
diff --git a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/DefaultCpdEngineTest.java b/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/DefaultCpdEngineTest.java
index 6410d5ddcf0..4c65940417a 100644
--- a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/DefaultCpdEngineTest.java
+++ b/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/DefaultCpdEngineTest.java
@@ -83,7 +83,7 @@ public class DefaultCpdEngineTest {
@Test
public void defaultMinimumTokens() {
- assertThat(engine.getMinimumTokens("java")).isEqualTo(CoreProperties.CPD_MINIMUM_TOKENS_DEFAULT_VALUE);
+ assertThat(engine.getMinimumTokens("java")).isEqualTo(100);
}
@Test
diff --git a/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/lang/MeasureSensorTest.java b/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/lang/MeasureSensorTest.java
index 2e04e8184db..bea85df2714 100644
--- a/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/lang/MeasureSensorTest.java
+++ b/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/lang/MeasureSensorTest.java
@@ -91,7 +91,7 @@ public class MeasureSensorTest {
@Test
public void testExecution() throws IOException {
File measures = new File(baseDir, "src/foo.xoo.measures");
- FileUtils.write(measures, "ncloc:12\nbranch_coverage:5.3\nsqale_index:300\nbool:true\ncomment_lines_data:1=1,2=1\n\n#comment");
+ FileUtils.write(measures, "ncloc:12\nbranch_coverage:5.3\nsqale_index:300\nbool:true\n\n#comment");
DefaultInputFile inputFile = new DefaultInputFile("foo", "src/foo.xoo").setAbsolutePath(new File(baseDir, "src/foo.xoo").getAbsolutePath()).setLanguage("xoo");
fileSystem.add(inputFile);
@@ -101,7 +101,6 @@ public class MeasureSensorTest {
when(metricFinder.findByKey("ncloc")).thenReturn(CoreMetrics.NCLOC);
when(metricFinder.findByKey("branch_coverage")).thenReturn(CoreMetrics.BRANCH_COVERAGE);
when(metricFinder.findByKey("sqale_index")).thenReturn(CoreMetrics.TECHNICAL_DEBT);
- when(metricFinder.findByKey("comment_lines_data")).thenReturn(CoreMetrics.COMMENT_LINES_DATA);
when(metricFinder.findByKey("bool")).thenReturn(booleanMetric);
sensor.execute(context);
@@ -110,8 +109,6 @@ public class MeasureSensorTest {
verify(storage).store(new DefaultMeasure().forMetric(CoreMetrics.BRANCH_COVERAGE).onFile(inputFile).withValue(5.3));
verify(storage).store(new DefaultMeasure().forMetric(CoreMetrics.TECHNICAL_DEBT).onFile(inputFile).withValue(300L));
verify(storage).store(new DefaultMeasure().forMetric(booleanMetric).onFile(inputFile).withValue(true));
- verify(storage).store(new DefaultMeasure().forMetric(CoreMetrics.COMMENT_LINES_DATA).onFile(inputFile).withValue("1=1,2=1"));
-
}
@Test