You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2019/10/06 13:09:58 UTC

[commons-vfs] branch master updated: [VFS-733] Parent layer of ZipFileSystem vanishes through OnCallRefreshFileObject.

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git


The following commit(s) were added to refs/heads/master by this push:
     new b5d59c4  [VFS-733] Parent layer of ZipFileSystem vanishes through OnCallRefreshFileObject.
b5d59c4 is described below

commit b5d59c4dd50c8164bc4f5d4a38592b794a383813
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Oct 6 09:09:54 2019 -0400

    [VFS-733] Parent layer of ZipFileSystem vanishes through
    OnCallRefreshFileObject.
    
    Add ignored tests.
---
 .../commons/vfs2/provider/zip/Jira733TestCase.java | 71 ++++++++++++++++++----
 1 file changed, 58 insertions(+), 13 deletions(-)

diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/Jira733TestCase.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/Jira733TestCase.java
index 1ba6427..8a9aa42 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/Jira733TestCase.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/zip/Jira733TestCase.java
@@ -39,6 +39,19 @@ public class Jira733TestCase {
         VFS.reset();
     }
 
+    @Test
+    public void testZipParentLayer() throws Exception {
+        final File file = new File("src/test/resources/test-data/test.zip");
+        final String nestedPath = "zip:" + file.getAbsolutePath() + "!/read-tests/file1.txt";
+        final FileObject zipFileObject = VFS.getManager().resolveFile(nestedPath);
+        final FileObject wrappedFileObject = new OnCallRefreshFileObject(zipFileObject);
+        // VFS.getManager().getFilesCache().close();
+        Assert.assertNotNull("getParentLayer() 1", wrappedFileObject.getFileSystem().getParentLayer());
+        wrappedFileObject.exists();
+        wrappedFileObject.getContent();
+        Assert.assertNotNull("getParentLayer() 2", wrappedFileObject.getFileSystem().getParentLayer());
+    }
+
     private void testZipParentLayer(final VfsConsumer<FileObject> consumer) throws Exception {
         final File file = new File("src/test/resources/test-data/test.zip");
         Assert.assertTrue(file.exists());
@@ -55,19 +68,6 @@ public class Jira733TestCase {
     }
 
     @Test
-    public void testZipParentLayer() throws Exception {
-        final File file = new File("src/test/resources/test-data/test.zip");
-        final String nestedPath = "zip:" + file.getAbsolutePath() + "!/read-tests/file1.txt";
-        final FileObject zipFileObject = VFS.getManager().resolveFile(nestedPath);
-        final FileObject wrappedFileObject = new OnCallRefreshFileObject(zipFileObject);
-        // VFS.getManager().getFilesCache().close();
-        Assert.assertNotNull("getParentLayer() 1", wrappedFileObject.getFileSystem().getParentLayer());
-        wrappedFileObject.exists();
-        wrappedFileObject.getContent();
-        Assert.assertNotNull("getParentLayer() 2", wrappedFileObject.getFileSystem().getParentLayer());
-    }
-
-    @Test
     public void testZipParentLayer_exists() throws Exception {
         testZipParentLayer(fileObject -> fileObject.exists());
     }
@@ -81,12 +81,57 @@ public class Jira733TestCase {
     }
 
     @Test
+    public void testZipParentLayer_getChildren() throws Exception {
+        testZipParentLayer(fileObject -> fileObject.getParent().getChildren());
+    }
+
+    @Test
     public void testZipParentLayer_getContents() throws Exception {
         testZipParentLayer(fileObject -> fileObject.getContent());
     }
 
     @Test
+    public void testZipParentLayer_getType() throws Exception {
+        testZipParentLayer(fileObject -> fileObject.getType());
+    }
+
+    @Test
+    public void testZipParentLayer_isAttached() throws Exception {
+        testZipParentLayer(fileObject -> fileObject.isAttached());
+    }
+
+    @Test
+    public void testZipParentLayer_isContentOpen() throws Exception {
+        testZipParentLayer(fileObject -> fileObject.isContentOpen());
+    }
+
+    @Test
+    public void testZipParentLayer_isExecutable() throws Exception {
+        testZipParentLayer(fileObject -> fileObject.isExecutable());
+    }
+
+    @Test
+    public void testZipParentLayer_isFile() throws Exception {
+        testZipParentLayer(fileObject -> fileObject.isFile());
+    }
+
+    @Test
+    public void testZipParentLayer_isFolder() throws Exception {
+        testZipParentLayer(fileObject -> fileObject.isFolder());
+    }
+
+    @Test
+    public void testZipParentLayer_isHidden() throws Exception {
+        testZipParentLayer(fileObject -> fileObject.isHidden());
+    }
+
+    @Test
     public void testZipParentLayer_isReadable() throws Exception {
         testZipParentLayer(fileObject -> fileObject.isReadable());
     }
+
+    @Test
+    public void testZipParentLayer_isWriteable() throws Exception {
+        testZipParentLayer(fileObject -> fileObject.isWriteable());
+    }
 }