diff options
author | Martin Stockhammer <martin_s@apache.org> | 2017-04-16 22:17:16 +0200 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2017-04-16 22:17:16 +0200 |
commit | b0f22a24699685fd8a77cbe7530b82e26c10bb0f (patch) | |
tree | 886f3aebd40132efd780c48d122628428d03ca68 | |
parent | 151fae7e1787e926afa266c94825fe0d6d7b53f8 (diff) | |
download | archiva-b0f22a24699685fd8a77cbe7530b82e26c10bb0f.tar.gz archiva-b0f22a24699685fd8a77cbe7530b82e26c10bb0f.zip |
Fixing locking tests on windows
-rw-r--r-- | archiva-modules/archiva-base/archiva-filelock/src/test/java/org/apache/archiva/common/filelock/DefaultFileLockManagerTimeoutTest.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/archiva-modules/archiva-base/archiva-filelock/src/test/java/org/apache/archiva/common/filelock/DefaultFileLockManagerTimeoutTest.java b/archiva-modules/archiva-base/archiva-filelock/src/test/java/org/apache/archiva/common/filelock/DefaultFileLockManagerTimeoutTest.java index cd2cba209..666efee18 100644 --- a/archiva-modules/archiva-base/archiva-filelock/src/test/java/org/apache/archiva/common/filelock/DefaultFileLockManagerTimeoutTest.java +++ b/archiva-modules/archiva-base/archiva-filelock/src/test/java/org/apache/archiva/common/filelock/DefaultFileLockManagerTimeoutTest.java @@ -30,6 +30,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import javax.inject.Inject; import javax.inject.Named; import java.io.File; +import java.io.IOException; import java.nio.file.FileSystemException; import java.nio.file.Files; import java.nio.file.StandardCopyOption; @@ -72,7 +73,13 @@ public class DefaultFileLockManagerTimeoutTest Lock lock = fileLockManager.writeFileLock(file); - Files.copy(largeJar.toPath(), lock.getFile().toPath(), StandardCopyOption.REPLACE_EXISTING); + try { + Files.copy(largeJar.toPath(), lock.getFile().toPath(), StandardCopyOption.REPLACE_EXISTING); + } catch (IOException e) { + logger.warn("Copy failed "+e.getMessage()); + // On windows a FileSystemException is thrown + // We ignore this + } lock = fileLockManager.writeFileLock(file); } catch (FileSystemException ex) { |