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 2012/02/11 17:32:25 UTC

svn commit: r1243088 - /commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ContentTests.java

Author: ggregory
Date: Sat Feb 11 16:32:25 2012
New Revision: 1243088

URL: http://svn.apache.org/viewvc?rev=1243088&view=rev
Log:
Test FS root with two different code paths.

Modified:
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ContentTests.java

Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ContentTests.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ContentTests.java?rev=1243088&r1=1243087&r2=1243088&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ContentTests.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ContentTests.java Sat Feb 11 16:32:25 2012
@@ -97,14 +97,26 @@ public class ContentTests
     /**
      * Tests root of file system exists.
      */
-    public void testRoot() throws FileSystemException
+    public void testRootURI() throws FileSystemException
     {
         FileSystem fs = getReadFolder().getFileSystem();
         String uri = fs.getRootURI();
-        final FileObject file = getManager().resolveFile(uri);
-        //final FileObject file = getReadFolder().getFileSystem().getRoot();
-        assertTrue(file.exists());
-        assertTrue(file.getType() != FileType.IMAGINARY);
+        testRoot(getManager().resolveFile(uri));
+    }
+
+    /**
+     * Tests root of file system exists.
+     */
+    public void testRootAPI() throws FileSystemException
+    {
+        FileSystem fs = getReadFolder().getFileSystem();
+        testRoot(fs.getRoot());
+    }
+
+    private void testRoot(final FileObject root) throws FileSystemException
+    {
+        assertTrue(root.exists());
+        assertTrue(root.getType() != FileType.IMAGINARY);
     }
 
     /**