jdk/test/java/nio/file/attribute/FileStoreAttributeView/Basic.java
changeset 3065 452aaa2899fc
parent 2057 3acf8e5e2ca0
child 5506 202f599c92aa
--- a/jdk/test/java/nio/file/attribute/FileStoreAttributeView/Basic.java	Fri Jun 26 18:39:45 2009 -0700
+++ b/jdk/test/java/nio/file/attribute/FileStoreAttributeView/Basic.java	Sat Jun 27 21:46:53 2009 +0100
@@ -22,7 +22,7 @@
  */
 
 /* @test
- * @bug 4313887
+ * @bug 4313887 6838333
  * @summary Unit test for java.nio.file.attribute.FileStoreAttributeView
  * @library ../..
  */
@@ -106,43 +106,10 @@
         checkWithin1GB(free, attrs.unallocatedSpace());
         checkWithin1GB(usable, attrs.usableSpace());
 
-        // get values by name (and in bulk)
-        FileStoreAttributeView view = fs.getFileStoreAttributeView("space");
-        checkWithin1GB(total, (Long)view.getAttribute("totalSpace"));
-        checkWithin1GB(free, (Long)view.getAttribute("unallocatedSpace"));
-        checkWithin1GB(usable, (Long)view.getAttribute("usableSpace"));
-        Map<String,?> map = view.readAttributes("*");
-        checkWithin1GB(total, (Long)map.get("totalSpace"));
-        checkWithin1GB(free, (Long)map.get("unallocatedSpace"));
-        checkWithin1GB(usable, (Long)map.get("usableSpace"));
-        map = view.readAttributes("totalSpace", "unallocatedSpace", "usableSpace");
-        checkWithin1GB(total, (Long)map.get("totalSpace"));
-        checkWithin1GB(free, (Long)map.get("unallocatedSpace"));
-        checkWithin1GB(usable, (Long)map.get("usableSpace"));
-    }
-
-    /**
-     * Check (Windows-specific) volume attributes
-     */
-    static void checkVolumeAttributes() throws IOException {
-        System.out.println(" -- volumes -- ");
-        for (FileStore store: FileSystems.getDefault().getFileStores()) {
-            FileStoreAttributeView view = store.getFileStoreAttributeView("volume");
-            if (view == null)
-                continue;
-            Map<String,?> attrs = view.readAttributes("*");
-            int vsn = (Integer)attrs.get("vsn");
-            boolean compressed = (Boolean)attrs.get("compressed");
-            boolean removable = (Boolean)attrs.get("removable");
-            boolean cdrom = (Boolean)attrs.get("cdrom");
-            String type;
-            if (removable) type = "removable";
-            else if (cdrom) type = "cdrom";
-            else type = "unknown";
-            System.out.format("%s (%s) vsn:%x compressed:%b%n", store.name(),
-                type, vsn, compressed);
-        }
-
+        // get values by name
+        checkWithin1GB(total, (Long)fs.getAttribute("space:totalSpace"));
+        checkWithin1GB(free, (Long)fs.getAttribute("space:unallocatedSpace"));
+        checkWithin1GB(usable, (Long)fs.getAttribute("space:usableSpace"));
     }
 
     public static void main(String[] args) throws IOException {
@@ -161,9 +128,6 @@
             Path file = dir.resolve("foo").createFile();
             checkSpace(file);
 
-            // volume attributes (Windows specific)
-            checkVolumeAttributes();
-
         } finally {
             TestUtil.removeAll(dir);
         }