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 /*
25 * @test
26 * @bug 4673940 4930794 8211842
27 * @summary Unit tests for inetd feature
28 * @requires (os.family == "linux" | os.family == "solaris" | os.family == "mac")
29 * @library /test/lib
30 * @build jdk.test.lib.Utils
31 * jdk.test.lib.Asserts
32 * jdk.test.lib.JDKToolFinder
33 * jdk.test.lib.JDKToolLauncher
34 * jdk.test.lib.Platform
35 * jdk.test.lib.process.*
36 * UnixSocketTest StateTest StateTestService EchoTest EchoService
37 * UnixDomainChannelTest CloseTest Launcher Util
38 * @run testng/othervm/native InheritedChannelTest
39 * @key intermittent
40 */
41
42 import java.nio.file.Files;
43 import java.nio.file.Path;
44 import java.nio.file.Paths;
45 import java.util.ArrayList;
46 import java.util.List;
47 import java.util.Map;
48
49 import jdk.test.lib.JDKToolFinder;
50 import jdk.test.lib.Utils;
51 import jdk.test.lib.process.ProcessTools;
52 import jdk.test.lib.Platform;
53
54 import org.testng.annotations.DataProvider;
55 import org.testng.annotations.Test;
56
57 import static java.util.Arrays.asList;
58
59 public class InheritedChannelTest {
60
61 private static final String TEST_SRC = System.getProperty("test.src");
62 private static final String TEST_CLASSES = System.getProperty("test.class.path");
63 private static final Path POLICY_PASS = Paths.get(TEST_SRC, "java.policy.pass");
64 private static final Path POLICY_FAIL = Paths.get(TEST_SRC, "java.policy.fail");
65
66 private static final String OS = System.getProperty("os.name").toLowerCase();
67 private static final String OS_NAME = OS.startsWith("sunos") ? "solaris" : OS;
68
69 private static final String ARCH = System.getProperty("os.arch");
70 private static final String OS_ARCH = ARCH.equals("i386") ? "i586" : ARCH;
71
72 private static final Path libraryPath
73 = Paths.get(System.getProperty("java.library.path"));
74
75 @DataProvider
76 public Object[][] testCases() {
77 return new Object[][] {
78 { "UnixDomainChannelTest", List.of(UnixDomainChannelTest.class.getName())},
79 { "UnixSocketTest", List.of(UnixSocketTest.class.getName())},
80 { "StateTest", List.of(StateTest.class.getName()) },
81 { "EchoTest", List.of(EchoTest.class.getName()) },
82 { "CloseTest", List.of(CloseTest.class.getName()) },
83
84 // run StateTest with a SecurityManager set
85 // Note that the system properties are arguments to StateTest and not options.
86 // These system properties are passed to the launched service as options:
87 // java [-options] class [args...]
|
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 /*
25 * @test
26 * @bug 4673940 4930794 8211842
27 * @summary Unit tests for inetd feature
28 * @requires (os.family == "linux" | os.family == "mac")
29 * @library /test/lib
30 * @build jdk.test.lib.Utils
31 * jdk.test.lib.Asserts
32 * jdk.test.lib.JDKToolFinder
33 * jdk.test.lib.JDKToolLauncher
34 * jdk.test.lib.Platform
35 * jdk.test.lib.process.*
36 * UnixSocketTest StateTest StateTestService EchoTest EchoService
37 * UnixDomainChannelTest CloseTest Launcher Util
38 * @run testng/othervm/native InheritedChannelTest
39 * @key intermittent
40 */
41
42 import java.nio.file.Files;
43 import java.nio.file.Path;
44 import java.nio.file.Paths;
45 import java.util.ArrayList;
46 import java.util.List;
47 import java.util.Map;
48
49 import jdk.test.lib.JDKToolFinder;
50 import jdk.test.lib.Utils;
51 import jdk.test.lib.process.ProcessTools;
52 import jdk.test.lib.Platform;
53
54 import org.testng.annotations.DataProvider;
55 import org.testng.annotations.Test;
56
57 import static java.util.Arrays.asList;
58
59 public class InheritedChannelTest {
60
61 private static final String TEST_SRC = System.getProperty("test.src");
62 private static final String TEST_CLASSES = System.getProperty("test.class.path");
63 private static final Path POLICY_PASS = Paths.get(TEST_SRC, "java.policy.pass");
64 private static final Path POLICY_FAIL = Paths.get(TEST_SRC, "java.policy.fail");
65
66 private static final String OS_NAME = System.getProperty("os.name").toLowerCase();
67
68 private static final String ARCH = System.getProperty("os.arch");
69 private static final String OS_ARCH = ARCH.equals("i386") ? "i586" : ARCH;
70
71 private static final Path libraryPath
72 = Paths.get(System.getProperty("java.library.path"));
73
74 @DataProvider
75 public Object[][] testCases() {
76 return new Object[][] {
77 { "UnixDomainChannelTest", List.of(UnixDomainChannelTest.class.getName())},
78 { "UnixSocketTest", List.of(UnixSocketTest.class.getName())},
79 { "StateTest", List.of(StateTest.class.getName()) },
80 { "EchoTest", List.of(EchoTest.class.getName()) },
81 { "CloseTest", List.of(CloseTest.class.getName()) },
82
83 // run StateTest with a SecurityManager set
84 // Note that the system properties are arguments to StateTest and not options.
85 // These system properties are passed to the launched service as options:
86 // java [-options] class [args...]
|