diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-04-17 17:43:59 +0200 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-04-20 10:54:26 +0200 |
commit | 5184eb75a04d52848226067b30eda5e652029cdf (patch) | |
tree | 76d4702592f6e46b823454d2dd27ed72ac4e5de7 /plugins | |
parent | 01f3bef8f77526fb5f5f2dbe94390d42be7fa2bc (diff) | |
download | sonarqube-5184eb75a04d52848226067b30eda5e652029cdf.tar.gz sonarqube-5184eb75a04d52848226067b30eda5e652029cdf.zip |
sanitize batch protocol domains relating to use of singular/plural
Diffstat (limited to 'plugins')
2 files changed, 16 insertions, 11 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/AbstractNewCoverageFileAnalyzer.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/AbstractNewCoverageFileAnalyzer.java index c6ecc1ba900..e215fc18fe5 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/AbstractNewCoverageFileAnalyzer.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/AbstractNewCoverageFileAnalyzer.java @@ -22,7 +22,12 @@ package org.sonar.plugins.core.timemachine; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import org.apache.commons.lang.ObjectUtils; -import org.sonar.api.batch.*; +import org.sonar.api.batch.Decorator; +import org.sonar.api.batch.DecoratorBarriers; +import org.sonar.api.batch.DecoratorContext; +import org.sonar.api.batch.DependedUpon; +import org.sonar.api.batch.DependsUpon; +import org.sonar.api.batch.RequiresDB; import org.sonar.api.measures.Measure; import org.sonar.api.measures.Metric; import org.sonar.api.resources.Project; @@ -33,8 +38,8 @@ import org.sonar.api.utils.KeyValueFormat; import org.sonar.batch.components.Period; import org.sonar.batch.components.TimeMachineConfiguration; import org.sonar.batch.index.ResourceCache; -import org.sonar.batch.protocol.output.BatchReport.Scm; -import org.sonar.batch.protocol.output.BatchReport.Scm.Changeset; +import org.sonar.batch.protocol.output.BatchReport; +import org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset; import org.sonar.batch.protocol.output.BatchReportReader; import org.sonar.batch.report.ReportPublisher; @@ -118,7 +123,7 @@ public abstract class AbstractNewCoverageFileAnalyzer implements Decorator { private boolean parse(DecoratorContext context) { BatchReportReader reader = new BatchReportReader(publishReportJob.getReportDir()); - Scm componentScm = reader.readComponentScm(resourceCache.get(context.getResource()).batchId()); + BatchReport.Changesets componentScm = reader.readChangesets(resourceCache.get(context.getResource()).batchId()); Measure hitsByLineMeasure = context.getMeasure(getCoverageLineHitsDataMetric()); if (componentScm != null && hitsByLineMeasure != null && hitsByLineMeasure.hasData()) { diff --git a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/NewCoverageFileAnalyzerTest.java b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/NewCoverageFileAnalyzerTest.java index 6f02ac2f626..b0efe896194 100644 --- a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/NewCoverageFileAnalyzerTest.java +++ b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/NewCoverageFileAnalyzerTest.java @@ -32,8 +32,8 @@ import org.sonar.api.resources.File; import org.sonar.api.resources.Resource; import org.sonar.api.utils.DateUtils; import org.sonar.batch.index.ResourceCache; -import org.sonar.batch.protocol.output.BatchReport.Scm; -import org.sonar.batch.protocol.output.BatchReport.Scm.Changeset; +import org.sonar.batch.protocol.output.BatchReport; +import org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset; import org.sonar.batch.protocol.output.BatchReportWriter; import org.sonar.batch.report.ReportPublisher; @@ -88,7 +88,7 @@ public class NewCoverageFileAnalyzerTest { @Test public void shouldDoNothingIfNoCoverageData() throws ParseException { - writer.writeComponentScm(Scm.newBuilder() + writer.writeComponentChangesets(BatchReport.Changesets.newBuilder() .setComponentRef(1) .addChangeset(Changeset.newBuilder() .setDate(DateUtils.parseDateTime("2008-05-18T00:00:00+0000").getTime()) @@ -105,7 +105,7 @@ public class NewCoverageFileAnalyzerTest { public void shouldGetNewLines() throws ParseException { when(context.getMeasure(CoreMetrics.COVERAGE_LINE_HITS_DATA)).thenReturn( new Measure(CoreMetrics.COVERAGE_LINE_HITS_DATA, "10=2;11=3")); - writer.writeComponentScm(Scm.newBuilder() + writer.writeComponentChangesets(BatchReport.Changesets.newBuilder() .setComponentRef(1) .addChangeset(Changeset.newBuilder() .build()) @@ -155,7 +155,7 @@ public class NewCoverageFileAnalyzerTest { new Measure(CoreMetrics.CONDITIONS_BY_LINE, "11=4")); when(context.getMeasure(CoreMetrics.COVERED_CONDITIONS_BY_LINE)).thenReturn( new Measure(CoreMetrics.COVERED_CONDITIONS_BY_LINE, "11=1")); - writer.writeComponentScm(Scm.newBuilder() + writer.writeComponentChangesets(BatchReport.Changesets.newBuilder() .setComponentRef(1) .addChangeset(Changeset.newBuilder() .build()) @@ -205,7 +205,7 @@ public class NewCoverageFileAnalyzerTest { new Measure(CoreMetrics.CONDITIONS_BY_LINE, "10=1")); when(context.getMeasure(CoreMetrics.COVERED_CONDITIONS_BY_LINE)).thenReturn( new Measure(CoreMetrics.COVERED_CONDITIONS_BY_LINE, "10=1")); - writer.writeComponentScm(Scm.newBuilder() + writer.writeComponentChangesets(BatchReport.Changesets.newBuilder() .setComponentRef(1) .addChangeset(Changeset.newBuilder() .build()) @@ -244,7 +244,7 @@ public class NewCoverageFileAnalyzerTest { new Measure(CoreMetrics.CONDITIONS_BY_LINE, "2=1")); when(context.getMeasure(CoreMetrics.COVERED_CONDITIONS_BY_LINE)).thenReturn( new Measure(CoreMetrics.COVERED_CONDITIONS_BY_LINE, "2=1")); - writer.writeComponentScm(Scm.newBuilder() + writer.writeComponentChangesets(BatchReport.Changesets.newBuilder() .setComponentRef(1) .addChangeset(Changeset.newBuilder() .setDate(DateUtils.parseDateTime("2008-08-02T13:56:37+0200").getTime()) |