commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1243088 - /commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ContentTests.java
Date Sat, 11 Feb 2012 16:32:25 GMT
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);
     }
 
     /**



Mime
View raw message