changeset 13500:708b820b474e

8073078: java/nio/file/FileStore/Basic.java sensitive to NFS configuration Summary: Ignore NoSuchFileExceptions as the store might have been deleted subsequent to creation of the FileStore iterator which is not dynamic. Reviewed-by: alanb
author bpb
date Fri, 31 Jul 2015 07:15:59 -0700
parents 8c0ae4357017
children 613eee8ca9bf
files test/java/nio/file/FileStore/Basic.java
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/nio/file/FileStore/Basic.java	Tue Mar 05 14:03:21 2019 +0530
+++ b/test/java/nio/file/FileStore/Basic.java	Fri Jul 31 07:15:59 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -115,9 +115,15 @@
                 store.type());
 
             // check space attributes are accessible
-            store.getTotalSpace();
-            store.getUnallocatedSpace();
-            store.getUsableSpace();
+            try {
+                store.getTotalSpace();
+                store.getUnallocatedSpace();
+                store.getUsableSpace();
+            } catch (NoSuchFileException nsfe) {
+                // ignore exception as the store could have been
+                // deleted since the iterator was instantiated
+                System.err.format("%s was not found\n", store);
+            }
 
             // two distinct FileStores should not be equal
             assertTrue(!store.equals(prev));