Skip to content

Commit 0f5bd3c

Browse files
JACOCO-95 Fix warning log for multi-value property (#166)
1 parent 33149e3 commit 0f5bd3c

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/main/java/org/sonar/plugins/jacoco/JacocoPlugin.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ public void define(Context context) {
4040
context.addExtension(JacocoAggregateSensor.class);
4141
context.addExtension(PropertyDefinition.builder(ReportPathsProvider.AGGREGATE_REPORT_PATHS_PROPERTY_KEY)
4242
.onQualifiers(Qualifiers.PROJECT)
43-
.type(PropertyType.STRING)
44-
.multiValues(false)
43+
.multiValues(true)
4544
.category("JaCoCo")
4645
.description("Paths to JaCoCo XML aggregate coverage report files. Each path can be either absolute or relative" +
4746
" to the project base directory. Wildcard patterns are accepted (*, ** and ?).")

src/test/java/org/sonar/plugins/jacoco/JacocoPluginTest.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,20 @@ void should_add_sensors_and_property_definitions() {
5050
PropertyDefinition multiValueReportPaths = (PropertyDefinition) arg.getAllValues().get(2);
5151
assertThat(multiValueReportPaths.key()).isEqualTo("sonar.coverage.jacoco.xmlReportPaths");
5252
assertThat(multiValueReportPaths.multiValues()).isTrue();
53+
assertThat(multiValueReportPaths.type()).isEqualTo(PropertyType.STRING);
5354
assertThat(multiValueReportPaths.category()).isEqualTo("JaCoCo");
5455
assertThat(multiValueReportPaths.description()).isEqualTo("Paths to JaCoCo XML coverage report files. Each path can be either absolute or relative" +
5556
" to the project base directory. Wildcard patterns are accepted (*, ** and ?).");
5657
assertThat(multiValueReportPaths.qualifiers()).containsOnly(Qualifiers.PROJECT);
5758

5859
assertThat(arg.getAllValues().get(3)).isEqualTo(JacocoAggregateSensor.class);
59-
PropertyDefinition aggregateReportPath = (PropertyDefinition) arg.getAllValues().get(4);
60-
assertThat(aggregateReportPath.key()).isEqualTo("sonar.coverage.jacoco.aggregateXmlReportPaths");
61-
assertThat(aggregateReportPath.type()).isEqualTo(PropertyType.STRING);
62-
assertThat(aggregateReportPath.multiValues()).isFalse();
63-
assertThat(aggregateReportPath.category()).isEqualTo("JaCoCo");
64-
assertThat(aggregateReportPath.description()).isEqualTo("Paths to JaCoCo XML aggregate coverage report files. Each path can be either absolute or relative" +
60+
PropertyDefinition aggregateReportPaths = (PropertyDefinition) arg.getAllValues().get(4);
61+
assertThat(aggregateReportPaths.key()).isEqualTo("sonar.coverage.jacoco.aggregateXmlReportPaths");
62+
assertThat(aggregateReportPaths.type()).isEqualTo(PropertyType.STRING);
63+
assertThat(aggregateReportPaths.multiValues()).isTrue();
64+
assertThat(aggregateReportPaths.category()).isEqualTo("JaCoCo");
65+
assertThat(aggregateReportPaths.description()).isEqualTo("Paths to JaCoCo XML aggregate coverage report files. Each path can be either absolute or relative" +
6566
" to the project base directory. Wildcard patterns are accepted (*, ** and ?).");
66-
assertThat(aggregateReportPath.qualifiers()).containsOnly(Qualifiers.PROJECT);
67+
assertThat(aggregateReportPaths.qualifiers()).containsOnly(Qualifiers.PROJECT);
6768
}
6869
}

0 commit comments

Comments
 (0)