aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorJulien HENRY <henryju@yahoo.fr>2016-06-30 16:56:50 +0200
committerJulien HENRY <henryju@yahoo.fr>2016-07-05 14:00:16 +0200
commita8608d8d77ec640968c308459bba9aef61d12ab2 (patch)
tree6abb1e30c5857b2b569e4ea832b6472337b7270d /sonar-core
parent5fea53afecb02e5c2f48864c6ce33bfae03642ec (diff)
downloadsonarqube-a8608d8d77ec640968c308459bba9aef61d12ab2.tar.gz
sonarqube-a8608d8d77ec640968c308459bba9aef61d12ab2.zip
Disable tests using symlink on Windows
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/test/java/org/sonar/core/util/FileUtilsTest.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/sonar-core/src/test/java/org/sonar/core/util/FileUtilsTest.java b/sonar-core/src/test/java/org/sonar/core/util/FileUtilsTest.java
index 28411c2c110..3e51afe40c9 100644
--- a/sonar-core/src/test/java/org/sonar/core/util/FileUtilsTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/util/FileUtilsTest.java
@@ -25,12 +25,14 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.attribute.BasicFileAttributes;
import javax.annotation.CheckForNull;
+import org.apache.commons.lang.SystemUtils;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.rules.TemporaryFolder;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assume.assumeTrue;
public class FileUtilsTest {
@Rule
@@ -89,6 +91,7 @@ public class FileUtilsTest {
@Test
public void cleanDirectory_follows_symlink_to_target_directory() throws IOException {
+ assumeTrue(SystemUtils.IS_OS_UNIX);
Path target = temporaryFolder.newFolder().toPath();
Path symToDir = Files.createSymbolicLink(temporaryFolder.newFolder().toPath().resolve("sym_to_dir"), target);
Path childFile1 = Files.createFile(target.resolve("file1.txt"));
@@ -157,6 +160,7 @@ public class FileUtilsTest {
@Test
public void deleteQuietly_deletes_symbolicLink() throws IOException {
+ assumeTrue(SystemUtils.IS_OS_UNIX);
Path folder = temporaryFolder.newFolder().toPath();
Path file1 = Files.createFile(folder.resolve("file1.txt"));
Path symLink = Files.createSymbolicLink(folder.resolve("link1"), file1);
@@ -196,6 +200,7 @@ public class FileUtilsTest {
@Test
public void deleteDirectory_throws_IOE_if_file_is_symbolicLink() throws IOException {
+ assumeTrue(SystemUtils.IS_OS_UNIX);
Path folder = temporaryFolder.newFolder().toPath();
Path file1 = Files.createFile(folder.resolve("file1.txt"));
Path symLink = Files.createSymbolicLink(folder.resolve("link1"), file1);