Skip to content

Commit de6ec5f

Browse files
committed
backport 23d6f747824ee3d750e2148a2be9d8e1dedbde40
1 parent 248eb54 commit de6ec5f

File tree

7 files changed

+45
-18
lines changed

7 files changed

+45
-18
lines changed

test/jdk/java/net/UnixDomainSocketAddress/AddressTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 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
@@ -24,7 +24,7 @@
2424
/**
2525
* @test
2626
* @bug 8231358
27-
* @compile ../../nio/file/spi/TestProvider.java AddressTest.java
27+
* @compile ../../nio/file/spi/testfsp/testfsp/TestProvider.java AddressTest.java
2828
* @run testng/othervm AddressTest
2929
*/
3030

@@ -51,8 +51,8 @@ public class AddressTest {
5151

5252
@Test
5353
public static void runTest() throws Exception {
54-
TestProvider prov = new TestProvider(FileSystems.getDefault().provider());
55-
Path path = prov.getPath(URI.create("file:/"));
54+
var fsp = new testfsp.TestProvider(FileSystems.getDefault().provider());
55+
Path path = fsp.getPath(URI.create("file:/"));
5656
assertThrows(IAE, () -> UnixDomainSocketAddress.of(path));
5757
}
5858
}

test/jdk/java/nio/file/spi/SetDefaultProvider.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
* questions.
2222
*/
2323

24-
/**
24+
/*
2525
* @test
2626
* @bug 4313887 7006126 8142968 8178380 8183320 8210112 8266345 8263940
27-
* @modules jdk.jartool
27+
* @modules jdk.jartool jdk.jlink
2828
* @library /test/lib
29-
* @build SetDefaultProvider TestProvider m/* jdk.test.lib.process.ProcessTools
30-
* @run testng/othervm SetDefaultProvider
29+
* @build testfsp/* testapp/*
30+
* @run junit SetDefaultProvider
3131
* @summary Runs tests with -Djava.nio.file.spi.DefaultFileSystemProvider set on
3232
* the command line to override the default file system provider
3333
*/

test/jdk/java/nio/file/spi/TestDelegation.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 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
@@ -41,8 +41,8 @@
4141
* @test
4242
* @summary Verifies that a FileSystemProvider's implementation of the exists
4343
* and readAttributesIfExists methods are invoked
44-
* @build TestDelegation TestProvider
45-
* @run testng/othervm TestDelegation
44+
* @compile testfsp/testfsp/TestProvider.java
45+
* @run testng TestDelegation
4646
*/
4747
public class TestDelegation {
4848

@@ -55,7 +55,6 @@ public class TestDelegation {
5555
// The FileSystemProvider used by the test
5656
private MyProvider myProvider;
5757

58-
5958
/**
6059
* Create the FileSystemProvider, the FileSystem and
6160
* Path's used by the test.
@@ -182,7 +181,7 @@ public void testIsRegularFile(Path p, boolean isFile) {
182181
/**
183182
* The FileSystemProvider implementation used by the test
184183
*/
185-
static class MyProvider extends TestProvider {
184+
static class MyProvider extends testfsp.TestProvider {
186185
private final Map<String, List<Path>> calls = new HashMap<>();
187186

188187
private MyProvider() {

test/jdk/java/nio/file/spi/m/module-info.java renamed to test/jdk/java/nio/file/spi/testapp/module-info.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 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
@@ -20,5 +20,5 @@
2020
* or visit www.oracle.com if you need additional information or have any
2121
* questions.
2222
*/
23-
module m {
23+
module testapp {
2424
}

test/jdk/java/nio/file/spi/m/p/Main.java renamed to test/jdk/java/nio/file/spi/testapp/testapp/Main.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 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
@@ -21,7 +21,7 @@
2121
* questions.
2222
*/
2323

24-
package p;
24+
package testapp;
2525

2626
import java.io.File;
2727
import java.nio.file.FileSystem;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*/
23+
24+
module testfsp {
25+
exports testfsp to java.base;
26+
}

test/jdk/java/nio/file/spi/TestProvider.java renamed to test/jdk/java/nio/file/spi/testfsp/testfsp/TestProvider.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2022, 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
@@ -21,6 +21,8 @@
2121
* questions.
2222
*/
2323

24+
package testfsp;
25+
2426
import java.io.File;
2527
import java.nio.file.*;
2628
import java.nio.file.attribute.BasicFileAttributes;

0 commit comments

Comments
 (0)