test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/InheritedChannelTest.java
changeset 49128 97288886180c
parent 47216 71c04702a3d5
child 51117 c96c7d08ae49
equal deleted inserted replaced
49127:73385a708426 49128:97288886180c
     1 /*
     1 /*
     2  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    32  *        jdk.test.lib.JDKToolFinder
    32  *        jdk.test.lib.JDKToolFinder
    33  *        jdk.test.lib.JDKToolLauncher
    33  *        jdk.test.lib.JDKToolLauncher
    34  *        jdk.test.lib.Platform
    34  *        jdk.test.lib.Platform
    35  *        jdk.test.lib.process.*
    35  *        jdk.test.lib.process.*
    36  *        StateTest StateTestService EchoTest EchoService CloseTest Launcher Util
    36  *        StateTest StateTestService EchoTest EchoService CloseTest Launcher Util
    37  * @run testng/othervm InheritedChannelTest
    37  * @run testng/othervm/native InheritedChannelTest
    38  * @key intermittent
    38  * @key intermittent
    39  */
    39  */
    40 
    40 
    41 import java.nio.file.Files;
    41 import java.nio.file.Files;
    42 import java.nio.file.Path;
    42 import java.nio.file.Path;
    66 
    66 
    67     private static final String ARCH = System.getProperty("os.arch");
    67     private static final String ARCH = System.getProperty("os.arch");
    68     private static final String OS_ARCH = ARCH.equals("i386") ? "i586" : ARCH;
    68     private static final String OS_ARCH = ARCH.equals("i386") ? "i586" : ARCH;
    69 
    69 
    70     private static final Path LD_LIBRARY_PATH
    70     private static final Path LD_LIBRARY_PATH
    71             = Paths.get(TEST_SRC, "lib", OS_NAME + "-" + OS_ARCH);
    71             = Paths.get(System.getProperty("java.library.path"));
    72 
       
    73     private static final Path LAUNCHERLIB = LD_LIBRARY_PATH.resolve("libLauncher.so");
       
    74 
    72 
    75     @DataProvider
    73     @DataProvider
    76     public Object[][] testCases() {
    74     public Object[][] testCases() {
    77         return new Object[][]{
    75         return new Object[][]{
    78             { "StateTest", List.of(StateTest.class.getName()) },
    76             { "StateTest", List.of(StateTest.class.getName()) },
    97         };
    95         };
    98     }
    96     }
    99 
    97 
   100     @Test(dataProvider = "testCases")
    98     @Test(dataProvider = "testCases")
   101     public void test(String desc, List<String> opts) throws Throwable {
    99     public void test(String desc, List<String> opts) throws Throwable {
   102         if (!Files.exists(LAUNCHERLIB)) {
       
   103             System.out.println("Cannot find " + LAUNCHERLIB
       
   104                     + " - library not available for this system");
       
   105             return;
       
   106         }
       
   107         System.out.println("LD_LIBRARY_PATH=" + LD_LIBRARY_PATH);
   100         System.out.println("LD_LIBRARY_PATH=" + LD_LIBRARY_PATH);
   108 
   101 
   109         List<String> args = new ArrayList<>();
   102         List<String> args = new ArrayList<>();
   110         args.add(JDKToolFinder.getJDKTool("java"));
   103         args.add(JDKToolFinder.getJDKTool("java"));
   111         args.addAll(asList(Utils.getTestJavaOpts()));
   104         args.addAll(asList(Utils.getTestJavaOpts()));