1 16 package org.apache.commons.vfs.test; 17 18 import org.apache.commons.vfs.Capability; 19 import org.apache.commons.vfs.FileName; 20 import org.apache.commons.vfs.FileObject; 21 22 27 public class UriTests 28 extends AbstractProviderTestCase 29 { 30 33 protected Capability[] getRequiredCaps() 34 { 35 return new Capability[]{Capability.URI}; 36 } 37 38 41 public void testAbsoluteURI() throws Exception 42 { 43 final FileObject readFolder = getReadFolder(); 44 45 final String uri = readFolder.getName().getURI(); 47 FileObject file = getManager().resolveFile(uri, readFolder.getFileSystem().getFileSystemOptions()); 48 assertSame("file object", readFolder, file); 49 50 final String rootUri = readFolder.getName().getRootURI(); 52 file = getManager().resolveFile(rootUri, readFolder.getFileSystem().getFileSystemOptions()); 53 assertSame(readFolder.getFileSystem().getRoot(), file); 54 assertEquals(rootUri, file.getName().getRootURI()); 55 assertEquals(rootUri, file.getName().getURI()); 56 assertEquals(FileName.ROOT_PATH, file.getName().getPath()); 57 } 58 } 59 | Popular Tags |