]> source.dussan.org Git - archiva.git/commitdiff
Adding additional information for failing tests
authorMartin Stockhammer <martin_s@apache.org>
Sun, 16 Apr 2017 19:55:35 +0000 (21:55 +0200)
committerMartin Stockhammer <martin_s@apache.org>
Sun, 16 Apr 2017 19:55:35 +0000 (21:55 +0200)
archiva-modules/archiva-base/archiva-filelock/src/test/java/org/apache/archiva/common/filelock/DefaultFileLockManagerTimeoutTest.java

index 281d1310547fd6d5fecc86bba61a33d78c5fbe7b..cd2cba209c511133a16f63fddc7767a1eafd24ca 100644 (file)
@@ -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;
+            }
 
     }