aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2017-02-19 11:13:25 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2017-02-19 11:13:25 +0100
commit4e068d056632d55aa93b39d1e02102458d708b33 (patch)
treebae1eb5655468e0d134a83948c02c1c3e15fef38
parentf4f62cc533a6774a23adf560608abad47f38f852 (diff)
downloadsonarqube-4e068d056632d55aa93b39d1e02102458d708b33.tar.gz
sonarqube-4e068d056632d55aa93b39d1e02102458d708b33.zip
Move temp dir of build outsite project
Overriding java.io.tmpdir does not allow to detect issues with canonical path in tests. Moreover this complex (and useless) configuration does not allow to support Gradle.
-rw-r--r--pom.xml1
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/batch/fs/internal/DefaultFilePredicatesTest.java1
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/filesystem/ExclusionFiltersTest.java7
3 files changed, 3 insertions, 6 deletions
diff --git a/pom.xml b/pom.xml
index c6f51e8ee6f..bc2cd9f0712 100644
--- a/pom.xml
+++ b/pom.xml
@@ -374,7 +374,6 @@
<configuration>
<runOrder>random</runOrder>
<systemPropertyVariables>
- <java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
<!--
See profile 'randomize-environment'
-->
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/batch/fs/internal/DefaultFilePredicatesTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/batch/fs/internal/DefaultFilePredicatesTest.java
index 1ae7361cd20..a960b342573 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/batch/fs/internal/DefaultFilePredicatesTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/batch/fs/internal/DefaultFilePredicatesTest.java
@@ -140,7 +140,6 @@ public class DefaultFilePredicatesTest {
// absolute file
assertThat(predicates.is(javaFile.file()).apply(javaFile)).isTrue();
assertThat(predicates.is(javaFile.file().getAbsoluteFile()).apply(javaFile)).isTrue();
- assertThat(predicates.is(javaFile.file().getCanonicalFile()).apply(javaFile)).isTrue();
assertThat(predicates.is(new File(javaFile.file().toURI())).apply(javaFile)).isTrue();
assertThat(predicates.is(temp.newFile()).apply(javaFile)).isFalse();
}
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/filesystem/ExclusionFiltersTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/filesystem/ExclusionFiltersTest.java
index fd5e5b477f2..20a528ac7a8 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/filesystem/ExclusionFiltersTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/filesystem/ExclusionFiltersTest.java
@@ -19,12 +19,9 @@
*/
package org.sonar.scanner.scan.filesystem;
-import static org.assertj.core.api.Assertions.assertThat;
-
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
-
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -37,6 +34,8 @@ import org.sonar.api.config.MapSettings;
import org.sonar.api.config.Settings;
import org.sonar.api.scan.filesystem.FileExclusions;
+import static org.assertj.core.api.Assertions.assertThat;
+
public class ExclusionFiltersTest {
@Rule
@@ -114,7 +113,7 @@ public class ExclusionFiltersTest {
Settings settings = new MapSettings();
settings.setProperty(CoreProperties.PROJECT_INCLUSIONS_PROPERTY, "src/main/java/**/*");
- settings.setProperty(CoreProperties.PROJECT_EXCLUSIONS_PROPERTY, "file:" + excludedFile.getCanonicalPath());
+ settings.setProperty(CoreProperties.PROJECT_EXCLUSIONS_PROPERTY, "file:" + excludedFile.getAbsolutePath());
ExclusionFilters filter = new ExclusionFilters(new FileExclusions(settings));
filter.prepare();