aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2013-04-14 14:39:12 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2013-04-14 14:39:12 +0200
commit4acb44301b09b1af2fa8118b888bd9cec415e463 (patch)
tree57157d12d5319210f07d106ab8dcfa65f46f71d8 /sonar-batch
parent9a9af0fa8a100abe70c630d2202db47ec2e1ad86 (diff)
downloadsonarqube-4acb44301b09b1af2fa8118b888bd9cec415e463.tar.gz
sonarqube-4acb44301b09b1af2fa8118b888bd9cec415e463.zip
Fix execution of unit test on Windows
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/scan/filesystem/ModuleFileSystemProviderTest.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/sonar-batch/src/test/java/org/sonar/batch/scan/filesystem/ModuleFileSystemProviderTest.java b/sonar-batch/src/test/java/org/sonar/batch/scan/filesystem/ModuleFileSystemProviderTest.java
index 2618c1f805a..a5a8002cd69 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/scan/filesystem/ModuleFileSystemProviderTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/scan/filesystem/ModuleFileSystemProviderTest.java
@@ -21,6 +21,7 @@ package org.sonar.batch.scan.filesystem;
import com.google.common.base.Charsets;
import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.FilenameUtils;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
@@ -113,11 +114,15 @@ public class ModuleFileSystemProviderTest {
assertThat(fs.baseDir().getCanonicalPath()).isEqualTo(baseDir.getCanonicalPath());
assertThat(fs.buildDir().getCanonicalPath()).isEqualTo(buildDir.getCanonicalPath());
assertThat(fs.sourceDirs()).hasSize(1);
- assertThat(fs.sourceDirs().get(0).getCanonicalPath()).endsWith("src/main/java");
+ assertThat(path(fs.sourceDirs().get(0))).endsWith("src/main/java");
assertThat(fs.testDirs()).hasSize(1);
- assertThat(fs.testDirs().get(0).getCanonicalPath()).endsWith("src/test/java");
+ assertThat(path(fs.testDirs().get(0))).endsWith("src/test/java");
assertThat(fs.binaryDirs()).hasSize(1);
- assertThat(fs.binaryDirs().get(0).getCanonicalPath()).endsWith("target/classes");
+ assertThat(path(fs.binaryDirs().get(0))).endsWith("target/classes");
+ }
+
+ private String path(File f) throws IOException {
+ return FilenameUtils.separatorsToUnix(f.getCanonicalPath());
}
private ProjectDefinition newSimpleModule() {