Skip to content

Commit 8bfd42a

Browse files
committed
Move test to FileStore/Basic.java.
1 parent a8ffcbc commit 8bfd42a

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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
@@ -22,7 +22,7 @@
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
*/

test/jdk/java/nio/file/attribute/UserDefinedFileAttributeView/Basic.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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
@@ -22,7 +22,7 @@
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
}

0 commit comments

Comments
 (0)