From: SimonBrandhof Date: Tue, 9 Apr 2013 13:19:57 +0000 (+0200) Subject: Try (again) to fix test on Windows X-Git-Tag: 2.5-rc1~153 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=53e9e82e375fe5f9f75d3db9b8f57c4e8e70f679;p=sonar-scanner-cli.git Try (again) to fix test on Windows --- diff --git a/sonar-runner-batch/src/main/java/org/sonar/runner/batch/FilePattern.java b/sonar-runner-batch/src/main/java/org/sonar/runner/batch/FilePattern.java index 6c4bebc..ec7e339 100644 --- a/sonar-runner-batch/src/main/java/org/sonar/runner/batch/FilePattern.java +++ b/sonar-runner-batch/src/main/java/org/sonar/runner/batch/FilePattern.java @@ -121,7 +121,7 @@ class FilePattern { } public boolean accept(File file) { - return pattern.match(file.getAbsolutePath()); + return pattern.match(FilenameUtils.separatorsToUnix(file.getAbsolutePath())); } public boolean accept(File file, String filename) { diff --git a/sonar-runner-batch/src/test/java/org/sonar/runner/batch/FilePatternTest.java b/sonar-runner-batch/src/test/java/org/sonar/runner/batch/FilePatternTest.java index 8237ee7..64a366d 100644 --- a/sonar-runner-batch/src/test/java/org/sonar/runner/batch/FilePatternTest.java +++ b/sonar-runner-batch/src/test/java/org/sonar/runner/batch/FilePatternTest.java @@ -76,7 +76,6 @@ public class FilePatternTest { } private String path(File f) throws IOException { - String s = FilenameUtils.separatorsToUnix(f.getCanonicalPath()); - return StringUtils.removeEnd(s, "/"); + return FilenameUtils.separatorsToUnix(f.getCanonicalPath()); } }