diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2017-04-12 15:35:13 +0200 |
---|---|---|
committer | Julien HENRY <henryju@yahoo.fr> | 2017-04-12 20:57:37 +0200 |
commit | 3f8feb090594863155ce0cb1451128559965836d (patch) | |
tree | 31d51e65321bf813a6f205bb4490cceda0341879 /it | |
parent | ab646a451062935cc9d9b32fbe80e3c489262230 (diff) | |
download | sonar-scanner-cli-3f8feb090594863155ce0cb1451128559965836d.tar.gz sonar-scanner-cli-3f8feb090594863155ce0cb1451128559965836d.zip |
SQSCANNER-39 Don't filter properties with blank value
Diffstat (limited to 'it')
-rw-r--r-- | it/pom.xml | 2 | ||||
-rw-r--r-- | it/src/test/java/com/sonar/runner/it/JavaTest.java | 23 |
2 files changed, 22 insertions, 3 deletions
@@ -6,7 +6,7 @@ <parent> <groupId>org.sonarsource.parent</groupId> <artifactId>parent</artifactId> - <version>37</version> + <version>40</version> <relativePath /> </parent> diff --git a/it/src/test/java/com/sonar/runner/it/JavaTest.java b/it/src/test/java/com/sonar/runner/it/JavaTest.java index 3519159..2e7f95c 100644 --- a/it/src/test/java/com/sonar/runner/it/JavaTest.java +++ b/it/src/test/java/com/sonar/runner/it/JavaTest.java @@ -60,8 +60,7 @@ public class JavaTest extends ScannerTestCase { orchestrator.getServer().associateProjectToQualityProfile("java:sample", "java", "sonar-way"); SonarScanner build = newScanner(new File("projects/java-sample")) - .setProperty("sonar.verbose", "true") - .addArguments("-e"); + .setProperty("sonar.verbose", "true"); // SONARPLUGINS-3061 // Add a trailing slash build.setProperty("sonar.host.url", orchestrator.getServer().getUrl() + "/"); @@ -86,6 +85,26 @@ public class JavaTest extends ScannerTestCase { assertThat(parseInt(fileMeasures.get("violations").getValue())).isGreaterThan(0); } + /** + * Only tests, no sources + */ + @Test + public void scan_java_tests() { + orchestrator.getServer().restoreProfile(ResourceLocation.create("/sonar-way-profile.xml")); + orchestrator.getServer().provisionProject("java:sampletest", "Java Sample"); + orchestrator.getServer().associateProjectToQualityProfile("java:sampletest", "java", "sonar-way"); + + SonarScanner build = newScanner(new File("projects/java-sample")) + .setProperty("sonar.projectKey", "java:sampletest") + .setProperty("sonar.tests", "src") + .setProperty("sonar.sources", ""); + orchestrator.executeBuild(build); + + Component file = getComponent("java:sampletest:src/basic/Hello.java"); + assertThat(file.getName()).isEqualTo("Hello.java"); + assertThat(file.getQualifier()).isEqualTo("UTS"); + } + @Test public void scan_java_sources_and_bytecode() { orchestrator.getServer().restoreProfile(ResourceLocation.create("/requires-bytecode-profile.xml")); |