< prev index next >

test/jdk/java/nio/file/FileSystem/Basic.java

Print this page
rev 59105 : imported patch corelibs


 111         String os = System.getProperty("os.name");
 112         FileSystem fs = FileSystems.getDefault();
 113 
 114         // close should throw UOE
 115         try {
 116             fs.close();
 117             throw new RuntimeException("UnsupportedOperationException expected");
 118         } catch (UnsupportedOperationException e) { }
 119         check(fs.isOpen(), "should be open");
 120 
 121         check(!fs.isReadOnly(), "should provide read-write access");
 122 
 123         check(fs.provider().getScheme().equals("file"),
 124             "should use 'file' scheme");
 125 
 126         // sanity check FileStores
 127         checkFileStores(fs);
 128 
 129         // sanity check supportedFileAttributeViews
 130         checkSupported(fs, "basic");
 131         if (os.equals("SunOS"))
 132             checkSupported(fs, "posix", "unix", "owner", "acl", "user");
 133         if (os.equals("Linux"))
 134             checkSupported(fs, "posix", "unix", "owner", "dos", "user");
 135         if (os.contains("OS X"))
 136             checkSupported(fs, "posix", "unix", "owner");
 137         if (os.equals("Windows"))
 138             checkSupported(fs, "owner", "dos", "acl", "user");
 139 
 140         // sanity check throwing of IllegalArgumentException by
 141         // FileSystems.getFileSystem(URI) if the URI scheme is null
 142         checkIAE();
 143 
 144         // sanity check non-throwing of UnsupportedOperationException by
 145         // FileSystems.newFileSystem(URI, ..)
 146         checkNoUOE();
 147     }
 148 }


 111         String os = System.getProperty("os.name");
 112         FileSystem fs = FileSystems.getDefault();
 113 
 114         // close should throw UOE
 115         try {
 116             fs.close();
 117             throw new RuntimeException("UnsupportedOperationException expected");
 118         } catch (UnsupportedOperationException e) { }
 119         check(fs.isOpen(), "should be open");
 120 
 121         check(!fs.isReadOnly(), "should provide read-write access");
 122 
 123         check(fs.provider().getScheme().equals("file"),
 124             "should use 'file' scheme");
 125 
 126         // sanity check FileStores
 127         checkFileStores(fs);
 128 
 129         // sanity check supportedFileAttributeViews
 130         checkSupported(fs, "basic");


 131         if (os.equals("Linux"))
 132             checkSupported(fs, "posix", "unix", "owner", "dos", "user");
 133         if (os.contains("OS X"))
 134             checkSupported(fs, "posix", "unix", "owner");
 135         if (os.equals("Windows"))
 136             checkSupported(fs, "owner", "dos", "acl", "user");
 137 
 138         // sanity check throwing of IllegalArgumentException by
 139         // FileSystems.getFileSystem(URI) if the URI scheme is null
 140         checkIAE();
 141 
 142         // sanity check non-throwing of UnsupportedOperationException by
 143         // FileSystems.newFileSystem(URI, ..)
 144         checkNoUOE();
 145     }
 146 }
< prev index next >