From: Martin Stockhammer Date: Sun, 16 Apr 2017 19:55:35 +0000 (+0200) Subject: Adding additional information for failing tests X-Git-Tag: archiva-2.2.2~7 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=151fae7e1787e926afa266c94825fe0d6d7b53f8;p=archiva.git Adding additional information for failing tests --- 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 281d13105..cd2cba209 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.nio.file.FileSystemException; import java.nio.file.Files; import java.nio.file.StandardCopyOption; @@ -62,17 +63,23 @@ public class DefaultFileLockManagerTimeoutTest throws Throwable { - File file = new File( System.getProperty( "buildDirectory" ), "foo.txt" ); + try { + File file = new File(System.getProperty("buildDirectory"), "foo.txt"); - Files.deleteIfExists( file.toPath() ); + Files.deleteIfExists(file.toPath()); - File largeJar = new File( System.getProperty( "basedir" ), "src/test/cassandra-all-2.0.3.jar" ); + File largeJar = new File(System.getProperty("basedir"), "src/test/cassandra-all-2.0.3.jar"); - Lock lock = fileLockManager.writeFileLock( file ); + Lock lock = fileLockManager.writeFileLock(file); - Files.copy( largeJar.toPath(), lock.getFile().toPath(), StandardCopyOption.REPLACE_EXISTING ); + Files.copy(largeJar.toPath(), lock.getFile().toPath(), StandardCopyOption.REPLACE_EXISTING); - lock = fileLockManager.writeFileLock( file ); + lock = fileLockManager.writeFileLock(file); + } catch (FileSystemException ex) { + logger.error("Exception from filesystem "+ex.getMessage()); + ex.printStackTrace(); + throw ex; + } }