Author: pascalschumacher
Date: Fri Aug 11 17:35:46 2017
New Revision: 1804830

URL: http://svn.apache.org/viewvc?rev=1804830&view=rev
Log:
FileLockTestCase#testCannotDeleteWhileStreaming, 
FileLockTestCase#testCannotDeleteWhileStreaming2: fix non-windows operating 
systems

Modified:
    
commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/zip/test/FileLockTestCase.java

Modified: 
commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/zip/test/FileLockTestCase.java
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/zip/test/FileLockTestCase.java?rev=1804830&r1=1804829&r2=1804830&view=diff
==============================================================================
--- 
commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/zip/test/FileLockTestCase.java
 (original)
+++ 
commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/zip/test/FileLockTestCase.java
 Fri Aug 11 17:35:46 2017
@@ -26,7 +26,9 @@ import org.apache.commons.vfs2.FileObjec
 import org.apache.commons.vfs2.FileSystemException;
 import org.apache.commons.vfs2.FileSystemManager;
 import org.apache.commons.vfs2.VFS;
+import org.apache.commons.vfs2.util.Os;
 import org.junit.Assert;
+import org.junit.Assume;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -71,8 +73,10 @@ public class FileLockTestCase {
     public void testCannotDeleteWhileStreaming() throws Exception {
         try (final FileObject zipFileObject = manager.resolveFile(uri)) {
             try (InputStream inputStream = 
zipFileObject.getContent().getInputStream()) {
-                // We do not use newZipFile in the Assert message to avoid 
touching it before calling delete().
-                Assert.assertFalse("Could not delete file", 
newZipFile.delete());
+                if (Os.isFamily(Os.OS_FAMILY_WINDOWS)) {
+                    // We do not use newZipFile in the Assert message to avoid 
touching it before calling delete().
+                    Assert.assertFalse("Could not delete file", 
newZipFile.delete());
+                }
             }
         }
         assertDelete();
@@ -80,6 +84,7 @@ public class FileLockTestCase {
 
     @Test
     public void testCannotDeleteWhileStreaming2() throws Exception {
+        Assume.assumeTrue(Os.isFamily(Os.OS_FAMILY_WINDOWS));
         try (final FileObject zipFileObject = manager.resolveFile(uri)) {
             try (InputStream inputStream = 
zipFileObject.getContent().getInputStream()) {
                 // We do not use newZipFile in the Assert message to avoid 
touching it before calling delete().


Reply via email to