File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
test/jdk/java/nio/file/FileStore Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 3838
3939import jdk .test .lib .Platform ;
4040import jdk .test .lib .util .FileUtils ;
41+ import static jdk .test .lib .Asserts .*;
4142
4243public class Basic {
4344
@@ -52,11 +53,6 @@ public static void main(String[] args) throws IOException {
5253 }
5354 }
5455
55- static void assertTrue (boolean okay ) {
56- if (!okay )
57- throw new RuntimeException ("Assertion failed" );
58- }
59-
6056 static void checkWithin1GB (String space , long expected , long actual ) {
6157 long diff = Math .abs (actual - expected );
6258 if (diff > G ) {
@@ -73,8 +69,11 @@ static <V extends FileAttributeView> void testFileAttributes(Path file,
7369 FileStore store = Files .getFileStore (file );
7470 boolean supported = store .supportsFileAttributeView (viewClass );
7571 assertTrue (store .supportsFileAttributeView (viewName ) == supported );
76- boolean haveView = Files .getFileAttributeView (file , viewClass ) != null ;
77- assertTrue (haveView == supported );
72+ // If the file attribute view is supported by the FileStore then
73+ // Files.getFileAttributeView should return that view
74+ if (supported ) {
75+ assertNotNull (Files .getFileAttributeView (file , viewClass ));
76+ }
7877 }
7978
8079 static void doTests (Path dir ) throws IOException {
You can’t perform that action at this time.
0 commit comments