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 2020/12/05 15:04:39 UTC

[commons-vfs] branch master updated (571d509 -> 4c11e79)

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

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


    from 571d509  Add ability to remove a provider from DefaultFileSystemManager #149.
     new e85cbec  Workaround the fact that these tests were initially written in JUnit 3 (THREE) and fail to run properly within Eclipse today and for quite a while now actually.
     new f1680ea  Minor Javadoc tweak.
     new 4c11e79  Add modified test case for VFS-790 that does not create a URI with an un-escaped nb-sp.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../vfs2/provider/local/test/FileNameTests.java    | 25 ++++++++++++++++++++++
 .../provider/local/test/WindowsFileNameTests.java  |  2 +-
 .../vfs2/test/AbstractProviderTestCase.java        |  2 +-
 3 files changed, 27 insertions(+), 2 deletions(-)


[commons-vfs] 02/03: Minor Javadoc tweak.

Posted by gg...@apache.org.
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

commit f1680ea0508644fead3dda0dbd3d47b56a6f2689
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Dec 5 09:59:09 2020 -0500

    Minor Javadoc tweak.
---
 .../apache/commons/vfs2/provider/local/test/WindowsFileNameTests.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/local/test/WindowsFileNameTests.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/local/test/WindowsFileNameTests.java
index 34d3882..a5ce327 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/local/test/WindowsFileNameTests.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/local/test/WindowsFileNameTests.java
@@ -28,7 +28,7 @@ import org.junit.Test;
 /**
  * Additional naming tests for local file system.
  * <p>
- * Only executed on Windows O/S.
+ * Only executed on Windows.
  */
 public class WindowsFileNameTests extends AbstractProviderTestCase {
 


[commons-vfs] 03/03: Add modified test case for VFS-790 that does not create a URI with an un-escaped nb-sp.

Posted by gg...@apache.org.
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

commit 4c11e798e7d99055c49dc9e123dd7f7d31d6ce46
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Dec 5 10:04:35 2020 -0500

    Add modified test case for VFS-790 that does not create a URI with an
    un-escaped nb-sp.
---
 .../vfs2/provider/local/test/FileNameTests.java    | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/local/test/FileNameTests.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/local/test/FileNameTests.java
index e97b94c..35257de 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/local/test/FileNameTests.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/local/test/FileNameTests.java
@@ -17,8 +17,12 @@
 package org.apache.commons.vfs2.provider.local.test;
 
 import java.io.File;
+import java.net.URI;
 
+import org.apache.commons.vfs2.FileContent;
 import org.apache.commons.vfs2.FileObject;
+import org.apache.commons.vfs2.FileSystemManager;
+import org.apache.commons.vfs2.VFS;
 import org.apache.commons.vfs2.impl.DefaultFileSystemManager;
 import org.apache.commons.vfs2.test.AbstractProviderTestCase;
 import org.junit.Assert;
@@ -47,4 +51,25 @@ public class FileNameTests extends AbstractProviderTestCase {
             assertSame("file object", absFile, uriFile);
         }
     }
+
+    /**
+     * https://issues.apache.org/jira/browse/VFS-790
+     */
+    @Test
+    public final static void testLocalFile() throws Exception {
+        final String prefix = new String(new char[] { '\u0074', '\u0065', '\u0074' });
+        final File f = File.createTempFile(prefix + "-", "-" + prefix);
+        assertTrue(f.exists());
+
+        final URI uri = f.toURI();
+
+        try (final FileSystemManager m = VFS.getManager()) {
+            try (final FileObject s = m.resolveFile(uri)) {
+                try (final FileContent sourceContent = s.getContent()) {
+                    final long size = sourceContent.getSize();
+                    assertEquals(size, f.length());
+                }
+            }
+        }
+    }
 }


[commons-vfs] 01/03: Workaround the fact that these tests were initially written in JUnit 3 (THREE) and fail to run properly within Eclipse today and for quite a while now actually.

Posted by gg...@apache.org.
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

commit e85cbecb9d1a700e7b2c206f84f5ac32e609e1a1
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Dec 5 09:58:44 2020 -0500

    Workaround the fact that these tests were initially written in JUnit 3
    (THREE) and fail to run properly within Eclipse today and for quite a
    while now actually.
---
 .../java/org/apache/commons/vfs2/test/AbstractProviderTestCase.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/test/AbstractProviderTestCase.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/test/AbstractProviderTestCase.java
index 5a0923e..905f894 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/test/AbstractProviderTestCase.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/test/AbstractProviderTestCase.java
@@ -207,7 +207,7 @@ public abstract class AbstractProviderTestCase extends AbstractVfsTestCase {
             super.runTest();
         }
 
-        if (((AbstractFileSystem) readFolder.getFileSystem()).isOpen()) {
+        if (readFolder != null && ((AbstractFileSystem) readFolder.getFileSystem()).isOpen()) {
             String name = "unknown";
             if (method != null) {
                 name = method.getName();