diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2018-04-24 15:27:56 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-05-09 20:20:46 +0200 |
commit | fa4019b992510560be8c6d1b51bc2dc2f6b41546 (patch) | |
tree | 815cf6138b9e0b3a419c27cfe98e691080264af3 /sonar-scanner-protocol/src/test/java/org/sonar/scanner | |
parent | 09b3d167fa8f399e18a37d56e7c8cbb61f68f97f (diff) | |
download | sonarqube-fa4019b992510560be8c6d1b51bc2dc2f6b41546.tar.gz sonarqube-fa4019b992510560be8c6d1b51bc2dc2f6b41546.zip |
SONAR-10638 Create Java API for analyzers to report significant code
Diffstat (limited to 'sonar-scanner-protocol/src/test/java/org/sonar/scanner')
-rw-r--r-- | sonar-scanner-protocol/src/test/java/org/sonar/scanner/protocol/output/ScannerReportWriterTest.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sonar-scanner-protocol/src/test/java/org/sonar/scanner/protocol/output/ScannerReportWriterTest.java b/sonar-scanner-protocol/src/test/java/org/sonar/scanner/protocol/output/ScannerReportWriterTest.java index f4ee4dc3ed3..6d0223be28d 100644 --- a/sonar-scanner-protocol/src/test/java/org/sonar/scanner/protocol/output/ScannerReportWriterTest.java +++ b/sonar-scanner-protocol/src/test/java/org/sonar/scanner/protocol/output/ScannerReportWriterTest.java @@ -284,6 +284,21 @@ public class ScannerReportWriterTest { } @Test + public void write_line_significant_code() { + // no data yet + assertThat(underTest.hasComponentData(FileStructure.Domain.SGNIFICANT_CODE, 1)).isFalse(); + + underTest.writeComponentSignificantCode(1, asList( + ScannerReport.LineSgnificantCode.newBuilder() + .setLine(1) + .setStartOffset(2) + .setEndOffset(3) + .build())); + + assertThat(underTest.hasComponentData(FileStructure.Domain.SGNIFICANT_CODE, 1)).isTrue(); + } + + @Test public void write_coverage() { // no data yet assertThat(underTest.hasComponentData(FileStructure.Domain.COVERAGES, 1)).isFalse(); |