author | michaelm |
Tue, 24 Sep 2019 16:19:11 +0100 | |
changeset 58295 | 7973073dd048 |
parent 53297 | d633be26e59b |
child 58988 | b88e23c84b23 |
permissions | -rw-r--r-- |
45578
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
1 |
/* |
53273
bbc79e0ec9ee
8216265: [testbug] Introduce Platform.sharedLibraryPathVariableName() and adapt all tests.
goetz
parents:
52778
diff
changeset
|
2 |
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. |
45578
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
4 |
* |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
8 |
* |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
13 |
* accompanied this code). |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
14 |
* |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
18 |
* |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
21 |
* questions. |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
22 |
*/ |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
23 |
|
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
24 |
/* |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
25 |
* @test |
52778
dbbf46b13d52
8211842: IPv6_supported wrongly returns false when unix domain socket is bound to fd 0
michaelm
parents:
51117
diff
changeset
|
26 |
* @bug 4673940 4930794 8211842 |
45578
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
27 |
* @summary Unit tests for inetd feature |
58295
7973073dd048
8231187: SelectorProvider.inheritedChannel() returns TCP socket channel for Unix domain socket
michaelm
parents:
53297
diff
changeset
|
28 |
* @requires (os.family == "linux" | os.family == "solaris" | os.family == "mac") |
45578
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
29 |
* @library /test/lib |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
30 |
* @build jdk.test.lib.Utils |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
31 |
* jdk.test.lib.Asserts |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
32 |
* jdk.test.lib.JDKToolFinder |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
33 |
* jdk.test.lib.JDKToolLauncher |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
34 |
* jdk.test.lib.Platform |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
35 |
* jdk.test.lib.process.* |
58295
7973073dd048
8231187: SelectorProvider.inheritedChannel() returns TCP socket channel for Unix domain socket
michaelm
parents:
53297
diff
changeset
|
36 |
* UnixSocketTest StateTest StateTestService EchoTest EchoService |
7973073dd048
8231187: SelectorProvider.inheritedChannel() returns TCP socket channel for Unix domain socket
michaelm
parents:
53297
diff
changeset
|
37 |
* UnixDomainChannelTest CloseTest Launcher Util |
49128
97288886180c
8198834: (ch) Enable java/nio/channels/spi/SelectorProvider/inheritedChannel/InheritedChannelTest.java on linux-x64
bpb
parents:
47216
diff
changeset
|
38 |
* @run testng/othervm/native InheritedChannelTest |
45578
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
39 |
* @key intermittent |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
40 |
*/ |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
41 |
|
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
42 |
import java.nio.file.Files; |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
43 |
import java.nio.file.Path; |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
44 |
import java.nio.file.Paths; |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
45 |
import java.util.ArrayList; |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
46 |
import java.util.List; |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
47 |
import java.util.Map; |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
48 |
|
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
49 |
import jdk.test.lib.JDKToolFinder; |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
50 |
import jdk.test.lib.Utils; |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
51 |
import jdk.test.lib.process.ProcessTools; |
53297
d633be26e59b
8217017: [TESTBUG] Tests fail to compile after JDK-8216265
dholmes
parents:
53273
diff
changeset
|
52 |
import jdk.test.lib.Platform; |
45578
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
53 |
|
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
54 |
import org.testng.annotations.DataProvider; |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
55 |
import org.testng.annotations.Test; |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
56 |
|
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
57 |
import static java.util.Arrays.asList; |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
58 |
|
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
59 |
public class InheritedChannelTest { |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
60 |
|
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
61 |
private static final String TEST_SRC = System.getProperty("test.src"); |
51117
c96c7d08ae49
8207316: java/nio/channels/spi/SelectorProvider/inheritedChannel/InheritedChannelTest.java failed
mli
parents:
49128
diff
changeset
|
62 |
private static final String TEST_CLASSES = System.getProperty("test.class.path"); |
45578
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
63 |
private static final Path POLICY_PASS = Paths.get(TEST_SRC, "java.policy.pass"); |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
64 |
private static final Path POLICY_FAIL = Paths.get(TEST_SRC, "java.policy.fail"); |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
65 |
|
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
66 |
private static final String OS = System.getProperty("os.name").toLowerCase(); |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
67 |
private static final String OS_NAME = OS.startsWith("sunos") ? "solaris" : OS; |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
68 |
|
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
69 |
private static final String ARCH = System.getProperty("os.arch"); |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
70 |
private static final String OS_ARCH = ARCH.equals("i386") ? "i586" : ARCH; |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
71 |
|
53273
bbc79e0ec9ee
8216265: [testbug] Introduce Platform.sharedLibraryPathVariableName() and adapt all tests.
goetz
parents:
52778
diff
changeset
|
72 |
private static final Path libraryPath |
49128
97288886180c
8198834: (ch) Enable java/nio/channels/spi/SelectorProvider/inheritedChannel/InheritedChannelTest.java on linux-x64
bpb
parents:
47216
diff
changeset
|
73 |
= Paths.get(System.getProperty("java.library.path")); |
45578
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
74 |
|
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
75 |
@DataProvider |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
76 |
public Object[][] testCases() { |
58295
7973073dd048
8231187: SelectorProvider.inheritedChannel() returns TCP socket channel for Unix domain socket
michaelm
parents:
53297
diff
changeset
|
77 |
return new Object[][] { |
7973073dd048
8231187: SelectorProvider.inheritedChannel() returns TCP socket channel for Unix domain socket
michaelm
parents:
53297
diff
changeset
|
78 |
{ "UnixDomainChannelTest", List.of(UnixDomainChannelTest.class.getName())}, |
52778
dbbf46b13d52
8211842: IPv6_supported wrongly returns false when unix domain socket is bound to fd 0
michaelm
parents:
51117
diff
changeset
|
79 |
{ "UnixSocketTest", List.of(UnixSocketTest.class.getName())}, |
45578
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
80 |
{ "StateTest", List.of(StateTest.class.getName()) }, |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
81 |
{ "EchoTest", List.of(EchoTest.class.getName()) }, |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
82 |
{ "CloseTest", List.of(CloseTest.class.getName()) }, |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
83 |
|
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
84 |
// run StateTest with a SecurityManager set |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
85 |
// Note that the system properties are arguments to StateTest and not options. |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
86 |
// These system properties are passed to the launched service as options: |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
87 |
// java [-options] class [args...] |
58295
7973073dd048
8231187: SelectorProvider.inheritedChannel() returns TCP socket channel for Unix domain socket
michaelm
parents:
53297
diff
changeset
|
88 |
|
45578
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
89 |
{ "StateTest run with " + POLICY_PASS, List.of(StateTest.class.getName(), |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
90 |
"-Djava.security.manager", |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
91 |
"-Djava.security.policy=" |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
92 |
+ POLICY_PASS) |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
93 |
}, |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
94 |
{ "StateTest run with " + POLICY_FAIL, List.of(StateTest.class.getName(), |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
95 |
"-expectFail", |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
96 |
"-Djava.security.manager", |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
97 |
"-Djava.security.policy=" |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
98 |
+ POLICY_FAIL) |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
99 |
} |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
100 |
}; |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
101 |
} |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
102 |
|
58295
7973073dd048
8231187: SelectorProvider.inheritedChannel() returns TCP socket channel for Unix domain socket
michaelm
parents:
53297
diff
changeset
|
103 |
@Test(dataProvider = "testCases", timeOut=30000) |
45578
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
104 |
public void test(String desc, List<String> opts) throws Throwable { |
53273
bbc79e0ec9ee
8216265: [testbug] Introduce Platform.sharedLibraryPathVariableName() and adapt all tests.
goetz
parents:
52778
diff
changeset
|
105 |
String pathVar = Platform.sharedLibraryPathVariableName(); |
bbc79e0ec9ee
8216265: [testbug] Introduce Platform.sharedLibraryPathVariableName() and adapt all tests.
goetz
parents:
52778
diff
changeset
|
106 |
System.out.println(pathVar + "=" + libraryPath); |
45578
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
107 |
|
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
108 |
List<String> args = new ArrayList<>(); |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
109 |
args.add(JDKToolFinder.getJDKTool("java")); |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
110 |
args.addAll(asList(Utils.getTestJavaOpts())); |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
111 |
args.addAll(List.of("--add-opens", "java.base/java.io=ALL-UNNAMED", |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
112 |
"--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED")); |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
113 |
args.addAll(opts); |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
114 |
|
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
115 |
ProcessBuilder pb = new ProcessBuilder(args); |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
116 |
|
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
117 |
Map<String, String> env = pb.environment(); |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
118 |
env.put("CLASSPATH", TEST_CLASSES); |
53273
bbc79e0ec9ee
8216265: [testbug] Introduce Platform.sharedLibraryPathVariableName() and adapt all tests.
goetz
parents:
52778
diff
changeset
|
119 |
env.put(pathVar, libraryPath.toString()); |
45578
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
120 |
|
53273
bbc79e0ec9ee
8216265: [testbug] Introduce Platform.sharedLibraryPathVariableName() and adapt all tests.
goetz
parents:
52778
diff
changeset
|
121 |
ProcessTools.executeCommand(pb).shouldHaveExitValue(0); |
45578
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
122 |
} |
cd8f28842351
8182465: Refactor shell test java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh to java
amlu
parents:
diff
changeset
|
123 |
} |