adammurdoch 2002/10/20 17:47:39 Modified: vfs/src/test/org/apache/commons/vfs/test AbstractFileSystemTestCase.java Log: Fix unit tests for change to getParent() for root of a file system. Revision Changes Path 1.10 +15 -3 jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/test/AbstractFileSystemTestCase.java Index: AbstractFileSystemTestCase.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/test/AbstractFileSystemTestCase.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- AbstractFileSystemTestCase.java 22 Aug 2002 02:42:46 -0000 1.9 +++ AbstractFileSystemTestCase.java 21 Oct 2002 00:47:39 -0000 1.10 @@ -26,6 +26,7 @@ import org.apache.commons.vfs.FileSystemException; import org.apache.commons.vfs.FileType; import org.apache.commons.vfs.NameScope; +import org.apache.commons.vfs.FileSystem; import org.apache.commons.vfs.impl.DefaultFileReplicator; import org.apache.commons.vfs.impl.DefaultFileSystemManager; import org.apache.commons.vfs.impl.PrivilegedFileReplicator; @@ -703,9 +704,20 @@ assertTrue( "child does not exist", !child.exists() ); assertSame( folder, child.getParent() ); - // Test root of the file system has no parent - FileObject root = m_baseFolder.getFileSystem().getRoot(); - assertNull( "root has null parent", root.getParent() ); + // Test the parent of the root of the file system + // TODO - refactor out test cases for layered vs originating fs + final FileSystem fileSystem = m_baseFolder.getFileSystem(); + FileObject root = fileSystem.getRoot(); + if ( fileSystem.getParentLayer() == null ) + { + // No parent layer, so parent should be null + assertNull( "root has null parent", root.getParent() ); + } + else + { + // Parent should be parent of parent layer. + assertSame( fileSystem.getParentLayer().getParent(), root.getParent() ); + } } /**
-- To unsubscribe, e-mail: <mailto:commons-dev-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:commons-dev-help@;jakarta.apache.org>