File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed
attribute/UserDefinedFileAttributeView Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2008, 2023 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2008, 2025 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
2222 */
2323
2424/* @test
25- * @bug 4313887 6873621 6979526 7006126 7020517 8264400
25+ * @bug 4313887 6873621 6979526 7006126 7020517 8264400 8360887
2626 * @summary Unit test for java.nio.file.FileStore
2727 * @key intermittent
2828 * @library .. /test/lib
@@ -107,6 +107,12 @@ static void doTests(Path dir) throws IOException {
107107 assertTrue (store1 .supportsFileAttributeView ("user" ) ==
108108 store1 .supportsFileAttributeView (UserDefinedFileAttributeView .class ));
109109
110+ // check if getFileAttributeView behaves as specified if the used defined view is unsupported
111+ if (!store1 .supportsFileAttributeView (UserDefinedFileAttributeView .class ) &&
112+ Files .getFileAttributeView (dir , UserDefinedFileAttributeView .class ) != null ) {
113+ throw new RuntimeException ("UserDefinedFileAttributeView not supported, getFileAttributeView should return null" );
114+ }
115+
110116 /**
111117 * Test: Space atributes
112118 */
Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2008, 2025 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2008, 2024 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
2222 */
2323
2424/* @test
25- * @bug 4313887 6838333 8273922 8360887
25+ * @bug 4313887 6838333 8273922
2626 * @summary Unit test for java.nio.file.attribute.UserDefinedFileAttributeView
2727 * @library ../.. /test/lib
2828 * @key randomness
@@ -282,11 +282,6 @@ public static void main(String[] args) throws IOException {
282282 Path dir = TestUtil .createTemporaryDirectory ();
283283 try {
284284 if (!Files .getFileStore (dir ).supportsFileAttributeView ("user" )) {
285- // check if getFileAttributeView behaves as specified in this case
286- if (Files .getFileAttributeView (dir , UserDefinedFileAttributeView .class ) != null ) {
287- throw new RuntimeException ("UserDefinedFileAttributeView not supported, getFileAttributeView should return null" );
288- }
289-
290285 System .out .println ("UserDefinedFileAttributeView not supported - skip test" );
291286 return ;
292287 }
You can’t perform that action at this time.
0 commit comments